├── .gitignore ├── MANIFEST.in ├── README.md ├── agriculture ├── __init__.py ├── agriculture │ ├── __init__.py │ ├── doctype │ │ ├── __init__.py │ │ ├── agriculture_analysis_criteria │ │ │ ├── __init__.py │ │ │ ├── agriculture_analysis_criteria.js │ │ │ ├── agriculture_analysis_criteria.json │ │ │ ├── agriculture_analysis_criteria.py │ │ │ └── test_agriculture_analysis_criteria.py │ │ ├── agriculture_task │ │ │ ├── __init__.py │ │ │ ├── agriculture_task.js │ │ │ ├── agriculture_task.json │ │ │ ├── agriculture_task.py │ │ │ └── test_agriculture_task.py │ │ ├── crop │ │ │ ├── __init__.py │ │ │ ├── crop.js │ │ │ ├── crop.json │ │ │ ├── crop.py │ │ │ ├── crop_dashboard.py │ │ │ ├── test_crop.js │ │ │ ├── test_crop.py │ │ │ └── test_records.json │ │ ├── crop_cycle │ │ │ ├── __init__.py │ │ │ ├── crop_cycle.js │ │ │ ├── crop_cycle.json │ │ │ ├── crop_cycle.py │ │ │ ├── test_crop_cycle.js │ │ │ ├── test_crop_cycle.py │ │ │ └── test_records.json │ │ ├── detected_disease │ │ │ ├── __init__.py │ │ │ ├── detected_disease.json │ │ │ └── detected_disease.py │ │ ├── disease │ │ │ ├── __init__.py │ │ │ ├── disease.js │ │ │ ├── disease.json │ │ │ ├── disease.py │ │ │ ├── test_disease.js │ │ │ ├── test_disease.py │ │ │ └── test_records.json │ │ ├── fertilizer │ │ │ ├── __init__.py │ │ │ ├── fertilizer.js │ │ │ ├── fertilizer.json │ │ │ ├── fertilizer.py │ │ │ ├── test_fertilizer.js │ │ │ ├── test_fertilizer.py │ │ │ └── test_records.json │ │ ├── fertilizer_content │ │ │ ├── __init__.py │ │ │ ├── fertilizer_content.json │ │ │ └── fertilizer_content.py │ │ ├── linked_location │ │ │ ├── __init__.py │ │ │ ├── linked_location.json │ │ │ └── linked_location.py │ │ ├── linked_plant_analysis │ │ │ ├── __init__.py │ │ │ ├── linked_plant_analysis.json │ │ │ └── linked_plant_analysis.py │ │ ├── linked_soil_analysis │ │ │ ├── __init__.py │ │ │ ├── linked_soil_analysis.json │ │ │ └── linked_soil_analysis.py │ │ ├── linked_soil_texture │ │ │ ├── __init__.py │ │ │ ├── linked_soil_texture.json │ │ │ └── linked_soil_texture.py │ │ ├── plant_analysis │ │ │ ├── __init__.py │ │ │ ├── plant_analysis.js │ │ │ ├── plant_analysis.json │ │ │ ├── plant_analysis.py │ │ │ └── test_plant_analysis.py │ │ ├── plant_analysis_criteria │ │ │ ├── __init__.py │ │ │ ├── plant_analysis_criteria.json │ │ │ └── plant_analysis_criteria.py │ │ ├── soil_analysis │ │ │ ├── __init__.py │ │ │ ├── soil_analysis.js │ │ │ ├── soil_analysis.json │ │ │ ├── soil_analysis.py │ │ │ └── test_soil_analysis.py │ │ ├── soil_analysis_criteria │ │ │ ├── __init__.py │ │ │ ├── soil_analysis_criteria.json │ │ │ └── soil_analysis_criteria.py │ │ ├── soil_texture │ │ │ ├── __init__.py │ │ │ ├── soil_texture.js │ │ │ ├── soil_texture.json │ │ │ ├── soil_texture.py │ │ │ ├── test_records.json │ │ │ ├── test_soil_texture.js │ │ │ └── test_soil_texture.py │ │ ├── soil_texture_criteria │ │ │ ├── __init__.py │ │ │ ├── soil_texture_criteria.json │ │ │ └── soil_texture_criteria.py │ │ ├── water_analysis │ │ │ ├── __init__.py │ │ │ ├── test_water_analysis.js │ │ │ ├── test_water_analysis.py │ │ │ ├── water_analysis.js │ │ │ ├── water_analysis.json │ │ │ └── water_analysis.py │ │ ├── water_analysis_criteria │ │ │ ├── __init__.py │ │ │ ├── water_analysis_criteria.json │ │ │ └── water_analysis_criteria.py │ │ ├── weather │ │ │ ├── __init__.py │ │ │ ├── test_weather.py │ │ │ ├── weather.js │ │ │ ├── weather.json │ │ │ └── weather.py │ │ └── weather_parameter │ │ │ ├── __init__.py │ │ │ ├── weather_parameter.json │ │ │ └── weather_parameter.py │ ├── setup.py │ └── workspace │ │ └── agriculture │ │ └── agriculture.json ├── config │ ├── __init__.py │ ├── desktop.py │ └── docs.py ├── hooks.py ├── modules.txt ├── patches.txt └── templates │ ├── __init__.py │ └── pages │ └── __init__.py ├── license.txt ├── requirements.txt └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | *.egg-info 4 | *.swp 5 | tags 6 | agriculture/docs/current -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include MANIFEST.in 2 | include requirements.txt 3 | include *.json 4 | include *.md 5 | include *.py 6 | include *.txt 7 | recursive-include agriculture *.css 8 | recursive-include agriculture *.csv 9 | recursive-include agriculture *.html 10 | recursive-include agriculture *.ico 11 | recursive-include agriculture *.js 12 | recursive-include agriculture *.json 13 | recursive-include agriculture *.md 14 | recursive-include agriculture *.png 15 | recursive-include agriculture *.py 16 | recursive-include agriculture *.svg 17 | recursive-include agriculture *.txt 18 | recursive-exclude agriculture *.pyc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Agriculture 2 | 3 | The Agriculture Domain of ERPNext comes with features to record crops and land, track plant, soil, water, weather analytics, and even track diseases and fertilizers. You can check out the following topics after this brief introduction to the agriculture module in ERPNext. 4 | 5 | 6 | ### Installation 7 | 8 | Using bench, [install ERPNext](https://github.com/frappe/bench#installation) as mentioned here. 9 | 10 | Once ERPNext is installed, add agriculture app to your bench by running 11 | ```sh 12 | $ bench get-app agriculture 13 | ``` 14 | 15 | After that, you can install agriculture app on required site by running 16 | 17 | ```sh 18 | $ bench --site demo.com install-app agriculture 19 | ``` 20 | 21 | 22 | ### License 23 | 24 | GNU GPL V3. See [license.txt](https://github.com/frappe/agriculture/blob/develop/license.txt) for more information. 25 | -------------------------------------------------------------------------------- /agriculture/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | __version__ = '0.0.1' 3 | 4 | -------------------------------------------------------------------------------- /agriculture/agriculture/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_analysis_criteria/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/agriculture_analysis_criteria/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Agriculture Analysis Criteria', { 5 | refresh: function(frm) { 6 | 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "field:title", 8 | "beta": 0, 9 | "creation": "2017-12-05 16:37:46.599982", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "title", 25 | "fieldtype": "Data", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 0, 32 | "in_standard_filter": 0, 33 | "label": "Title", 34 | "length": 0, 35 | "no_copy": 0, 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 0, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 1 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "standard", 57 | "fieldtype": "Check", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 0, 64 | "in_standard_filter": 0, 65 | "label": "Standard", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "linked_doctype", 89 | "fieldtype": "Select", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 0, 96 | "in_standard_filter": 0, 97 | "label": "Linked Doctype", 98 | "length": 0, 99 | "no_copy": 0, 100 | "options": "\nWater Analysis\nSoil Analysis\nPlant Analysis\nFertilizer\nSoil Texture\nWeather", 101 | "permlevel": 0, 102 | "precision": "", 103 | "print_hide": 0, 104 | "print_hide_if_no_value": 0, 105 | "read_only": 0, 106 | "remember_last_selected_value": 0, 107 | "report_hide": 0, 108 | "reqd": 0, 109 | "search_index": 0, 110 | "set_only_once": 0, 111 | "translatable": 0, 112 | "unique": 0 113 | } 114 | ], 115 | "has_web_view": 0, 116 | "hide_heading": 0, 117 | "hide_toolbar": 0, 118 | "idx": 0, 119 | "image_view": 0, 120 | "in_create": 0, 121 | "is_submittable": 0, 122 | "issingle": 0, 123 | "istable": 0, 124 | "max_attachments": 0, 125 | "modified": "2018-11-04 03:27:36.678832", 126 | "modified_by": "Administrator", 127 | "module": "Agriculture", 128 | "name": "Agriculture Analysis Criteria", 129 | "name_case": "", 130 | "owner": "Administrator", 131 | "permissions": [ 132 | { 133 | "amend": 0, 134 | "cancel": 0, 135 | "create": 1, 136 | "delete": 1, 137 | "email": 1, 138 | "export": 1, 139 | "if_owner": 0, 140 | "import": 0, 141 | "permlevel": 0, 142 | "print": 1, 143 | "read": 1, 144 | "report": 1, 145 | "role": "Agriculture Manager", 146 | "set_user_permissions": 0, 147 | "share": 1, 148 | "submit": 0, 149 | "write": 1 150 | }, 151 | { 152 | "amend": 0, 153 | "cancel": 0, 154 | "create": 0, 155 | "delete": 0, 156 | "email": 1, 157 | "export": 1, 158 | "if_owner": 0, 159 | "import": 0, 160 | "permlevel": 0, 161 | "print": 1, 162 | "read": 1, 163 | "report": 1, 164 | "role": "Agriculture User", 165 | "set_user_permissions": 0, 166 | "share": 1, 167 | "submit": 0, 168 | "write": 1 169 | } 170 | ], 171 | "quick_entry": 1, 172 | "read_only": 0, 173 | "read_only_onload": 0, 174 | "restrict_to_domain": "Agriculture", 175 | "show_name_in_global_search": 0, 176 | "sort_field": "modified", 177 | "sort_order": "DESC", 178 | "title_field": "", 179 | "track_changes": 1, 180 | "track_seen": 0, 181 | "track_views": 0 182 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class AgricultureAnalysisCriteria(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_analysis_criteria/test_agriculture_analysis_criteria.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | 7 | class TestAgricultureAnalysisCriteria(unittest.TestCase): 8 | pass 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_task/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/agriculture_task/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_task/agriculture_task.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Agriculture Task', { 5 | refresh: function(frm) { 6 | 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_task/agriculture_task.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "AG-TASK-.#####", 8 | "beta": 0, 9 | "creation": "2017-10-26 15:51:19.602452", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "task_name", 25 | "fieldtype": "Data", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 1, 32 | "in_standard_filter": 0, 33 | "label": "Task Name", 34 | "length": 0, 35 | "no_copy": 0, 36 | "options": "", 37 | "permlevel": 0, 38 | "precision": "", 39 | "print_hide": 0, 40 | "print_hide_if_no_value": 0, 41 | "read_only": 0, 42 | "remember_last_selected_value": 0, 43 | "report_hide": 0, 44 | "reqd": 1, 45 | "search_index": 0, 46 | "set_only_once": 0, 47 | "translatable": 0, 48 | "unique": 0 49 | }, 50 | { 51 | "allow_bulk_edit": 0, 52 | "allow_in_quick_entry": 0, 53 | "allow_on_submit": 0, 54 | "bold": 0, 55 | "collapsible": 0, 56 | "columns": 0, 57 | "default": "", 58 | "fieldname": "start_day", 59 | "fieldtype": "Int", 60 | "hidden": 0, 61 | "ignore_user_permissions": 0, 62 | "ignore_xss_filter": 0, 63 | "in_filter": 0, 64 | "in_global_search": 0, 65 | "in_list_view": 1, 66 | "in_standard_filter": 0, 67 | "label": "Start Day", 68 | "length": 0, 69 | "no_copy": 0, 70 | "permlevel": 0, 71 | "precision": "", 72 | "print_hide": 0, 73 | "print_hide_if_no_value": 0, 74 | "read_only": 0, 75 | "remember_last_selected_value": 0, 76 | "report_hide": 0, 77 | "reqd": 1, 78 | "search_index": 0, 79 | "set_only_once": 0, 80 | "translatable": 0, 81 | "unique": 0 82 | }, 83 | { 84 | "allow_bulk_edit": 0, 85 | "allow_in_quick_entry": 0, 86 | "allow_on_submit": 0, 87 | "bold": 0, 88 | "collapsible": 0, 89 | "columns": 0, 90 | "default": "", 91 | "fieldname": "end_day", 92 | "fieldtype": "Int", 93 | "hidden": 0, 94 | "ignore_user_permissions": 0, 95 | "ignore_xss_filter": 0, 96 | "in_filter": 0, 97 | "in_global_search": 0, 98 | "in_list_view": 1, 99 | "in_standard_filter": 0, 100 | "label": "End Day", 101 | "length": 0, 102 | "no_copy": 0, 103 | "permlevel": 0, 104 | "precision": "", 105 | "print_hide": 0, 106 | "print_hide_if_no_value": 0, 107 | "read_only": 0, 108 | "remember_last_selected_value": 0, 109 | "report_hide": 0, 110 | "reqd": 1, 111 | "search_index": 0, 112 | "set_only_once": 0, 113 | "translatable": 0, 114 | "unique": 0 115 | }, 116 | { 117 | "allow_bulk_edit": 0, 118 | "allow_in_quick_entry": 0, 119 | "allow_on_submit": 0, 120 | "bold": 0, 121 | "collapsible": 0, 122 | "columns": 0, 123 | "default": "Ignore holidays", 124 | "fieldname": "holiday_management", 125 | "fieldtype": "Select", 126 | "hidden": 0, 127 | "ignore_user_permissions": 0, 128 | "ignore_xss_filter": 0, 129 | "in_filter": 0, 130 | "in_global_search": 0, 131 | "in_list_view": 1, 132 | "in_standard_filter": 0, 133 | "label": "Holiday Management", 134 | "length": 0, 135 | "no_copy": 0, 136 | "options": "Ignore holidays\nPrevious Business Day\nNext Business Day", 137 | "permlevel": 0, 138 | "precision": "", 139 | "print_hide": 0, 140 | "print_hide_if_no_value": 0, 141 | "read_only": 0, 142 | "remember_last_selected_value": 0, 143 | "report_hide": 0, 144 | "reqd": 1, 145 | "search_index": 0, 146 | "set_only_once": 0, 147 | "translatable": 0, 148 | "unique": 0 149 | }, 150 | { 151 | "allow_bulk_edit": 0, 152 | "allow_in_quick_entry": 0, 153 | "allow_on_submit": 0, 154 | "bold": 0, 155 | "collapsible": 0, 156 | "columns": 0, 157 | "default": "Low", 158 | "fieldname": "priority", 159 | "fieldtype": "Select", 160 | "hidden": 0, 161 | "ignore_user_permissions": 0, 162 | "ignore_xss_filter": 0, 163 | "in_filter": 0, 164 | "in_global_search": 0, 165 | "in_list_view": 0, 166 | "in_standard_filter": 0, 167 | "label": "Priority", 168 | "length": 0, 169 | "no_copy": 0, 170 | "options": "Low\nMedium\nHigh\nUrgent", 171 | "permlevel": 0, 172 | "precision": "", 173 | "print_hide": 0, 174 | "print_hide_if_no_value": 0, 175 | "read_only": 0, 176 | "remember_last_selected_value": 0, 177 | "report_hide": 0, 178 | "reqd": 0, 179 | "search_index": 0, 180 | "set_only_once": 0, 181 | "translatable": 0, 182 | "unique": 0 183 | } 184 | ], 185 | "has_web_view": 0, 186 | "hide_heading": 0, 187 | "hide_toolbar": 0, 188 | "idx": 0, 189 | "image_view": 0, 190 | "in_create": 0, 191 | "is_submittable": 0, 192 | "issingle": 0, 193 | "istable": 1, 194 | "max_attachments": 0, 195 | "modified": "2018-11-04 03:28:08.679157", 196 | "modified_by": "Administrator", 197 | "module": "Agriculture", 198 | "name": "Agriculture Task", 199 | "name_case": "", 200 | "owner": "Administrator", 201 | "permissions": [], 202 | "quick_entry": 0, 203 | "read_only": 0, 204 | "read_only_onload": 0, 205 | "restrict_to_domain": "Agriculture", 206 | "show_name_in_global_search": 0, 207 | "sort_field": "modified", 208 | "sort_order": "DESC", 209 | "track_changes": 1, 210 | "track_seen": 0, 211 | "track_views": 0 212 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_task/agriculture_task.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class AgricultureTask(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/agriculture_task/test_agriculture_task.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | 7 | class TestAgricultureTask(unittest.TestCase): 8 | pass 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/crop/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop/crop.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.provide("erpnext.crop"); 5 | 6 | frappe.ui.form.on('Crop', { 7 | refresh: (frm) => { 8 | frm.fields_dict.materials_required.grid.set_column_disp('bom_no', false); 9 | } 10 | }); 11 | 12 | frappe.ui.form.on("BOM Item", { 13 | item_code: (frm, cdt, cdn) => { 14 | erpnext.crop.update_item_rate_uom(frm, cdt, cdn); 15 | }, 16 | qty: (frm, cdt, cdn) => { 17 | erpnext.crop.update_item_qty_amount(frm, cdt, cdn); 18 | }, 19 | rate: (frm, cdt, cdn) => { 20 | erpnext.crop.update_item_qty_amount(frm, cdt, cdn); 21 | } 22 | }); 23 | 24 | erpnext.crop.update_item_rate_uom = function(frm, cdt, cdn) { 25 | let material_list = ['materials_required', 'produce', 'byproducts']; 26 | material_list.forEach((material) => { 27 | frm.doc[material].forEach((item, index) => { 28 | if (item.name == cdn && item.item_code){ 29 | frappe.call({ 30 | method:'erpnext.agriculture.doctype.crop.crop.get_item_details', 31 | args: { 32 | item_code: item.item_code 33 | }, 34 | callback: (r) => { 35 | frappe.model.set_value('BOM Item', item.name, 'uom', r.message.uom); 36 | frappe.model.set_value('BOM Item', item.name, 'rate', r.message.rate); 37 | } 38 | }); 39 | } 40 | }); 41 | }); 42 | }; 43 | 44 | erpnext.crop.update_item_qty_amount = function(frm, cdt, cdn) { 45 | let material_list = ['materials_required', 'produce', 'byproducts']; 46 | material_list.forEach((material) => { 47 | frm.doc[material].forEach((item, index) => { 48 | if (item.name == cdn){ 49 | if (!frappe.model.get_value('BOM Item', item.name, 'qty')) 50 | frappe.model.set_value('BOM Item', item.name, 'qty', 1); 51 | frappe.model.set_value('BOM Item', item.name, 'amount', item.qty * item.rate); 52 | } 53 | }); 54 | }); 55 | }; 56 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop/crop.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe import _ 7 | from frappe.model.document import Document 8 | 9 | 10 | class Crop(Document): 11 | def validate(self): 12 | self.validate_crop_tasks() 13 | 14 | def validate_crop_tasks(self): 15 | for task in self.agriculture_task: 16 | if task.start_day > task.end_day: 17 | frappe.throw(_("Start day is greater than end day in task '{0}'").format(task.task_name)) 18 | 19 | # Verify that the crop period is correct 20 | max_crop_period = max([task.end_day for task in self.agriculture_task]) 21 | self.period = max(self.period, max_crop_period) 22 | 23 | # Sort the crop tasks based on start days, 24 | # maintaining the order for same-day tasks 25 | self.agriculture_task.sort(key=lambda task: task.start_day) 26 | 27 | 28 | @frappe.whitelist() 29 | def get_item_details(item_code): 30 | item = frappe.get_doc('Item', item_code) 31 | return {"uom": item.stock_uom, "rate": item.valuation_rate} 32 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop/crop_dashboard.py: -------------------------------------------------------------------------------- 1 | from frappe import _ 2 | 3 | 4 | def get_data(): 5 | return { 6 | 'transactions': [ 7 | { 8 | 'label': _('Crop Cycle'), 9 | 'items': ['Crop Cycle'] 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop/test_crop.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // rename this file from _test_[name] to test_[name] to activate 3 | // and remove above this line 4 | 5 | QUnit.test("test: Crop", function (assert) { 6 | let done = assert.async(); 7 | 8 | // number of asserts 9 | assert.expect(2); 10 | 11 | frappe.run_serially([ 12 | // insert a new Item 13 | () => frappe.tests.make('Item', [ 14 | // values to be set 15 | {item_code: 'Basil Seeds'}, 16 | {item_name: 'Basil Seeds'}, 17 | {item_group: 'Seed'} 18 | ]), 19 | // insert a new Item 20 | () => frappe.tests.make('Item', [ 21 | // values to be set 22 | {item_code: 'Twigs'}, 23 | {item_name: 'Twigs'}, 24 | {item_group: 'By-product'} 25 | ]), 26 | // insert a new Item 27 | () => frappe.tests.make('Item', [ 28 | // values to be set 29 | {item_code: 'Basil Leaves'}, 30 | {item_name: 'Basil Leaves'}, 31 | {item_group: 'Produce'} 32 | ]), 33 | // insert a new Crop 34 | () => frappe.tests.make('Crop', [ 35 | // values to be set 36 | {title: 'Basil from seed'}, 37 | {crop_name: 'Basil'}, 38 | {scientific_name: 'Ocimum basilicum'}, 39 | {materials_required: [ 40 | [ 41 | {item_code: 'Basil Seeds'}, 42 | {qty: '25'}, 43 | {uom: 'Nos'}, 44 | {rate: '1'} 45 | ], 46 | [ 47 | {item_code: 'Urea'}, 48 | {qty: '5'}, 49 | {uom: 'Kg'}, 50 | {rate: '10'} 51 | ] 52 | ]}, 53 | {byproducts: [ 54 | [ 55 | {item_code: 'Twigs'}, 56 | {qty: '25'}, 57 | {uom: 'Nos'}, 58 | {rate: '1'} 59 | ] 60 | ]}, 61 | {produce: [ 62 | [ 63 | {item_code: 'Basil Leaves'}, 64 | {qty: '100'}, 65 | {uom: 'Nos'}, 66 | {rate: '1'} 67 | ] 68 | ]}, 69 | {agriculture_task: [ 70 | [ 71 | {task_name: "Plough the field"}, 72 | {start_day: 1}, 73 | {end_day: 1}, 74 | {holiday_management: "Ignore holidays"} 75 | ], 76 | [ 77 | {task_name: "Plant the seeds"}, 78 | {start_day: 2}, 79 | {end_day: 3}, 80 | {holiday_management: "Ignore holidays"} 81 | ], 82 | [ 83 | {task_name: "Water the field"}, 84 | {start_day: 4}, 85 | {end_day: 4}, 86 | {holiday_management: "Ignore holidays"} 87 | ], 88 | [ 89 | {task_name: "First harvest"}, 90 | {start_day: 8}, 91 | {end_day: 8}, 92 | {holiday_management: "Ignore holidays"} 93 | ], 94 | [ 95 | {task_name: "Add the fertilizer"}, 96 | {start_day: 10}, 97 | {end_day: 12}, 98 | {holiday_management: "Ignore holidays"} 99 | ], 100 | [ 101 | {task_name: "Final cut"}, 102 | {start_day: 15}, 103 | {end_day: 15}, 104 | {holiday_management: "Ignore holidays"} 105 | ] 106 | ]} 107 | ]), 108 | // agriculture task list 109 | () => { 110 | assert.equal(cur_frm.doc.name, 'Basil from seed'); 111 | assert.equal(cur_frm.doc.period, 15); 112 | }, 113 | () => done() 114 | ]); 115 | 116 | }); 117 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop/test_crop.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | import frappe 7 | 8 | test_dependencies = ["Fertilizer"] 9 | 10 | class TestCrop(unittest.TestCase): 11 | def test_crop_period(self): 12 | basil = frappe.get_doc('Crop', 'Basil from seed') 13 | self.assertEqual(basil.period, 15) 14 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop/test_records.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "doctype": "Item", 4 | "item_code": "Basil Seeds", 5 | "item_name": "Basil Seeds", 6 | "item_group": "Seed" 7 | }, 8 | { 9 | "doctype": "Item", 10 | "item_code": "Twigs", 11 | "item_name": "Twigs", 12 | "item_group": "By-product" 13 | }, 14 | { 15 | "doctype": "Item", 16 | "item_code": "Basil Leaves", 17 | "item_name": "Basil Leaves", 18 | "item_group": "Produce" 19 | }, 20 | { 21 | "doctype": "Crop", 22 | "title": "Basil from seed", 23 | "crop_name": "Basil", 24 | "scientific_name": "Ocimum basilicum", 25 | "materials_required": [{ 26 | "item_code": "Basil Seeds", 27 | "qty": "25", 28 | "uom": "Nos", 29 | "rate": "1" 30 | }, { 31 | "item_code": "Urea", 32 | "qty": "5", 33 | "uom": "Kg", 34 | "rate": "10" 35 | }], 36 | "byproducts": [{ 37 | "item_code": "Twigs", 38 | "qty": "25", 39 | "uom": "Nos", 40 | "rate": "1" 41 | }], 42 | "produce": [{ 43 | "item_code": "Basil Leaves", 44 | "qty": "100", 45 | "uom": "Nos", 46 | "rate": "1" 47 | }], 48 | "agriculture_task": [{ 49 | "task_name": "Plough the field", 50 | "start_day": 1, 51 | "end_day": 1, 52 | "holiday_management": "Ignore holidays" 53 | }, { 54 | "task_name": "Plant the seeds", 55 | "start_day": 2, 56 | "end_day": 3, 57 | "holiday_management": "Ignore holidays" 58 | }, { 59 | "task_name": "Water the field", 60 | "start_day": 4, 61 | "end_day": 4, 62 | "holiday_management": "Ignore holidays" 63 | }, { 64 | "task_name": "First harvest", 65 | "start_day": 8, 66 | "end_day": 8, 67 | "holiday_management": "Ignore holidays" 68 | }, { 69 | "task_name": "Add the fertilizer", 70 | "start_day": 10, 71 | "end_day": 12, 72 | "holiday_management": "Ignore holidays" 73 | }, { 74 | "task_name": "Final cut", 75 | "start_day": 15, 76 | "end_day": 15, 77 | "holiday_management": "Ignore holidays" 78 | }] 79 | } 80 | ] -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop_cycle/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/crop_cycle/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop_cycle/crop_cycle.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Crop Cycle', { 5 | refresh: (frm) => { 6 | if (!frm.doc.__islocal) 7 | frm.add_custom_button(__('Reload Linked Analysis'), () => frm.call("reload_linked_analysis")); 8 | 9 | frappe.realtime.on("List of Linked Docs", (output) => { 10 | let analysis_doctypes = ['Soil Texture', 'Plant Analysis', 'Soil Analysis']; 11 | let analysis_doctypes_docs = ['soil_texture', 'plant_analysis', 'soil_analysis']; 12 | let obj_to_append = {soil_analysis: [], soil_texture: [], plant_analysis: []}; 13 | output['Location'].forEach( (land_doc) => { 14 | analysis_doctypes.forEach( (doctype) => { 15 | output[doctype].forEach( (analysis_doc) => { 16 | let point_to_be_tested = JSON.parse(analysis_doc.location).features[0].geometry.coordinates; 17 | let poly_of_land = JSON.parse(land_doc.location).features[0].geometry.coordinates[0]; 18 | if (is_in_land_unit(point_to_be_tested, poly_of_land)){ 19 | obj_to_append[analysis_doctypes_docs[analysis_doctypes.indexOf(doctype)]].push(analysis_doc.name); 20 | } 21 | }); 22 | }); 23 | }); 24 | frm.call('append_to_child', { 25 | obj_to_append: obj_to_append 26 | }); 27 | }); 28 | } 29 | }); 30 | 31 | function is_in_land_unit(point, vs) { 32 | // ray-casting algorithm based on 33 | // http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html 34 | 35 | var x = point[0], y = point[1]; 36 | 37 | var inside = false; 38 | for (var i = 0, j = vs.length - 1; i < vs.length; j = i++) { 39 | var xi = vs[i][0], yi = vs[i][1]; 40 | var xj = vs[j][0], yj = vs[j][1]; 41 | 42 | var intersect = ((yi > y) != (yj > y)) 43 | && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); 44 | if (intersect) inside = !inside; 45 | } 46 | 47 | return inside; 48 | }; 49 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop_cycle/crop_cycle.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import ast 6 | 7 | import frappe 8 | from frappe import _ 9 | from frappe.model.document import Document 10 | from frappe.utils import add_days 11 | 12 | 13 | class CropCycle(Document): 14 | def validate(self): 15 | self.set_missing_values() 16 | 17 | def after_insert(self): 18 | self.create_crop_cycle_project() 19 | self.create_tasks_for_diseases() 20 | 21 | def on_update(self): 22 | self.create_tasks_for_diseases() 23 | 24 | def set_missing_values(self): 25 | crop = frappe.get_doc('Crop', self.crop) 26 | 27 | if not self.crop_spacing_uom: 28 | self.crop_spacing_uom = crop.crop_spacing_uom 29 | 30 | if not self.row_spacing_uom: 31 | self.row_spacing_uom = crop.row_spacing_uom 32 | 33 | def create_crop_cycle_project(self): 34 | crop = frappe.get_doc('Crop', self.crop) 35 | 36 | self.project = self.create_project(crop.period, crop.agriculture_task) 37 | self.create_task(crop.agriculture_task, self.project, self.start_date) 38 | 39 | def create_tasks_for_diseases(self): 40 | for disease in self.detected_disease: 41 | if not disease.tasks_created: 42 | self.import_disease_tasks(disease.disease, disease.start_date) 43 | disease.tasks_created = True 44 | 45 | frappe.msgprint(_("Tasks have been created for managing the {0} disease (on row {1})").format(disease.disease, disease.idx)) 46 | 47 | def import_disease_tasks(self, disease, start_date): 48 | disease_doc = frappe.get_doc('Disease', disease) 49 | self.create_task(disease_doc.treatment_task, self.project, start_date) 50 | 51 | def create_project(self, period, crop_tasks): 52 | project = frappe.get_doc({ 53 | "doctype": "Project", 54 | "project_name": self.title, 55 | "expected_start_date": self.start_date, 56 | "expected_end_date": add_days(self.start_date, period - 1) 57 | }).insert() 58 | 59 | return project.name 60 | 61 | def create_task(self, crop_tasks, project_name, start_date): 62 | for crop_task in crop_tasks: 63 | frappe.get_doc({ 64 | "doctype": "Task", 65 | "subject": crop_task.get("task_name"), 66 | "priority": crop_task.get("priority"), 67 | "project": project_name, 68 | "exp_start_date": add_days(start_date, crop_task.get("start_day") - 1), 69 | "exp_end_date": add_days(start_date, crop_task.get("end_day") - 1) 70 | }).insert() 71 | 72 | @frappe.whitelist() 73 | def reload_linked_analysis(self): 74 | linked_doctypes = ['Soil Texture', 'Soil Analysis', 'Plant Analysis'] 75 | required_fields = ['location', 'name', 'collection_datetime'] 76 | output = {} 77 | 78 | for doctype in linked_doctypes: 79 | output[doctype] = frappe.get_all(doctype, fields=required_fields) 80 | 81 | output['Location'] = [] 82 | 83 | for location in self.linked_location: 84 | output['Location'].append(frappe.get_doc('Location', location.location)) 85 | 86 | frappe.publish_realtime("List of Linked Docs", 87 | output, user=frappe.session.user) 88 | 89 | @frappe.whitelist() 90 | def append_to_child(self, obj_to_append): 91 | for doctype in obj_to_append: 92 | for doc_name in set(obj_to_append[doctype]): 93 | self.append(doctype, {doctype: doc_name}) 94 | 95 | self.save() 96 | 97 | 98 | def get_coordinates(doc): 99 | return ast.literal_eval(doc.location).get('features')[0].get('geometry').get('coordinates') 100 | 101 | 102 | def get_geometry_type(doc): 103 | return ast.literal_eval(doc.location).get('features')[0].get('geometry').get('type') 104 | 105 | 106 | def is_in_location(point, vs): 107 | x, y = point 108 | inside = False 109 | 110 | j = len(vs) - 1 111 | i = 0 112 | 113 | while i < len(vs): 114 | xi, yi = vs[i] 115 | xj, yj = vs[j] 116 | 117 | intersect = ((yi > y) != (yj > y)) and ( 118 | x < (xj - xi) * (y - yi) / (yj - yi) + xi) 119 | 120 | if intersect: 121 | inside = not inside 122 | 123 | i = j 124 | j += 1 125 | 126 | return inside 127 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop_cycle/test_crop_cycle.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // rename this file from _test_[name] to test_[name] to activate 3 | // and remove above this line 4 | 5 | QUnit.test("test: Crop Cycle", function (assert) { 6 | let done = assert.async(); 7 | 8 | // number of asserts 9 | assert.expect(1); 10 | 11 | frappe.run_serially([ 12 | // insert a new Crop Cycle 13 | () => frappe.tests.make('Crop Cycle', [ 14 | // values to be set 15 | {title: 'Basil from seed 2017'}, 16 | {detected_disease: [ 17 | [ 18 | {start_date: '2017-11-21'}, 19 | {disease: 'Aphids'} 20 | ] 21 | ]}, 22 | {linked_land_unit: [ 23 | [ 24 | {land_unit: 'Basil Farm'} 25 | ] 26 | ]}, 27 | {crop: 'Basil from seed'}, 28 | {start_date: '2017-11-11'}, 29 | {cycle_type: 'Less than a year'} 30 | ]), 31 | () => assert.equal(cur_frm.doc.name, 'Basil from seed 2017'), 32 | () => done() 33 | ]); 34 | }); 35 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop_cycle/test_crop_cycle.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | import frappe 7 | from frappe.utils import datetime 8 | 9 | test_dependencies = ["Crop", "Fertilizer", "Location", "Disease"] 10 | 11 | 12 | class TestCropCycle(unittest.TestCase): 13 | def test_crop_cycle_creation(self): 14 | cycle = frappe.get_doc('Crop Cycle', 'Basil from seed 2017') 15 | self.assertTrue(frappe.db.exists('Crop Cycle', 'Basil from seed 2017')) 16 | 17 | # check if the tasks were created 18 | self.assertEqual(check_task_creation(), True) 19 | self.assertEqual(check_project_creation(), True) 20 | 21 | 22 | def check_task_creation(): 23 | all_task_dict = { 24 | "Survey and find the aphid locations": { 25 | "exp_start_date": datetime.date(2017, 11, 21), 26 | "exp_end_date": datetime.date(2017, 11, 22) 27 | }, 28 | "Apply Pesticides": { 29 | "exp_start_date": datetime.date(2017, 11, 23), 30 | "exp_end_date": datetime.date(2017, 11, 23) 31 | }, 32 | "Plough the field": { 33 | "exp_start_date": datetime.date(2017, 11, 11), 34 | "exp_end_date": datetime.date(2017, 11, 11) 35 | }, 36 | "Plant the seeds": { 37 | "exp_start_date": datetime.date(2017, 11, 12), 38 | "exp_end_date": datetime.date(2017, 11, 13) 39 | }, 40 | "Water the field": { 41 | "exp_start_date": datetime.date(2017, 11, 14), 42 | "exp_end_date": datetime.date(2017, 11, 14) 43 | }, 44 | "First harvest": { 45 | "exp_start_date": datetime.date(2017, 11, 18), 46 | "exp_end_date": datetime.date(2017, 11, 18) 47 | }, 48 | "Add the fertilizer": { 49 | "exp_start_date": datetime.date(2017, 11, 20), 50 | "exp_end_date": datetime.date(2017, 11, 22) 51 | }, 52 | "Final cut": { 53 | "exp_start_date": datetime.date(2017, 11, 25), 54 | "exp_end_date": datetime.date(2017, 11, 25) 55 | } 56 | } 57 | 58 | all_tasks = frappe.get_all('Task') 59 | 60 | for task in all_tasks: 61 | sample_task = frappe.get_doc('Task', task.name) 62 | 63 | if sample_task.subject in list(all_task_dict): 64 | if sample_task.exp_start_date != all_task_dict[sample_task.subject]['exp_start_date'] or sample_task.exp_end_date != all_task_dict[sample_task.subject]['exp_end_date']: 65 | return False 66 | all_task_dict.pop(sample_task.subject) 67 | 68 | return True if not all_task_dict else False 69 | 70 | 71 | def check_project_creation(): 72 | return True if frappe.db.exists('Project', {'project_name': 'Basil from seed 2017'}) else False 73 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/crop_cycle/test_records.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "doctype": "Crop Cycle", 4 | "title": "Basil from seed 2017", 5 | "linked_location": [{ 6 | "location": "Basil Farm" 7 | }], 8 | "crop": "Basil from seed", 9 | "start_date": "2017-11-11", 10 | "detected_disease": [{ 11 | "disease": "Aphids", 12 | "start_date": "2017-11-21" 13 | }] 14 | } 15 | ] -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/detected_disease/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/detected_disease/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/detected_disease/detected_disease.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-11-20 17:31:30.772779", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "disease", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Disease", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Disease", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "start_date", 57 | "fieldtype": "Date", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 1, 64 | "in_standard_filter": 0, 65 | "label": "Start Date", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 1, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "tasks_created", 89 | "fieldtype": "Check", 90 | "hidden": 1, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 0, 96 | "in_standard_filter": 0, 97 | "label": "Tasks Created", 98 | "length": 0, 99 | "no_copy": 1, 100 | "options": "", 101 | "permlevel": 0, 102 | "precision": "", 103 | "print_hide": 0, 104 | "print_hide_if_no_value": 0, 105 | "read_only": 1, 106 | "remember_last_selected_value": 0, 107 | "report_hide": 0, 108 | "reqd": 0, 109 | "search_index": 0, 110 | "set_only_once": 0, 111 | "translatable": 0, 112 | "unique": 0 113 | } 114 | ], 115 | "has_web_view": 0, 116 | "hide_heading": 0, 117 | "hide_toolbar": 0, 118 | "idx": 0, 119 | "image_view": 0, 120 | "in_create": 0, 121 | "is_submittable": 0, 122 | "issingle": 0, 123 | "istable": 1, 124 | "max_attachments": 0, 125 | "modified": "2018-11-04 03:27:47.463994", 126 | "modified_by": "Administrator", 127 | "module": "Agriculture", 128 | "name": "Detected Disease", 129 | "name_case": "", 130 | "owner": "Administrator", 131 | "permissions": [], 132 | "quick_entry": 1, 133 | "read_only": 0, 134 | "read_only_onload": 0, 135 | "restrict_to_domain": "Agriculture", 136 | "show_name_in_global_search": 0, 137 | "sort_field": "modified", 138 | "sort_order": "DESC", 139 | "track_changes": 1, 140 | "track_seen": 0, 141 | "track_views": 0 142 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/detected_disease/detected_disease.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class DetectedDisease(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/disease/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/disease/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/disease/disease.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Disease', { 5 | refresh: function(frm) { 6 | 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/disease/disease.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "field:common_name", 8 | "beta": 0, 9 | "creation": "2017-11-20 17:16:54.496355", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "common_name", 25 | "fieldtype": "Data", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 1, 32 | "in_standard_filter": 0, 33 | "label": "Common Name", 34 | "length": 0, 35 | "no_copy": 0, 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 1 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "scientific_name", 57 | "fieldtype": "Data", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 0, 64 | "in_standard_filter": 0, 65 | "label": "Scientific Name", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "section_break_3", 89 | "fieldtype": "Section Break", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 0, 96 | "in_standard_filter": 0, 97 | "length": 0, 98 | "no_copy": 0, 99 | "permlevel": 0, 100 | "precision": "", 101 | "print_hide": 0, 102 | "print_hide_if_no_value": 0, 103 | "read_only": 0, 104 | "remember_last_selected_value": 0, 105 | "report_hide": 0, 106 | "reqd": 0, 107 | "search_index": 0, 108 | "set_only_once": 0, 109 | "translatable": 0, 110 | "unique": 0 111 | }, 112 | { 113 | "allow_bulk_edit": 0, 114 | "allow_in_quick_entry": 0, 115 | "allow_on_submit": 0, 116 | "bold": 0, 117 | "collapsible": 0, 118 | "columns": 0, 119 | "fieldname": "treatment_task", 120 | "fieldtype": "Table", 121 | "hidden": 0, 122 | "ignore_user_permissions": 0, 123 | "ignore_xss_filter": 0, 124 | "in_filter": 0, 125 | "in_global_search": 0, 126 | "in_list_view": 0, 127 | "in_standard_filter": 0, 128 | "label": "Treatment Task", 129 | "length": 0, 130 | "no_copy": 0, 131 | "options": "Agriculture Task", 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | }, 145 | { 146 | "allow_bulk_edit": 0, 147 | "allow_in_quick_entry": 0, 148 | "allow_on_submit": 0, 149 | "bold": 0, 150 | "collapsible": 0, 151 | "columns": 0, 152 | "fieldname": "treatment_period", 153 | "fieldtype": "Int", 154 | "hidden": 0, 155 | "ignore_user_permissions": 0, 156 | "ignore_xss_filter": 0, 157 | "in_filter": 0, 158 | "in_global_search": 0, 159 | "in_list_view": 0, 160 | "in_standard_filter": 0, 161 | "label": "Treatment Period", 162 | "length": 0, 163 | "no_copy": 0, 164 | "permlevel": 0, 165 | "precision": "", 166 | "print_hide": 0, 167 | "print_hide_if_no_value": 0, 168 | "read_only": 0, 169 | "remember_last_selected_value": 0, 170 | "report_hide": 0, 171 | "reqd": 0, 172 | "search_index": 0, 173 | "set_only_once": 0, 174 | "translatable": 0, 175 | "unique": 0 176 | }, 177 | { 178 | "allow_bulk_edit": 0, 179 | "allow_in_quick_entry": 0, 180 | "allow_on_submit": 0, 181 | "bold": 0, 182 | "collapsible": 0, 183 | "columns": 0, 184 | "fieldname": "section_break_2", 185 | "fieldtype": "Section Break", 186 | "hidden": 0, 187 | "ignore_user_permissions": 0, 188 | "ignore_xss_filter": 0, 189 | "in_filter": 0, 190 | "in_global_search": 0, 191 | "in_list_view": 0, 192 | "in_standard_filter": 0, 193 | "label": "Treatment Task", 194 | "length": 0, 195 | "no_copy": 0, 196 | "permlevel": 0, 197 | "precision": "", 198 | "print_hide": 0, 199 | "print_hide_if_no_value": 0, 200 | "read_only": 0, 201 | "remember_last_selected_value": 0, 202 | "report_hide": 0, 203 | "reqd": 0, 204 | "search_index": 0, 205 | "set_only_once": 0, 206 | "translatable": 0, 207 | "unique": 0 208 | }, 209 | { 210 | "allow_bulk_edit": 0, 211 | "allow_in_quick_entry": 0, 212 | "allow_on_submit": 0, 213 | "bold": 0, 214 | "collapsible": 0, 215 | "columns": 0, 216 | "fieldname": "description", 217 | "fieldtype": "Long Text", 218 | "hidden": 0, 219 | "ignore_user_permissions": 0, 220 | "ignore_xss_filter": 0, 221 | "in_filter": 0, 222 | "in_global_search": 0, 223 | "in_list_view": 0, 224 | "in_standard_filter": 0, 225 | "label": "Description", 226 | "length": 0, 227 | "no_copy": 0, 228 | "permlevel": 0, 229 | "precision": "", 230 | "print_hide": 0, 231 | "print_hide_if_no_value": 0, 232 | "read_only": 0, 233 | "remember_last_selected_value": 0, 234 | "report_hide": 0, 235 | "reqd": 0, 236 | "search_index": 0, 237 | "set_only_once": 0, 238 | "translatable": 0, 239 | "unique": 0 240 | } 241 | ], 242 | "has_web_view": 0, 243 | "hide_heading": 0, 244 | "hide_toolbar": 0, 245 | "idx": 0, 246 | "image_view": 0, 247 | "in_create": 0, 248 | "is_submittable": 0, 249 | "issingle": 0, 250 | "istable": 0, 251 | "max_attachments": 0, 252 | "modified": "2018-11-04 03:27:25.076490", 253 | "modified_by": "Administrator", 254 | "module": "Agriculture", 255 | "name": "Disease", 256 | "name_case": "", 257 | "owner": "Administrator", 258 | "permissions": [ 259 | { 260 | "amend": 0, 261 | "cancel": 0, 262 | "create": 1, 263 | "delete": 1, 264 | "email": 1, 265 | "export": 1, 266 | "if_owner": 0, 267 | "import": 0, 268 | "permlevel": 0, 269 | "print": 1, 270 | "read": 1, 271 | "report": 1, 272 | "role": "Agriculture Manager", 273 | "set_user_permissions": 0, 274 | "share": 1, 275 | "submit": 0, 276 | "write": 1 277 | }, 278 | { 279 | "amend": 0, 280 | "cancel": 0, 281 | "create": 0, 282 | "delete": 0, 283 | "email": 1, 284 | "export": 1, 285 | "if_owner": 0, 286 | "import": 0, 287 | "permlevel": 0, 288 | "print": 1, 289 | "read": 1, 290 | "report": 1, 291 | "role": "Agriculture User", 292 | "set_user_permissions": 0, 293 | "share": 1, 294 | "submit": 0, 295 | "write": 1 296 | } 297 | ], 298 | "quick_entry": 0, 299 | "read_only": 0, 300 | "read_only_onload": 0, 301 | "restrict_to_domain": "Agriculture", 302 | "show_name_in_global_search": 0, 303 | "sort_field": "modified", 304 | "sort_order": "DESC", 305 | "track_changes": 1, 306 | "track_seen": 0, 307 | "track_views": 0 308 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/disease/disease.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe import _ 7 | from frappe.model.document import Document 8 | 9 | 10 | class Disease(Document): 11 | def validate(self): 12 | max_period = 0 13 | for task in self.treatment_task: 14 | # validate start_day is not > end_day 15 | if task.start_day > task.end_day: 16 | frappe.throw(_("Start day is greater than end day in task '{0}'").format(task.task_name)) 17 | # to calculate the period of the Crop Cycle 18 | if task.end_day > max_period: max_period = task.end_day 19 | self.treatment_period = max_period 20 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/disease/test_disease.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // rename this file from _test_[name] to test_[name] to activate 3 | // and remove above this line 4 | 5 | QUnit.test("test: Disease", function (assert) { 6 | let done = assert.async(); 7 | 8 | // number of asserts 9 | assert.expect(1); 10 | 11 | frappe.run_serially([ 12 | // insert a new Disease 13 | () => frappe.tests.make('Disease', [ 14 | // values to be set 15 | {common_name: 'Aphids'}, 16 | {scientific_name: 'Aphidoidea'}, 17 | {treatment_task: [ 18 | [ 19 | {task_name: "Survey and find the aphid locations"}, 20 | {start_day: 1}, 21 | {end_day: 2}, 22 | {holiday_management: "Ignore holidays"} 23 | ], 24 | [ 25 | {task_name: "Apply Pesticides"}, 26 | {start_day: 3}, 27 | {end_day: 3}, 28 | {holiday_management: "Ignore holidays"} 29 | ] 30 | ]} 31 | ]), 32 | () => { 33 | assert.equal(cur_frm.doc.treatment_period, 3); 34 | }, 35 | () => done() 36 | ]); 37 | 38 | }); 39 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/disease/test_disease.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | import frappe 7 | 8 | 9 | class TestDisease(unittest.TestCase): 10 | def test_treatment_period(self): 11 | disease = frappe.get_doc('Disease', 'Aphids') 12 | self.assertEqual(disease.treatment_period, 3) 13 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/disease/test_records.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "doctype": "Disease", 4 | "common_name": "Aphids", 5 | "scientific_name": "Aphidoidea", 6 | "treatment_task": [{ 7 | "task_name": "Survey and find the aphid locations", 8 | "start_day": 1, 9 | "end_day": 2, 10 | "holiday_management": "Ignore holidays" 11 | }, { 12 | "task_name": "Apply Pesticides", 13 | "start_day": 3, 14 | "end_day": 3, 15 | "holiday_management": "Ignore holidays" 16 | }] 17 | } 18 | ] -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/fertilizer/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer/fertilizer.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Fertilizer', { 5 | onload: (frm) => { 6 | if (frm.doc.fertilizer_contents == undefined) frm.call('load_contents'); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer/fertilizer.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "field:fertilizer_name", 8 | "beta": 0, 9 | "creation": "2017-10-17 18:17:06.175062", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "fertilizer_name", 25 | "fieldtype": "Data", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 1, 32 | "in_standard_filter": 0, 33 | "label": "Fertilizer Name", 34 | "length": 0, 35 | "no_copy": 0, 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 1 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "item", 57 | "fieldtype": "Link", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 0, 64 | "in_standard_filter": 0, 65 | "label": "Item", 66 | "length": 0, 67 | "no_copy": 0, 68 | "options": "Item", 69 | "permlevel": 0, 70 | "precision": "", 71 | "print_hide": 0, 72 | "print_hide_if_no_value": 0, 73 | "read_only": 0, 74 | "remember_last_selected_value": 0, 75 | "report_hide": 0, 76 | "reqd": 1, 77 | "search_index": 0, 78 | "set_only_once": 0, 79 | "translatable": 0, 80 | "unique": 0 81 | }, 82 | { 83 | "allow_bulk_edit": 0, 84 | "allow_in_quick_entry": 0, 85 | "allow_on_submit": 0, 86 | "bold": 0, 87 | "collapsible": 0, 88 | "columns": 0, 89 | "fieldname": "section_break_2", 90 | "fieldtype": "Section Break", 91 | "hidden": 0, 92 | "ignore_user_permissions": 0, 93 | "ignore_xss_filter": 0, 94 | "in_filter": 0, 95 | "in_global_search": 0, 96 | "in_list_view": 0, 97 | "in_standard_filter": 0, 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 0, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "density", 121 | "fieldtype": "Data", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 0, 128 | "in_standard_filter": 0, 129 | "label": "Density (if liquid)", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | }, 145 | { 146 | "allow_bulk_edit": 0, 147 | "allow_in_quick_entry": 0, 148 | "allow_on_submit": 0, 149 | "bold": 0, 150 | "collapsible": 0, 151 | "columns": 0, 152 | "fieldname": "section_break_4", 153 | "fieldtype": "Section Break", 154 | "hidden": 0, 155 | "ignore_user_permissions": 0, 156 | "ignore_xss_filter": 0, 157 | "in_filter": 0, 158 | "in_global_search": 0, 159 | "in_list_view": 0, 160 | "in_standard_filter": 0, 161 | "length": 0, 162 | "no_copy": 0, 163 | "permlevel": 0, 164 | "precision": "", 165 | "print_hide": 0, 166 | "print_hide_if_no_value": 0, 167 | "read_only": 0, 168 | "remember_last_selected_value": 0, 169 | "report_hide": 0, 170 | "reqd": 0, 171 | "search_index": 0, 172 | "set_only_once": 0, 173 | "translatable": 0, 174 | "unique": 0 175 | }, 176 | { 177 | "allow_bulk_edit": 0, 178 | "allow_in_quick_entry": 0, 179 | "allow_on_submit": 0, 180 | "bold": 0, 181 | "collapsible": 0, 182 | "columns": 0, 183 | "fieldname": "section_break_28", 184 | "fieldtype": "Section Break", 185 | "hidden": 0, 186 | "ignore_user_permissions": 0, 187 | "ignore_xss_filter": 0, 188 | "in_filter": 0, 189 | "in_global_search": 0, 190 | "in_list_view": 0, 191 | "in_standard_filter": 0, 192 | "label": "Fertilizer Contents", 193 | "length": 0, 194 | "no_copy": 0, 195 | "permlevel": 0, 196 | "precision": "", 197 | "print_hide": 0, 198 | "print_hide_if_no_value": 0, 199 | "read_only": 0, 200 | "remember_last_selected_value": 0, 201 | "report_hide": 0, 202 | "reqd": 0, 203 | "search_index": 0, 204 | "set_only_once": 0, 205 | "translatable": 0, 206 | "unique": 0 207 | }, 208 | { 209 | "allow_bulk_edit": 0, 210 | "allow_in_quick_entry": 0, 211 | "allow_on_submit": 0, 212 | "bold": 0, 213 | "collapsible": 0, 214 | "columns": 0, 215 | "fieldname": "fertilizer_contents", 216 | "fieldtype": "Table", 217 | "hidden": 0, 218 | "ignore_user_permissions": 0, 219 | "ignore_xss_filter": 0, 220 | "in_filter": 0, 221 | "in_global_search": 0, 222 | "in_list_view": 0, 223 | "in_standard_filter": 0, 224 | "length": 0, 225 | "no_copy": 0, 226 | "options": "Fertilizer Content", 227 | "permlevel": 0, 228 | "precision": "", 229 | "print_hide": 0, 230 | "print_hide_if_no_value": 0, 231 | "read_only": 0, 232 | "remember_last_selected_value": 0, 233 | "report_hide": 0, 234 | "reqd": 0, 235 | "search_index": 0, 236 | "set_only_once": 0, 237 | "translatable": 0, 238 | "unique": 0 239 | } 240 | ], 241 | "has_web_view": 0, 242 | "hide_heading": 0, 243 | "hide_toolbar": 0, 244 | "idx": 0, 245 | "image_view": 0, 246 | "in_create": 0, 247 | "is_submittable": 0, 248 | "issingle": 0, 249 | "istable": 0, 250 | "max_attachments": 0, 251 | "modified": "2018-11-04 03:26:29.211792", 252 | "modified_by": "Administrator", 253 | "module": "Agriculture", 254 | "name": "Fertilizer", 255 | "name_case": "", 256 | "owner": "Administrator", 257 | "permissions": [ 258 | { 259 | "amend": 0, 260 | "cancel": 0, 261 | "create": 1, 262 | "delete": 1, 263 | "email": 1, 264 | "export": 1, 265 | "if_owner": 0, 266 | "import": 0, 267 | "permlevel": 0, 268 | "print": 1, 269 | "read": 1, 270 | "report": 1, 271 | "role": "Agriculture Manager", 272 | "set_user_permissions": 0, 273 | "share": 1, 274 | "submit": 0, 275 | "write": 1 276 | }, 277 | { 278 | "amend": 0, 279 | "cancel": 0, 280 | "create": 0, 281 | "delete": 0, 282 | "email": 1, 283 | "export": 1, 284 | "if_owner": 0, 285 | "import": 0, 286 | "permlevel": 0, 287 | "print": 1, 288 | "read": 1, 289 | "report": 1, 290 | "role": "Agriculture User", 291 | "set_user_permissions": 0, 292 | "share": 1, 293 | "submit": 0, 294 | "write": 1 295 | } 296 | ], 297 | "quick_entry": 0, 298 | "read_only": 0, 299 | "read_only_onload": 0, 300 | "restrict_to_domain": "Agriculture", 301 | "show_name_in_global_search": 0, 302 | "sort_field": "modified", 303 | "sort_order": "DESC", 304 | "track_changes": 1, 305 | "track_seen": 0, 306 | "track_views": 0 307 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer/fertilizer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe.model.document import Document 7 | 8 | 9 | class Fertilizer(Document): 10 | @frappe.whitelist() 11 | def load_contents(self): 12 | docs = frappe.get_all("Agriculture Analysis Criteria", filters={'linked_doctype':'Fertilizer'}) 13 | for doc in docs: 14 | self.append('fertilizer_contents', {'title': str(doc.name)}) 15 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer/test_fertilizer.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // rename this file from _test_[name] to test_[name] to activate 3 | // and remove above this line 4 | 5 | QUnit.test("test: Fertilizer", function (assert) { 6 | let done = assert.async(); 7 | 8 | // number of asserts 9 | assert.expect(1); 10 | 11 | frappe.run_serially([ 12 | // insert a new Item 13 | () => frappe.tests.make('Item', [ 14 | // values to be set 15 | {item_code: 'Urea'}, 16 | {item_name: 'Urea'}, 17 | {item_group: 'Fertilizer'} 18 | ]), 19 | // insert a new Fertilizer 20 | () => frappe.tests.make('Fertilizer', [ 21 | // values to be set 22 | {fertilizer_name: 'Urea'}, 23 | {item: 'Urea'} 24 | ]), 25 | () => { 26 | assert.equal(cur_frm.doc.name, 'Urea'); 27 | }, 28 | () => done() 29 | ]); 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer/test_fertilizer.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | import frappe 7 | 8 | 9 | class TestFertilizer(unittest.TestCase): 10 | def test_fertilizer_creation(self): 11 | self.assertEqual(frappe.db.exists('Fertilizer', 'Urea'), 'Urea') 12 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer/test_records.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "doctype": "Item", 4 | "item_code": "Urea", 5 | "item_name": "Urea", 6 | "item_group": "Fertilizer" 7 | }, 8 | { 9 | "doctype": "Fertilizer", 10 | "fertilizer_name": "Urea", 11 | "item": "Urea" 12 | } 13 | ] -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer_content/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/fertilizer_content/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer_content/fertilizer_content.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_guest_to_view": 0, 4 | "allow_import": 0, 5 | "allow_rename": 0, 6 | "beta": 0, 7 | "creation": "2017-12-05 16:54:17.071914", 8 | "custom": 0, 9 | "docstatus": 0, 10 | "doctype": "DocType", 11 | "document_type": "", 12 | "editable_grid": 1, 13 | "engine": "InnoDB", 14 | "fields": [ 15 | { 16 | "allow_bulk_edit": 0, 17 | "allow_on_submit": 0, 18 | "bold": 0, 19 | "collapsible": 0, 20 | "columns": 0, 21 | "fieldname": "title", 22 | "fieldtype": "Link", 23 | "hidden": 0, 24 | "ignore_user_permissions": 0, 25 | "ignore_xss_filter": 0, 26 | "in_filter": 0, 27 | "in_global_search": 0, 28 | "in_list_view": 1, 29 | "in_standard_filter": 0, 30 | "label": "Title", 31 | "length": 0, 32 | "no_copy": 0, 33 | "options": "Agriculture Analysis Criteria", 34 | "permlevel": 0, 35 | "precision": "", 36 | "print_hide": 0, 37 | "print_hide_if_no_value": 0, 38 | "read_only": 0, 39 | "remember_last_selected_value": 0, 40 | "report_hide": 0, 41 | "reqd": 1, 42 | "search_index": 0, 43 | "set_only_once": 0, 44 | "unique": 0 45 | }, 46 | { 47 | "allow_bulk_edit": 0, 48 | "allow_on_submit": 0, 49 | "bold": 0, 50 | "collapsible": 0, 51 | "columns": 0, 52 | "fieldname": "value", 53 | "fieldtype": "Data", 54 | "hidden": 0, 55 | "ignore_user_permissions": 0, 56 | "ignore_xss_filter": 0, 57 | "in_filter": 0, 58 | "in_global_search": 0, 59 | "in_list_view": 1, 60 | "in_standard_filter": 0, 61 | "label": "Value", 62 | "length": 0, 63 | "no_copy": 0, 64 | "permlevel": 0, 65 | "precision": "", 66 | "print_hide": 0, 67 | "print_hide_if_no_value": 0, 68 | "read_only": 0, 69 | "remember_last_selected_value": 0, 70 | "report_hide": 0, 71 | "reqd": 0, 72 | "search_index": 0, 73 | "set_only_once": 0, 74 | "unique": 0 75 | } 76 | ], 77 | "has_web_view": 0, 78 | "hide_heading": 0, 79 | "hide_toolbar": 0, 80 | "idx": 0, 81 | "image_view": 0, 82 | "in_create": 0, 83 | "is_submittable": 0, 84 | "issingle": 0, 85 | "istable": 1, 86 | "max_attachments": 0, 87 | "modified": "2017-12-05 19:20:38.892231", 88 | "modified_by": "Administrator", 89 | "module": "Agriculture", 90 | "name": "Fertilizer Content", 91 | "name_case": "", 92 | "owner": "Administrator", 93 | "permissions": [], 94 | "quick_entry": 1, 95 | "read_only": 0, 96 | "read_only_onload": 0, 97 | "restrict_to_domain": "Agriculture", 98 | "show_name_in_global_search": 0, 99 | "sort_field": "modified", 100 | "sort_order": "DESC", 101 | "track_changes": 1, 102 | "track_seen": 0 103 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/fertilizer_content/fertilizer_content.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class FertilizerContent(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_location/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/linked_location/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_location/linked_location.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-11-22 14:34:59.461273", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "location", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Location", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Location", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | } 49 | ], 50 | "has_web_view": 0, 51 | "hide_heading": 0, 52 | "hide_toolbar": 0, 53 | "idx": 0, 54 | "image_view": 0, 55 | "in_create": 0, 56 | "is_submittable": 0, 57 | "issingle": 0, 58 | "istable": 1, 59 | "max_attachments": 0, 60 | "modified": "2018-11-04 03:27:58.120962", 61 | "modified_by": "Administrator", 62 | "module": "Agriculture", 63 | "name": "Linked Location", 64 | "name_case": "", 65 | "owner": "Administrator", 66 | "permissions": [], 67 | "quick_entry": 1, 68 | "read_only": 0, 69 | "read_only_onload": 0, 70 | "restrict_to_domain": "Agriculture", 71 | "show_name_in_global_search": 0, 72 | "sort_field": "modified", 73 | "sort_order": "DESC", 74 | "track_changes": 1, 75 | "track_seen": 0, 76 | "track_views": 0 77 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_location/linked_location.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class LinkedLocation(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_plant_analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/linked_plant_analysis/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-11-22 15:04:25.180446", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "plant_analysis", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Plant Analysis", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Plant Analysis", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | } 49 | ], 50 | "has_web_view": 0, 51 | "hide_heading": 0, 52 | "hide_toolbar": 0, 53 | "idx": 0, 54 | "image_view": 0, 55 | "in_create": 0, 56 | "is_submittable": 0, 57 | "issingle": 0, 58 | "istable": 1, 59 | "max_attachments": 0, 60 | "modified": "2018-11-04 03:25:15.359130", 61 | "modified_by": "Administrator", 62 | "module": "Agriculture", 63 | "name": "Linked Plant Analysis", 64 | "name_case": "", 65 | "owner": "Administrator", 66 | "permissions": [], 67 | "quick_entry": 1, 68 | "read_only": 0, 69 | "read_only_onload": 0, 70 | "restrict_to_domain": "Agriculture", 71 | "show_name_in_global_search": 0, 72 | "sort_field": "modified", 73 | "sort_order": "DESC", 74 | "track_changes": 1, 75 | "track_seen": 0, 76 | "track_views": 0 77 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_plant_analysis/linked_plant_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class LinkedPlantAnalysis(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_soil_analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/linked_soil_analysis/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-11-22 15:00:37.259063", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "soil_analysis", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Soil Analysis", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Soil Analysis", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | } 49 | ], 50 | "has_web_view": 0, 51 | "hide_heading": 0, 52 | "hide_toolbar": 0, 53 | "idx": 0, 54 | "image_view": 0, 55 | "in_create": 0, 56 | "is_submittable": 0, 57 | "issingle": 0, 58 | "istable": 1, 59 | "max_attachments": 0, 60 | "modified": "2018-11-04 03:25:27.670079", 61 | "modified_by": "Administrator", 62 | "module": "Agriculture", 63 | "name": "Linked Soil Analysis", 64 | "name_case": "", 65 | "owner": "Administrator", 66 | "permissions": [], 67 | "quick_entry": 1, 68 | "read_only": 0, 69 | "read_only_onload": 0, 70 | "restrict_to_domain": "Agriculture", 71 | "show_name_in_global_search": 0, 72 | "sort_field": "modified", 73 | "sort_order": "DESC", 74 | "track_changes": 1, 75 | "track_seen": 0, 76 | "track_views": 0 77 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class LinkedSoilAnalysis(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_soil_texture/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/linked_soil_texture/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_soil_texture/linked_soil_texture.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-11-22 14:58:52.818040", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "soil_texture", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Soil Texture", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Soil Texture", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | } 49 | ], 50 | "has_web_view": 0, 51 | "hide_heading": 0, 52 | "hide_toolbar": 0, 53 | "idx": 0, 54 | "image_view": 0, 55 | "in_create": 0, 56 | "is_submittable": 0, 57 | "issingle": 0, 58 | "istable": 1, 59 | "max_attachments": 0, 60 | "modified": "2018-11-04 03:26:17.877616", 61 | "modified_by": "Administrator", 62 | "module": "Agriculture", 63 | "name": "Linked Soil Texture", 64 | "name_case": "", 65 | "owner": "Administrator", 66 | "permissions": [], 67 | "quick_entry": 1, 68 | "read_only": 0, 69 | "read_only_onload": 0, 70 | "restrict_to_domain": "Agriculture", 71 | "show_name_in_global_search": 0, 72 | "sort_field": "modified", 73 | "sort_order": "DESC", 74 | "track_changes": 1, 75 | "track_seen": 0, 76 | "track_views": 0 77 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/linked_soil_texture/linked_soil_texture.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class LinkedSoilTexture(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/plant_analysis/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis/plant_analysis.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Plant Analysis', { 5 | onload: (frm) => { 6 | if (frm.doc.plant_analysis_criteria == undefined) frm.call('load_contents'); 7 | }, 8 | refresh: (frm) => { 9 | let map_tools = ["a.leaflet-draw-draw-polyline", 10 | "a.leaflet-draw-draw-polygon", 11 | "a.leaflet-draw-draw-rectangle", 12 | "a.leaflet-draw-draw-circle", 13 | "a.leaflet-draw-draw-circlemarker"]; 14 | 15 | map_tools.forEach((element) => $(element).hide()); 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis/plant_analysis.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "AG-PLA-.YYYY.-.#####", 8 | "beta": 0, 9 | "creation": "2017-10-18 12:45:13.575986", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "crop", 25 | "fieldtype": "Link", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 1, 32 | "in_standard_filter": 0, 33 | "label": "Crop", 34 | "length": 0, 35 | "no_copy": 0, 36 | "options": "Crop", 37 | "permlevel": 0, 38 | "precision": "", 39 | "print_hide": 0, 40 | "print_hide_if_no_value": 0, 41 | "read_only": 0, 42 | "remember_last_selected_value": 0, 43 | "report_hide": 0, 44 | "reqd": 1, 45 | "search_index": 0, 46 | "set_only_once": 0, 47 | "translatable": 0, 48 | "unique": 0 49 | }, 50 | { 51 | "allow_bulk_edit": 0, 52 | "allow_in_quick_entry": 0, 53 | "allow_on_submit": 0, 54 | "bold": 0, 55 | "collapsible": 0, 56 | "columns": 0, 57 | "fieldname": "section_break_1", 58 | "fieldtype": "Section Break", 59 | "hidden": 0, 60 | "ignore_user_permissions": 0, 61 | "ignore_xss_filter": 0, 62 | "in_filter": 0, 63 | "in_global_search": 0, 64 | "in_list_view": 0, 65 | "in_standard_filter": 0, 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "location", 89 | "fieldtype": "Geolocation", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 0, 96 | "in_standard_filter": 0, 97 | "label": "Location", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 0, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "column_break_2", 121 | "fieldtype": "Column Break", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 0, 128 | "in_standard_filter": 0, 129 | "length": 0, 130 | "no_copy": 0, 131 | "permlevel": 0, 132 | "precision": "", 133 | "print_hide": 0, 134 | "print_hide_if_no_value": 0, 135 | "read_only": 0, 136 | "remember_last_selected_value": 0, 137 | "report_hide": 0, 138 | "reqd": 0, 139 | "search_index": 0, 140 | "set_only_once": 0, 141 | "translatable": 0, 142 | "unique": 0 143 | }, 144 | { 145 | "allow_bulk_edit": 0, 146 | "allow_in_quick_entry": 0, 147 | "allow_on_submit": 0, 148 | "bold": 0, 149 | "collapsible": 0, 150 | "columns": 0, 151 | "fieldname": "collection_datetime", 152 | "fieldtype": "Datetime", 153 | "hidden": 0, 154 | "ignore_user_permissions": 0, 155 | "ignore_xss_filter": 0, 156 | "in_filter": 0, 157 | "in_global_search": 0, 158 | "in_list_view": 0, 159 | "in_standard_filter": 0, 160 | "label": "Collection Datetime", 161 | "length": 0, 162 | "no_copy": 0, 163 | "permlevel": 0, 164 | "precision": "", 165 | "print_hide": 0, 166 | "print_hide_if_no_value": 0, 167 | "read_only": 0, 168 | "remember_last_selected_value": 0, 169 | "report_hide": 0, 170 | "reqd": 1, 171 | "search_index": 0, 172 | "set_only_once": 0, 173 | "translatable": 0, 174 | "unique": 0 175 | }, 176 | { 177 | "allow_bulk_edit": 0, 178 | "allow_in_quick_entry": 0, 179 | "allow_on_submit": 0, 180 | "bold": 0, 181 | "collapsible": 0, 182 | "columns": 0, 183 | "fieldname": "laboratory_testing_datetime", 184 | "fieldtype": "Datetime", 185 | "hidden": 0, 186 | "ignore_user_permissions": 0, 187 | "ignore_xss_filter": 0, 188 | "in_filter": 0, 189 | "in_global_search": 0, 190 | "in_list_view": 0, 191 | "in_standard_filter": 0, 192 | "label": "Laboratory Testing Datetime", 193 | "length": 0, 194 | "no_copy": 0, 195 | "permlevel": 0, 196 | "precision": "", 197 | "print_hide": 0, 198 | "print_hide_if_no_value": 0, 199 | "read_only": 0, 200 | "remember_last_selected_value": 0, 201 | "report_hide": 0, 202 | "reqd": 0, 203 | "search_index": 0, 204 | "set_only_once": 0, 205 | "translatable": 0, 206 | "unique": 0 207 | }, 208 | { 209 | "allow_bulk_edit": 0, 210 | "allow_in_quick_entry": 0, 211 | "allow_on_submit": 0, 212 | "bold": 0, 213 | "collapsible": 0, 214 | "columns": 0, 215 | "fieldname": "result_datetime", 216 | "fieldtype": "Datetime", 217 | "hidden": 0, 218 | "ignore_user_permissions": 0, 219 | "ignore_xss_filter": 0, 220 | "in_filter": 0, 221 | "in_global_search": 0, 222 | "in_list_view": 1, 223 | "in_standard_filter": 0, 224 | "label": "Result Datetime", 225 | "length": 0, 226 | "no_copy": 0, 227 | "permlevel": 0, 228 | "precision": "", 229 | "print_hide": 0, 230 | "print_hide_if_no_value": 0, 231 | "read_only": 0, 232 | "remember_last_selected_value": 0, 233 | "report_hide": 0, 234 | "reqd": 0, 235 | "search_index": 0, 236 | "set_only_once": 0, 237 | "translatable": 0, 238 | "unique": 0 239 | }, 240 | { 241 | "allow_bulk_edit": 0, 242 | "allow_in_quick_entry": 0, 243 | "allow_on_submit": 0, 244 | "bold": 0, 245 | "collapsible": 0, 246 | "columns": 0, 247 | "fieldname": "section_break_2", 248 | "fieldtype": "Section Break", 249 | "hidden": 0, 250 | "ignore_user_permissions": 0, 251 | "ignore_xss_filter": 0, 252 | "in_filter": 0, 253 | "in_global_search": 0, 254 | "in_list_view": 0, 255 | "in_standard_filter": 0, 256 | "label": "Plant Analysis Criterias", 257 | "length": 0, 258 | "no_copy": 0, 259 | "permlevel": 0, 260 | "precision": "", 261 | "print_hide": 0, 262 | "print_hide_if_no_value": 0, 263 | "read_only": 0, 264 | "remember_last_selected_value": 0, 265 | "report_hide": 0, 266 | "reqd": 0, 267 | "search_index": 0, 268 | "set_only_once": 0, 269 | "translatable": 0, 270 | "unique": 0 271 | }, 272 | { 273 | "allow_bulk_edit": 0, 274 | "allow_in_quick_entry": 0, 275 | "allow_on_submit": 0, 276 | "bold": 0, 277 | "collapsible": 0, 278 | "columns": 0, 279 | "fieldname": "plant_analysis_criteria", 280 | "fieldtype": "Table", 281 | "hidden": 0, 282 | "ignore_user_permissions": 0, 283 | "ignore_xss_filter": 0, 284 | "in_filter": 0, 285 | "in_global_search": 0, 286 | "in_list_view": 0, 287 | "in_standard_filter": 0, 288 | "label": "", 289 | "length": 0, 290 | "no_copy": 0, 291 | "options": "Plant Analysis Criteria", 292 | "permlevel": 0, 293 | "precision": "", 294 | "print_hide": 0, 295 | "print_hide_if_no_value": 0, 296 | "read_only": 0, 297 | "remember_last_selected_value": 0, 298 | "report_hide": 0, 299 | "reqd": 0, 300 | "search_index": 0, 301 | "set_only_once": 0, 302 | "translatable": 0, 303 | "unique": 0 304 | } 305 | ], 306 | "has_web_view": 0, 307 | "hide_heading": 0, 308 | "hide_toolbar": 0, 309 | "idx": 0, 310 | "image_view": 0, 311 | "in_create": 0, 312 | "is_submittable": 0, 313 | "issingle": 0, 314 | "istable": 0, 315 | "max_attachments": 0, 316 | "modified": "2018-11-04 03:28:48.087828", 317 | "modified_by": "Administrator", 318 | "module": "Agriculture", 319 | "name": "Plant Analysis", 320 | "name_case": "", 321 | "owner": "Administrator", 322 | "permissions": [ 323 | { 324 | "amend": 0, 325 | "cancel": 0, 326 | "create": 1, 327 | "delete": 1, 328 | "email": 1, 329 | "export": 1, 330 | "if_owner": 0, 331 | "import": 0, 332 | "permlevel": 0, 333 | "print": 1, 334 | "read": 1, 335 | "report": 1, 336 | "role": "Agriculture Manager", 337 | "set_user_permissions": 0, 338 | "share": 1, 339 | "submit": 0, 340 | "write": 1 341 | }, 342 | { 343 | "amend": 0, 344 | "cancel": 0, 345 | "create": 0, 346 | "delete": 0, 347 | "email": 1, 348 | "export": 1, 349 | "if_owner": 0, 350 | "import": 0, 351 | "permlevel": 0, 352 | "print": 1, 353 | "read": 1, 354 | "report": 1, 355 | "role": "Agriculture User", 356 | "set_user_permissions": 0, 357 | "share": 1, 358 | "submit": 0, 359 | "write": 1 360 | } 361 | ], 362 | "quick_entry": 0, 363 | "read_only": 0, 364 | "read_only_onload": 0, 365 | "restrict_to_domain": "Agriculture", 366 | "show_name_in_global_search": 0, 367 | "sort_field": "modified", 368 | "sort_order": "DESC", 369 | "track_changes": 1, 370 | "track_seen": 0, 371 | "track_views": 0 372 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis/plant_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe.model.document import Document 7 | 8 | 9 | class PlantAnalysis(Document): 10 | @frappe.whitelist() 11 | def load_contents(self): 12 | docs = frappe.get_all("Agriculture Analysis Criteria", filters={'linked_doctype':'Plant Analysis'}) 13 | for doc in docs: 14 | self.append('plant_analysis_criteria', {'title': str(doc.name)}) 15 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis/test_plant_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | 7 | class TestPlantAnalysis(unittest.TestCase): 8 | pass 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis_criteria/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/plant_analysis_criteria/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-12-05 19:23:52.481348", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "title", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Title", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Agriculture Analysis Criteria", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "value", 57 | "fieldtype": "Data", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 1, 64 | "in_standard_filter": 0, 65 | "label": "Value", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "minimum_permissible_value", 89 | "fieldtype": "Data", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Minimum Permissible Value", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 0, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "maximum_permissible_value", 121 | "fieldtype": "Data", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 1, 128 | "in_standard_filter": 0, 129 | "label": "Maximum Permissible Value", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | } 145 | ], 146 | "has_web_view": 0, 147 | "hide_heading": 0, 148 | "hide_toolbar": 0, 149 | "idx": 0, 150 | "image_view": 0, 151 | "in_create": 0, 152 | "is_submittable": 0, 153 | "issingle": 0, 154 | "istable": 1, 155 | "max_attachments": 0, 156 | "modified": "2018-11-04 03:25:43.714882", 157 | "modified_by": "Administrator", 158 | "module": "Agriculture", 159 | "name": "Plant Analysis Criteria", 160 | "name_case": "", 161 | "owner": "Administrator", 162 | "permissions": [], 163 | "quick_entry": 1, 164 | "read_only": 0, 165 | "read_only_onload": 0, 166 | "restrict_to_domain": "Agriculture", 167 | "show_name_in_global_search": 0, 168 | "sort_field": "modified", 169 | "sort_order": "DESC", 170 | "track_changes": 1, 171 | "track_seen": 0, 172 | "track_views": 0 173 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/plant_analysis_criteria/plant_analysis_criteria.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class PlantAnalysisCriteria(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/soil_analysis/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis/soil_analysis.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Soil Analysis', { 5 | onload: (frm) => { 6 | if (frm.doc.soil_analysis_criteria == undefined) frm.call('load_contents'); 7 | }, 8 | refresh: (frm) => { 9 | let map_tools = ["a.leaflet-draw-draw-polyline", 10 | "a.leaflet-draw-draw-polygon", 11 | "a.leaflet-draw-draw-rectangle", 12 | "a.leaflet-draw-draw-circle", 13 | "a.leaflet-draw-draw-circlemarker"]; 14 | 15 | map_tools.forEach((element) => $(element).hide()); 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis/soil_analysis.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "AG-ANA-.YY.-.MM.-.#####", 8 | "beta": 0, 9 | "creation": "2017-10-17 19:12:16.728395", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "location", 25 | "fieldtype": "Geolocation", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 0, 32 | "in_standard_filter": 0, 33 | "label": "Location", 34 | "length": 0, 35 | "no_copy": 0, 36 | "options": "", 37 | "permlevel": 0, 38 | "precision": "", 39 | "print_hide": 0, 40 | "print_hide_if_no_value": 0, 41 | "read_only": 0, 42 | "remember_last_selected_value": 0, 43 | "report_hide": 0, 44 | "reqd": 0, 45 | "search_index": 0, 46 | "set_only_once": 0, 47 | "translatable": 0, 48 | "unique": 0 49 | }, 50 | { 51 | "allow_bulk_edit": 0, 52 | "allow_in_quick_entry": 0, 53 | "allow_on_submit": 0, 54 | "bold": 0, 55 | "collapsible": 0, 56 | "columns": 0, 57 | "fieldname": "column_break_2", 58 | "fieldtype": "Column Break", 59 | "hidden": 0, 60 | "ignore_user_permissions": 0, 61 | "ignore_xss_filter": 0, 62 | "in_filter": 0, 63 | "in_global_search": 0, 64 | "in_list_view": 0, 65 | "in_standard_filter": 0, 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "collection_datetime", 89 | "fieldtype": "Datetime", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Collection Datetime", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 1, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "laboratory_testing_datetime", 121 | "fieldtype": "Datetime", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 0, 128 | "in_standard_filter": 0, 129 | "label": "Laboratory Testing Datetime", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | }, 145 | { 146 | "allow_bulk_edit": 0, 147 | "allow_in_quick_entry": 0, 148 | "allow_on_submit": 0, 149 | "bold": 0, 150 | "collapsible": 0, 151 | "columns": 0, 152 | "fieldname": "result_datetime", 153 | "fieldtype": "Datetime", 154 | "hidden": 0, 155 | "ignore_user_permissions": 0, 156 | "ignore_xss_filter": 0, 157 | "in_filter": 0, 158 | "in_global_search": 0, 159 | "in_list_view": 0, 160 | "in_standard_filter": 0, 161 | "label": "Result Datetime", 162 | "length": 0, 163 | "no_copy": 0, 164 | "permlevel": 0, 165 | "precision": "", 166 | "print_hide": 0, 167 | "print_hide_if_no_value": 0, 168 | "read_only": 0, 169 | "remember_last_selected_value": 0, 170 | "report_hide": 0, 171 | "reqd": 0, 172 | "search_index": 0, 173 | "set_only_once": 0, 174 | "translatable": 0, 175 | "unique": 0 176 | }, 177 | { 178 | "allow_bulk_edit": 0, 179 | "allow_in_quick_entry": 0, 180 | "allow_on_submit": 0, 181 | "bold": 0, 182 | "collapsible": 0, 183 | "columns": 0, 184 | "fieldname": "section_break_3", 185 | "fieldtype": "Section Break", 186 | "hidden": 0, 187 | "ignore_user_permissions": 0, 188 | "ignore_xss_filter": 0, 189 | "in_filter": 0, 190 | "in_global_search": 0, 191 | "in_list_view": 0, 192 | "in_standard_filter": 0, 193 | "length": 0, 194 | "no_copy": 0, 195 | "permlevel": 0, 196 | "precision": "", 197 | "print_hide": 0, 198 | "print_hide_if_no_value": 0, 199 | "read_only": 0, 200 | "remember_last_selected_value": 0, 201 | "report_hide": 0, 202 | "reqd": 0, 203 | "search_index": 0, 204 | "set_only_once": 0, 205 | "translatable": 0, 206 | "unique": 0 207 | }, 208 | { 209 | "allow_bulk_edit": 0, 210 | "allow_in_quick_entry": 0, 211 | "allow_on_submit": 0, 212 | "bold": 0, 213 | "collapsible": 0, 214 | "columns": 0, 215 | "fieldname": "ca_per_k", 216 | "fieldtype": "Data", 217 | "hidden": 0, 218 | "ignore_user_permissions": 0, 219 | "ignore_xss_filter": 0, 220 | "in_filter": 0, 221 | "in_global_search": 0, 222 | "in_list_view": 0, 223 | "in_standard_filter": 0, 224 | "label": "Ca/K", 225 | "length": 0, 226 | "no_copy": 0, 227 | "permlevel": 0, 228 | "precision": "", 229 | "print_hide": 0, 230 | "print_hide_if_no_value": 0, 231 | "read_only": 1, 232 | "remember_last_selected_value": 0, 233 | "report_hide": 0, 234 | "reqd": 0, 235 | "search_index": 0, 236 | "set_only_once": 0, 237 | "translatable": 0, 238 | "unique": 0 239 | }, 240 | { 241 | "allow_bulk_edit": 0, 242 | "allow_in_quick_entry": 0, 243 | "allow_on_submit": 0, 244 | "bold": 0, 245 | "collapsible": 0, 246 | "columns": 0, 247 | "fieldname": "ca_per_mg", 248 | "fieldtype": "Data", 249 | "hidden": 0, 250 | "ignore_user_permissions": 0, 251 | "ignore_xss_filter": 0, 252 | "in_filter": 0, 253 | "in_global_search": 0, 254 | "in_list_view": 0, 255 | "in_standard_filter": 0, 256 | "label": "Ca/Mg", 257 | "length": 0, 258 | "no_copy": 0, 259 | "permlevel": 0, 260 | "precision": "", 261 | "print_hide": 0, 262 | "print_hide_if_no_value": 0, 263 | "read_only": 1, 264 | "remember_last_selected_value": 0, 265 | "report_hide": 0, 266 | "reqd": 0, 267 | "search_index": 0, 268 | "set_only_once": 0, 269 | "translatable": 0, 270 | "unique": 0 271 | }, 272 | { 273 | "allow_bulk_edit": 0, 274 | "allow_in_quick_entry": 0, 275 | "allow_on_submit": 0, 276 | "bold": 0, 277 | "collapsible": 0, 278 | "columns": 0, 279 | "fieldname": "mg_per_k", 280 | "fieldtype": "Data", 281 | "hidden": 0, 282 | "ignore_user_permissions": 0, 283 | "ignore_xss_filter": 0, 284 | "in_filter": 0, 285 | "in_global_search": 0, 286 | "in_list_view": 0, 287 | "in_standard_filter": 0, 288 | "label": "Mg/K", 289 | "length": 0, 290 | "no_copy": 0, 291 | "permlevel": 0, 292 | "precision": "", 293 | "print_hide": 0, 294 | "print_hide_if_no_value": 0, 295 | "read_only": 1, 296 | "remember_last_selected_value": 0, 297 | "report_hide": 0, 298 | "reqd": 0, 299 | "search_index": 0, 300 | "set_only_once": 0, 301 | "translatable": 0, 302 | "unique": 0 303 | }, 304 | { 305 | "allow_bulk_edit": 0, 306 | "allow_in_quick_entry": 0, 307 | "allow_on_submit": 0, 308 | "bold": 0, 309 | "collapsible": 0, 310 | "columns": 0, 311 | "fieldname": "column_break_31", 312 | "fieldtype": "Column Break", 313 | "hidden": 0, 314 | "ignore_user_permissions": 0, 315 | "ignore_xss_filter": 0, 316 | "in_filter": 0, 317 | "in_global_search": 0, 318 | "in_list_view": 0, 319 | "in_standard_filter": 0, 320 | "length": 0, 321 | "no_copy": 0, 322 | "permlevel": 0, 323 | "precision": "", 324 | "print_hide": 0, 325 | "print_hide_if_no_value": 0, 326 | "read_only": 0, 327 | "remember_last_selected_value": 0, 328 | "report_hide": 0, 329 | "reqd": 0, 330 | "search_index": 0, 331 | "set_only_once": 0, 332 | "translatable": 0, 333 | "unique": 0 334 | }, 335 | { 336 | "allow_bulk_edit": 0, 337 | "allow_in_quick_entry": 0, 338 | "allow_on_submit": 0, 339 | "bold": 0, 340 | "collapsible": 0, 341 | "columns": 0, 342 | "fieldname": "ca_mg_per_k", 343 | "fieldtype": "Data", 344 | "hidden": 0, 345 | "ignore_user_permissions": 0, 346 | "ignore_xss_filter": 0, 347 | "in_filter": 0, 348 | "in_global_search": 0, 349 | "in_list_view": 0, 350 | "in_standard_filter": 0, 351 | "label": "(Ca+Mg)/K", 352 | "length": 0, 353 | "no_copy": 0, 354 | "permlevel": 0, 355 | "precision": "", 356 | "print_hide": 0, 357 | "print_hide_if_no_value": 0, 358 | "read_only": 1, 359 | "remember_last_selected_value": 0, 360 | "report_hide": 0, 361 | "reqd": 0, 362 | "search_index": 0, 363 | "set_only_once": 0, 364 | "translatable": 0, 365 | "unique": 0 366 | }, 367 | { 368 | "allow_bulk_edit": 0, 369 | "allow_in_quick_entry": 0, 370 | "allow_on_submit": 0, 371 | "bold": 0, 372 | "collapsible": 0, 373 | "columns": 0, 374 | "fieldname": "ca_per_k_ca_mg", 375 | "fieldtype": "Data", 376 | "hidden": 0, 377 | "ignore_user_permissions": 0, 378 | "ignore_xss_filter": 0, 379 | "in_filter": 0, 380 | "in_global_search": 0, 381 | "in_list_view": 0, 382 | "in_standard_filter": 0, 383 | "label": "Ca/(K+Ca+Mg)", 384 | "length": 0, 385 | "no_copy": 0, 386 | "permlevel": 0, 387 | "precision": "", 388 | "print_hide": 0, 389 | "print_hide_if_no_value": 0, 390 | "read_only": 1, 391 | "remember_last_selected_value": 0, 392 | "report_hide": 0, 393 | "reqd": 0, 394 | "search_index": 0, 395 | "set_only_once": 0, 396 | "translatable": 0, 397 | "unique": 0 398 | }, 399 | { 400 | "allow_bulk_edit": 0, 401 | "allow_in_quick_entry": 0, 402 | "allow_on_submit": 0, 403 | "bold": 0, 404 | "collapsible": 0, 405 | "columns": 0, 406 | "fieldname": "section_break_28", 407 | "fieldtype": "Section Break", 408 | "hidden": 0, 409 | "ignore_user_permissions": 0, 410 | "ignore_xss_filter": 0, 411 | "in_filter": 0, 412 | "in_global_search": 0, 413 | "in_list_view": 0, 414 | "in_standard_filter": 0, 415 | "length": 0, 416 | "no_copy": 0, 417 | "permlevel": 0, 418 | "precision": "", 419 | "print_hide": 0, 420 | "print_hide_if_no_value": 0, 421 | "read_only": 0, 422 | "remember_last_selected_value": 0, 423 | "report_hide": 0, 424 | "reqd": 0, 425 | "search_index": 0, 426 | "set_only_once": 0, 427 | "translatable": 0, 428 | "unique": 0 429 | }, 430 | { 431 | "allow_bulk_edit": 0, 432 | "allow_in_quick_entry": 0, 433 | "allow_on_submit": 0, 434 | "bold": 0, 435 | "collapsible": 0, 436 | "columns": 0, 437 | "fieldname": "invoice_number", 438 | "fieldtype": "Data", 439 | "hidden": 0, 440 | "ignore_user_permissions": 0, 441 | "ignore_xss_filter": 0, 442 | "in_filter": 0, 443 | "in_global_search": 0, 444 | "in_list_view": 0, 445 | "in_standard_filter": 0, 446 | "label": "Invoice Number", 447 | "length": 0, 448 | "no_copy": 0, 449 | "permlevel": 0, 450 | "precision": "", 451 | "print_hide": 0, 452 | "print_hide_if_no_value": 0, 453 | "read_only": 0, 454 | "remember_last_selected_value": 0, 455 | "report_hide": 0, 456 | "reqd": 0, 457 | "search_index": 0, 458 | "set_only_once": 0, 459 | "translatable": 0, 460 | "unique": 0 461 | }, 462 | { 463 | "allow_bulk_edit": 0, 464 | "allow_in_quick_entry": 0, 465 | "allow_on_submit": 0, 466 | "bold": 0, 467 | "collapsible": 0, 468 | "columns": 0, 469 | "fieldname": "soil_analysis_criterias", 470 | "fieldtype": "Section Break", 471 | "hidden": 0, 472 | "ignore_user_permissions": 0, 473 | "ignore_xss_filter": 0, 474 | "in_filter": 0, 475 | "in_global_search": 0, 476 | "in_list_view": 0, 477 | "in_standard_filter": 0, 478 | "label": "Soil Analysis Criterias", 479 | "length": 0, 480 | "no_copy": 0, 481 | "permlevel": 0, 482 | "precision": "", 483 | "print_hide": 0, 484 | "print_hide_if_no_value": 0, 485 | "read_only": 0, 486 | "remember_last_selected_value": 0, 487 | "report_hide": 0, 488 | "reqd": 0, 489 | "search_index": 0, 490 | "set_only_once": 0, 491 | "translatable": 0, 492 | "unique": 0 493 | }, 494 | { 495 | "allow_bulk_edit": 0, 496 | "allow_in_quick_entry": 0, 497 | "allow_on_submit": 0, 498 | "bold": 0, 499 | "collapsible": 0, 500 | "columns": 0, 501 | "fieldname": "soil_analysis_criteria", 502 | "fieldtype": "Table", 503 | "hidden": 0, 504 | "ignore_user_permissions": 0, 505 | "ignore_xss_filter": 0, 506 | "in_filter": 0, 507 | "in_global_search": 0, 508 | "in_list_view": 0, 509 | "in_standard_filter": 0, 510 | "length": 0, 511 | "no_copy": 0, 512 | "options": "Soil Analysis Criteria", 513 | "permlevel": 0, 514 | "precision": "", 515 | "print_hide": 0, 516 | "print_hide_if_no_value": 0, 517 | "read_only": 0, 518 | "remember_last_selected_value": 0, 519 | "report_hide": 0, 520 | "reqd": 0, 521 | "search_index": 0, 522 | "set_only_once": 0, 523 | "translatable": 0, 524 | "unique": 0 525 | } 526 | ], 527 | "has_web_view": 0, 528 | "hide_heading": 0, 529 | "hide_toolbar": 0, 530 | "idx": 0, 531 | "image_view": 0, 532 | "in_create": 0, 533 | "is_submittable": 0, 534 | "issingle": 0, 535 | "istable": 0, 536 | "max_attachments": 0, 537 | "modified": "2018-11-04 03:28:58.403760", 538 | "modified_by": "Administrator", 539 | "module": "Agriculture", 540 | "name": "Soil Analysis", 541 | "name_case": "", 542 | "owner": "Administrator", 543 | "permissions": [ 544 | { 545 | "amend": 0, 546 | "cancel": 0, 547 | "create": 1, 548 | "delete": 1, 549 | "email": 1, 550 | "export": 1, 551 | "if_owner": 0, 552 | "import": 0, 553 | "permlevel": 0, 554 | "print": 1, 555 | "read": 1, 556 | "report": 1, 557 | "role": "Agriculture Manager", 558 | "set_user_permissions": 0, 559 | "share": 1, 560 | "submit": 0, 561 | "write": 1 562 | }, 563 | { 564 | "amend": 0, 565 | "cancel": 0, 566 | "create": 0, 567 | "delete": 0, 568 | "email": 1, 569 | "export": 1, 570 | "if_owner": 0, 571 | "import": 0, 572 | "permlevel": 0, 573 | "print": 1, 574 | "read": 1, 575 | "report": 1, 576 | "role": "Agriculture User", 577 | "set_user_permissions": 0, 578 | "share": 1, 579 | "submit": 0, 580 | "write": 1 581 | } 582 | ], 583 | "quick_entry": 0, 584 | "read_only": 0, 585 | "read_only_onload": 0, 586 | "restrict_to_domain": "Agriculture", 587 | "show_name_in_global_search": 0, 588 | "sort_field": "modified", 589 | "sort_order": "DESC", 590 | "track_changes": 1, 591 | "track_seen": 0, 592 | "track_views": 0 593 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis/soil_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe.model.document import Document 7 | 8 | 9 | class SoilAnalysis(Document): 10 | @frappe.whitelist() 11 | def load_contents(self): 12 | docs = frappe.get_all("Agriculture Analysis Criteria", filters={'linked_doctype':'Soil Analysis'}) 13 | for doc in docs: 14 | self.append('soil_analysis_criteria', {'title': str(doc.name)}) 15 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis/test_soil_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | 7 | class TestSoilAnalysis(unittest.TestCase): 8 | pass 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis_criteria/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/soil_analysis_criteria/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-12-05 19:36:05.300770", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "title", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Title", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Agriculture Analysis Criteria", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "value", 57 | "fieldtype": "Data", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 1, 64 | "in_standard_filter": 0, 65 | "label": "Value", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "minimum_permissible_value", 89 | "fieldtype": "Data", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Minimum Permissible Value", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 0, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "maximum_permissible_value", 121 | "fieldtype": "Data", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 1, 128 | "in_standard_filter": 0, 129 | "label": "Maximum Permissible Value", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | } 145 | ], 146 | "has_web_view": 0, 147 | "hide_heading": 0, 148 | "hide_toolbar": 0, 149 | "idx": 0, 150 | "image_view": 0, 151 | "in_create": 0, 152 | "is_submittable": 0, 153 | "issingle": 0, 154 | "istable": 1, 155 | "max_attachments": 0, 156 | "modified": "2018-11-04 03:25:54.359008", 157 | "modified_by": "Administrator", 158 | "module": "Agriculture", 159 | "name": "Soil Analysis Criteria", 160 | "name_case": "", 161 | "owner": "Administrator", 162 | "permissions": [], 163 | "quick_entry": 1, 164 | "read_only": 0, 165 | "read_only_onload": 0, 166 | "restrict_to_domain": "Agriculture", 167 | "show_name_in_global_search": 0, 168 | "sort_field": "modified", 169 | "sort_order": "DESC", 170 | "track_changes": 1, 171 | "track_seen": 0, 172 | "track_views": 0 173 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_analysis_criteria/soil_analysis_criteria.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class SoilAnalysisCriteria(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/soil_texture/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture/soil_texture.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.provide('agriculture'); 5 | 6 | frappe.ui.form.on('Soil Texture', { 7 | refresh: (frm) => { 8 | let map_tools = ["a.leaflet-draw-draw-polyline", 9 | "a.leaflet-draw-draw-polygon", 10 | "a.leaflet-draw-draw-rectangle", 11 | "a.leaflet-draw-draw-circle", 12 | "a.leaflet-draw-draw-circlemarker"]; 13 | 14 | map_tools.forEach((element) => $(element).hide()); 15 | }, 16 | onload: function(frm) { 17 | if (frm.doc.soil_texture_criteria == undefined) frm.call('load_contents'); 18 | if (frm.doc.ternary_plot) return; 19 | frm.doc.ternary_plot = new agriculture.TernaryPlot({ 20 | parent: frm.get_field("ternary_plot").$wrapper, 21 | clay: frm.doc.clay_composition, 22 | sand: frm.doc.sand_composition, 23 | silt: frm.doc.silt_composition, 24 | }); 25 | }, 26 | soil_type: (frm) => { 27 | let composition_types = ['clay_composition', 'sand_composition', 'silt_composition']; 28 | composition_types.forEach((composition_type) => { 29 | frm.doc[composition_type] = 0; 30 | frm.refresh_field(composition_type); 31 | }); 32 | }, 33 | clay_composition: function(frm) { 34 | frm.call("update_soil_edit", { 35 | soil_type: 'clay_composition' 36 | }, () => { 37 | refresh_ternary_plot(frm, this); 38 | }); 39 | }, 40 | sand_composition: function(frm) { 41 | frm.call("update_soil_edit", { 42 | soil_type: 'sand_composition' 43 | }, () => { 44 | refresh_ternary_plot(frm, this); 45 | }); 46 | }, 47 | silt_composition: function(frm) { 48 | frm.call("update_soil_edit", { 49 | soil_type: 'silt_composition' 50 | }, () => { 51 | refresh_ternary_plot(frm, this); 52 | }); 53 | } 54 | }); 55 | 56 | let refresh_ternary_plot = (frm, me) => { 57 | me.ternary_plot.remove_blip(); 58 | me.ternary_plot.mark_blip({clay: frm.doc.clay_composition, sand: frm.doc.sand_composition, silt: frm.doc.silt_composition}); 59 | }; 60 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture/soil_texture.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "AG-TEX-.YYYY.-.#####", 8 | "beta": 0, 9 | "creation": "2017-10-18 13:06:47.506762", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "location", 25 | "fieldtype": "Geolocation", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 0, 32 | "in_standard_filter": 0, 33 | "label": "Location", 34 | "length": 0, 35 | "no_copy": 0, 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "column_break_2", 57 | "fieldtype": "Column Break", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 0, 64 | "in_standard_filter": 0, 65 | "length": 0, 66 | "no_copy": 0, 67 | "permlevel": 0, 68 | "precision": "", 69 | "print_hide": 0, 70 | "print_hide_if_no_value": 0, 71 | "read_only": 0, 72 | "remember_last_selected_value": 0, 73 | "report_hide": 0, 74 | "reqd": 0, 75 | "search_index": 0, 76 | "set_only_once": 0, 77 | "translatable": 0, 78 | "unique": 0 79 | }, 80 | { 81 | "allow_bulk_edit": 0, 82 | "allow_in_quick_entry": 0, 83 | "allow_on_submit": 0, 84 | "bold": 0, 85 | "collapsible": 0, 86 | "columns": 0, 87 | "fieldname": "collection_datetime", 88 | "fieldtype": "Datetime", 89 | "hidden": 0, 90 | "ignore_user_permissions": 0, 91 | "ignore_xss_filter": 0, 92 | "in_filter": 0, 93 | "in_global_search": 0, 94 | "in_list_view": 0, 95 | "in_standard_filter": 0, 96 | "label": "Collection Datetime", 97 | "length": 0, 98 | "no_copy": 0, 99 | "permlevel": 0, 100 | "precision": "", 101 | "print_hide": 0, 102 | "print_hide_if_no_value": 0, 103 | "read_only": 0, 104 | "remember_last_selected_value": 0, 105 | "report_hide": 0, 106 | "reqd": 1, 107 | "search_index": 0, 108 | "set_only_once": 0, 109 | "translatable": 0, 110 | "unique": 0 111 | }, 112 | { 113 | "allow_bulk_edit": 0, 114 | "allow_in_quick_entry": 0, 115 | "allow_on_submit": 0, 116 | "bold": 0, 117 | "collapsible": 0, 118 | "columns": 0, 119 | "fieldname": "laboratory_testing_datetime", 120 | "fieldtype": "Datetime", 121 | "hidden": 0, 122 | "ignore_user_permissions": 0, 123 | "ignore_xss_filter": 0, 124 | "in_filter": 0, 125 | "in_global_search": 0, 126 | "in_list_view": 0, 127 | "in_standard_filter": 0, 128 | "label": "Laboratory Testing Datetime", 129 | "length": 0, 130 | "no_copy": 0, 131 | "permlevel": 0, 132 | "precision": "", 133 | "print_hide": 0, 134 | "print_hide_if_no_value": 0, 135 | "read_only": 0, 136 | "remember_last_selected_value": 0, 137 | "report_hide": 0, 138 | "reqd": 0, 139 | "search_index": 0, 140 | "set_only_once": 0, 141 | "translatable": 0, 142 | "unique": 0 143 | }, 144 | { 145 | "allow_bulk_edit": 0, 146 | "allow_in_quick_entry": 0, 147 | "allow_on_submit": 0, 148 | "bold": 0, 149 | "collapsible": 0, 150 | "columns": 0, 151 | "fieldname": "result_datetime", 152 | "fieldtype": "Datetime", 153 | "hidden": 0, 154 | "ignore_user_permissions": 0, 155 | "ignore_xss_filter": 0, 156 | "in_filter": 0, 157 | "in_global_search": 0, 158 | "in_list_view": 1, 159 | "in_standard_filter": 0, 160 | "label": "Result Datetime", 161 | "length": 0, 162 | "no_copy": 0, 163 | "permlevel": 0, 164 | "precision": "", 165 | "print_hide": 0, 166 | "print_hide_if_no_value": 0, 167 | "read_only": 0, 168 | "remember_last_selected_value": 0, 169 | "report_hide": 0, 170 | "reqd": 0, 171 | "search_index": 0, 172 | "set_only_once": 0, 173 | "translatable": 0, 174 | "unique": 0 175 | }, 176 | { 177 | "allow_bulk_edit": 0, 178 | "allow_in_quick_entry": 0, 179 | "allow_on_submit": 0, 180 | "bold": 0, 181 | "collapsible": 0, 182 | "columns": 0, 183 | "fieldname": "section_break_4", 184 | "fieldtype": "Section Break", 185 | "hidden": 0, 186 | "ignore_user_permissions": 0, 187 | "ignore_xss_filter": 0, 188 | "in_filter": 0, 189 | "in_global_search": 0, 190 | "in_list_view": 0, 191 | "in_standard_filter": 0, 192 | "length": 0, 193 | "no_copy": 0, 194 | "permlevel": 0, 195 | "precision": "", 196 | "print_hide": 0, 197 | "print_hide_if_no_value": 0, 198 | "read_only": 0, 199 | "remember_last_selected_value": 0, 200 | "report_hide": 0, 201 | "reqd": 0, 202 | "search_index": 0, 203 | "set_only_once": 0, 204 | "translatable": 0, 205 | "unique": 0 206 | }, 207 | { 208 | "allow_bulk_edit": 0, 209 | "allow_in_quick_entry": 0, 210 | "allow_on_submit": 0, 211 | "bold": 0, 212 | "collapsible": 0, 213 | "columns": 0, 214 | "fieldname": "soil_type", 215 | "fieldtype": "Select", 216 | "hidden": 0, 217 | "ignore_user_permissions": 0, 218 | "ignore_xss_filter": 0, 219 | "in_filter": 0, 220 | "in_global_search": 0, 221 | "in_list_view": 0, 222 | "in_standard_filter": 0, 223 | "label": "Soil Type", 224 | "length": 0, 225 | "no_copy": 0, 226 | "options": "Select\nSand\nLoamy Sand\nSandy Loam\nLoam\nSilt Loam\nSilt\nSandy Clay Loam\nClay Loam\nSilty Clay Loam\nSandy Clay\nSilty Clay\nClay", 227 | "permlevel": 0, 228 | "precision": "", 229 | "print_hide": 0, 230 | "print_hide_if_no_value": 0, 231 | "read_only": 0, 232 | "remember_last_selected_value": 0, 233 | "report_hide": 0, 234 | "reqd": 0, 235 | "search_index": 0, 236 | "set_only_once": 0, 237 | "translatable": 0, 238 | "unique": 0 239 | }, 240 | { 241 | "allow_bulk_edit": 0, 242 | "allow_in_quick_entry": 0, 243 | "allow_on_submit": 0, 244 | "bold": 0, 245 | "collapsible": 0, 246 | "columns": 0, 247 | "default": "0", 248 | "fieldname": "clay_composition", 249 | "fieldtype": "Percent", 250 | "hidden": 0, 251 | "ignore_user_permissions": 0, 252 | "ignore_xss_filter": 0, 253 | "in_filter": 0, 254 | "in_global_search": 0, 255 | "in_list_view": 0, 256 | "in_standard_filter": 0, 257 | "label": "Clay Composition (%)", 258 | "length": 0, 259 | "no_copy": 0, 260 | "permlevel": 0, 261 | "precision": "", 262 | "print_hide": 0, 263 | "print_hide_if_no_value": 0, 264 | "read_only": 0, 265 | "remember_last_selected_value": 0, 266 | "report_hide": 0, 267 | "reqd": 0, 268 | "search_index": 0, 269 | "set_only_once": 0, 270 | "translatable": 0, 271 | "unique": 0 272 | }, 273 | { 274 | "allow_bulk_edit": 0, 275 | "allow_in_quick_entry": 0, 276 | "allow_on_submit": 0, 277 | "bold": 0, 278 | "collapsible": 0, 279 | "columns": 0, 280 | "default": "0", 281 | "fieldname": "sand_composition", 282 | "fieldtype": "Percent", 283 | "hidden": 0, 284 | "ignore_user_permissions": 0, 285 | "ignore_xss_filter": 0, 286 | "in_filter": 0, 287 | "in_global_search": 0, 288 | "in_list_view": 0, 289 | "in_standard_filter": 0, 290 | "label": "Sand Composition (%)", 291 | "length": 0, 292 | "no_copy": 0, 293 | "permlevel": 0, 294 | "precision": "", 295 | "print_hide": 0, 296 | "print_hide_if_no_value": 0, 297 | "read_only": 0, 298 | "remember_last_selected_value": 0, 299 | "report_hide": 0, 300 | "reqd": 0, 301 | "search_index": 0, 302 | "set_only_once": 0, 303 | "translatable": 0, 304 | "unique": 0 305 | }, 306 | { 307 | "allow_bulk_edit": 0, 308 | "allow_in_quick_entry": 0, 309 | "allow_on_submit": 0, 310 | "bold": 0, 311 | "collapsible": 0, 312 | "columns": 0, 313 | "default": "0", 314 | "fieldname": "silt_composition", 315 | "fieldtype": "Percent", 316 | "hidden": 0, 317 | "ignore_user_permissions": 0, 318 | "ignore_xss_filter": 0, 319 | "in_filter": 0, 320 | "in_global_search": 0, 321 | "in_list_view": 0, 322 | "in_standard_filter": 0, 323 | "label": "Silt Composition (%)", 324 | "length": 0, 325 | "no_copy": 0, 326 | "permlevel": 0, 327 | "precision": "", 328 | "print_hide": 0, 329 | "print_hide_if_no_value": 0, 330 | "read_only": 0, 331 | "remember_last_selected_value": 0, 332 | "report_hide": 0, 333 | "reqd": 0, 334 | "search_index": 0, 335 | "set_only_once": 0, 336 | "translatable": 0, 337 | "unique": 0 338 | }, 339 | { 340 | "allow_bulk_edit": 0, 341 | "allow_in_quick_entry": 0, 342 | "allow_on_submit": 0, 343 | "bold": 0, 344 | "collapsible": 0, 345 | "columns": 0, 346 | "fieldname": "column_break_6", 347 | "fieldtype": "Column Break", 348 | "hidden": 0, 349 | "ignore_user_permissions": 0, 350 | "ignore_xss_filter": 0, 351 | "in_filter": 0, 352 | "in_global_search": 0, 353 | "in_list_view": 0, 354 | "in_standard_filter": 0, 355 | "length": 0, 356 | "no_copy": 0, 357 | "permlevel": 0, 358 | "precision": "", 359 | "print_hide": 0, 360 | "print_hide_if_no_value": 0, 361 | "read_only": 0, 362 | "remember_last_selected_value": 0, 363 | "report_hide": 0, 364 | "reqd": 0, 365 | "search_index": 0, 366 | "set_only_once": 0, 367 | "translatable": 0, 368 | "unique": 0 369 | }, 370 | { 371 | "allow_bulk_edit": 0, 372 | "allow_in_quick_entry": 0, 373 | "allow_on_submit": 0, 374 | "bold": 0, 375 | "collapsible": 0, 376 | "columns": 0, 377 | "fieldname": "ternary_plot", 378 | "fieldtype": "HTML", 379 | "hidden": 0, 380 | "ignore_user_permissions": 0, 381 | "ignore_xss_filter": 0, 382 | "in_filter": 0, 383 | "in_global_search": 0, 384 | "in_list_view": 0, 385 | "in_standard_filter": 0, 386 | "label": "Ternary Plot", 387 | "length": 0, 388 | "no_copy": 0, 389 | "permlevel": 0, 390 | "precision": "", 391 | "print_hide": 0, 392 | "print_hide_if_no_value": 0, 393 | "read_only": 0, 394 | "remember_last_selected_value": 0, 395 | "report_hide": 0, 396 | "reqd": 0, 397 | "search_index": 0, 398 | "set_only_once": 0, 399 | "translatable": 0, 400 | "unique": 0 401 | }, 402 | { 403 | "allow_bulk_edit": 0, 404 | "allow_in_quick_entry": 0, 405 | "allow_on_submit": 0, 406 | "bold": 0, 407 | "collapsible": 0, 408 | "columns": 0, 409 | "fieldname": "section_break_15", 410 | "fieldtype": "Section Break", 411 | "hidden": 0, 412 | "ignore_user_permissions": 0, 413 | "ignore_xss_filter": 0, 414 | "in_filter": 0, 415 | "in_global_search": 0, 416 | "in_list_view": 0, 417 | "in_standard_filter": 0, 418 | "label": "Soil Texture Criteria", 419 | "length": 0, 420 | "no_copy": 0, 421 | "permlevel": 0, 422 | "precision": "", 423 | "print_hide": 0, 424 | "print_hide_if_no_value": 0, 425 | "read_only": 0, 426 | "remember_last_selected_value": 0, 427 | "report_hide": 0, 428 | "reqd": 0, 429 | "search_index": 0, 430 | "set_only_once": 0, 431 | "translatable": 0, 432 | "unique": 0 433 | }, 434 | { 435 | "allow_bulk_edit": 0, 436 | "allow_in_quick_entry": 0, 437 | "allow_on_submit": 0, 438 | "bold": 0, 439 | "collapsible": 0, 440 | "columns": 0, 441 | "fieldname": "soil_texture_criteria", 442 | "fieldtype": "Table", 443 | "hidden": 0, 444 | "ignore_user_permissions": 0, 445 | "ignore_xss_filter": 0, 446 | "in_filter": 0, 447 | "in_global_search": 0, 448 | "in_list_view": 0, 449 | "in_standard_filter": 0, 450 | "length": 0, 451 | "no_copy": 0, 452 | "options": "Soil Texture Criteria", 453 | "permlevel": 0, 454 | "precision": "", 455 | "print_hide": 0, 456 | "print_hide_if_no_value": 0, 457 | "read_only": 0, 458 | "remember_last_selected_value": 0, 459 | "report_hide": 0, 460 | "reqd": 0, 461 | "search_index": 0, 462 | "set_only_once": 0, 463 | "translatable": 0, 464 | "unique": 0 465 | } 466 | ], 467 | "has_web_view": 0, 468 | "hide_heading": 0, 469 | "hide_toolbar": 0, 470 | "idx": 0, 471 | "image_view": 0, 472 | "in_create": 0, 473 | "is_submittable": 0, 474 | "issingle": 0, 475 | "istable": 0, 476 | "max_attachments": 0, 477 | "modified": "2018-11-04 03:29:18.221173", 478 | "modified_by": "Administrator", 479 | "module": "Agriculture", 480 | "name": "Soil Texture", 481 | "name_case": "", 482 | "owner": "Administrator", 483 | "permissions": [ 484 | { 485 | "amend": 0, 486 | "cancel": 0, 487 | "create": 1, 488 | "delete": 1, 489 | "email": 1, 490 | "export": 1, 491 | "if_owner": 0, 492 | "import": 0, 493 | "permlevel": 0, 494 | "print": 1, 495 | "read": 1, 496 | "report": 1, 497 | "role": "Agriculture Manager", 498 | "set_user_permissions": 0, 499 | "share": 1, 500 | "submit": 0, 501 | "write": 1 502 | }, 503 | { 504 | "amend": 0, 505 | "cancel": 0, 506 | "create": 0, 507 | "delete": 0, 508 | "email": 1, 509 | "export": 1, 510 | "if_owner": 0, 511 | "import": 0, 512 | "permlevel": 0, 513 | "print": 1, 514 | "read": 1, 515 | "report": 1, 516 | "role": "Agriculture User", 517 | "set_user_permissions": 0, 518 | "share": 1, 519 | "submit": 0, 520 | "write": 1 521 | } 522 | ], 523 | "quick_entry": 0, 524 | "read_only": 0, 525 | "read_only_onload": 0, 526 | "restrict_to_domain": "Agriculture", 527 | "show_name_in_global_search": 0, 528 | "sort_field": "modified", 529 | "sort_order": "DESC", 530 | "track_changes": 1, 531 | "track_seen": 0, 532 | "track_views": 0 533 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture/soil_texture.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe import _ 7 | from frappe.model.document import Document 8 | from frappe.utils import cint, flt 9 | 10 | 11 | class SoilTexture(Document): 12 | soil_edit_order = [2, 1, 0] 13 | soil_types = ['clay_composition', 'sand_composition', 'silt_composition'] 14 | 15 | @frappe.whitelist() 16 | def load_contents(self): 17 | docs = frappe.get_all("Agriculture Analysis Criteria", filters={'linked_doctype':'Soil Texture'}) 18 | for doc in docs: 19 | self.append('soil_texture_criteria', {'title': str(doc.name)}) 20 | 21 | def validate(self): 22 | self.update_soil_edit('sand_composition') 23 | for soil_type in self.soil_types: 24 | if self.get(soil_type) > 100 or self.get(soil_type) < 0: 25 | frappe.throw(_("{0} should be a value between 0 and 100").format(soil_type)) 26 | if sum(self.get(soil_type) for soil_type in self.soil_types) != 100: 27 | frappe.throw(_('Soil compositions do not add up to 100')) 28 | 29 | @frappe.whitelist() 30 | def update_soil_edit(self, soil_type): 31 | self.soil_edit_order[self.soil_types.index(soil_type)] = max(self.soil_edit_order)+1 32 | self.soil_type = self.get_soil_type() 33 | 34 | def get_soil_type(self): 35 | # update the last edited soil type 36 | if sum(self.soil_edit_order) < 5: return 37 | last_edit_index = self.soil_edit_order.index(min(self.soil_edit_order)) 38 | 39 | # set composition of the last edited soil 40 | self.set(self.soil_types[last_edit_index], 41 | 100 - sum(cint(self.get(soil_type)) for soil_type in self.soil_types) + cint(self.get(self.soil_types[last_edit_index]))) 42 | 43 | # calculate soil type 44 | c, sa, si = flt(self.clay_composition), flt(self.sand_composition), flt(self.silt_composition) 45 | 46 | if si + (1.5 * c) < 15: 47 | return 'Sand' 48 | elif si + 1.5 * c >= 15 and si + 2 * c < 30: 49 | return 'Loamy Sand' 50 | elif ((c >= 7 and c < 20) or (sa > 52) and ((si + 2*c) >= 30) or (c < 7 and si < 50 and (si+2*c) >= 30)): 51 | return 'Sandy Loam' 52 | elif ((c >= 7 and c < 27) and (si >= 28 and si < 50) and (sa <= 52)): 53 | return 'Loam' 54 | elif ((si >= 50 and (c >= 12 and c < 27)) or ((si >= 50 and si < 80) and c < 12)): 55 | return 'Silt Loam' 56 | elif (si >= 80 and c < 12): 57 | return 'Silt' 58 | elif ((c >= 20 and c < 35) and (si < 28) and (sa > 45)): 59 | return 'Sandy Clay Loam' 60 | elif ((c >= 27 and c < 40) and (sa > 20 and sa <= 45)): 61 | return 'Clay Loam' 62 | elif ((c >= 27 and c < 40) and (sa <= 20)): 63 | return 'Silty Clay Loam' 64 | elif (c >= 35 and sa > 45): 65 | return 'Sandy Clay' 66 | elif (c >= 40 and si >= 40): 67 | return 'Silty Clay' 68 | elif (c >= 40 and sa <= 45 and si < 40): 69 | return 'Clay' 70 | else: 71 | return 'Select' 72 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture/test_records.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "doctype": "Soil Texture", 4 | "location": "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[72.861242,19.079153]}}]}", 5 | "collection_datetime": "2017-11-08", 6 | "clay_composition": 20, 7 | "sand_composition": 30 8 | } 9 | ] -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture/test_soil_texture.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // rename this file from _test_[name] to test_[name] to activate 3 | // and remove above this line 4 | 5 | QUnit.test("test: Soil Texture", function (assert) { 6 | let done = assert.async(); 7 | 8 | // number of asserts 9 | assert.expect(2); 10 | 11 | frappe.run_serially([ 12 | // insert a new Soil Texture 13 | () => frappe.tests.make('Soil Texture', [ 14 | // values to be set 15 | {location: '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[72.882185,19.076395]}}]}'}, 16 | {collection_datetime: '2017-11-08'}, 17 | {clay_composition: 20}, 18 | {sand_composition: 30} 19 | ]), 20 | () => { 21 | assert.equal(cur_frm.doc.silt_composition, 50); 22 | assert.equal(cur_frm.doc.soil_type, 'Silt Loam'); 23 | }, 24 | () => done() 25 | ]); 26 | }); 27 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture/test_soil_texture.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | import frappe 7 | 8 | 9 | class TestSoilTexture(unittest.TestCase): 10 | def test_texture_selection(self): 11 | soil_tex = frappe.get_all('Soil Texture', fields=['name'], filters={'collection_datetime': '2017-11-08'}) 12 | doc = frappe.get_doc('Soil Texture', soil_tex[0].name) 13 | self.assertEqual(doc.silt_composition, 50) 14 | self.assertEqual(doc.soil_type, 'Silt Loam') 15 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture_criteria/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/soil_texture_criteria/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-12-05 23:45:17.419610", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "title", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Title", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Agriculture Analysis Criteria", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "value", 57 | "fieldtype": "Data", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 1, 64 | "in_standard_filter": 0, 65 | "label": "Value", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "minimum_permissible_value", 89 | "fieldtype": "Data", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Minimum Permissible Value", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 0, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "maximum_permissible_value", 121 | "fieldtype": "Data", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 1, 128 | "in_standard_filter": 0, 129 | "label": "Maximum Permissible Value", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | } 145 | ], 146 | "has_web_view": 0, 147 | "hide_heading": 0, 148 | "hide_toolbar": 0, 149 | "idx": 0, 150 | "image_view": 0, 151 | "in_create": 0, 152 | "is_submittable": 0, 153 | "issingle": 0, 154 | "istable": 1, 155 | "max_attachments": 0, 156 | "modified": "2018-11-04 03:26:46.178377", 157 | "modified_by": "Administrator", 158 | "module": "Agriculture", 159 | "name": "Soil Texture Criteria", 160 | "name_case": "", 161 | "owner": "Administrator", 162 | "permissions": [], 163 | "quick_entry": 1, 164 | "read_only": 0, 165 | "read_only_onload": 0, 166 | "restrict_to_domain": "Agriculture", 167 | "show_name_in_global_search": 0, 168 | "sort_field": "modified", 169 | "sort_order": "DESC", 170 | "track_changes": 1, 171 | "track_seen": 0, 172 | "track_views": 0 173 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/soil_texture_criteria/soil_texture_criteria.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class SoilTextureCriteria(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/water_analysis/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis/test_water_analysis.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // rename this file from _test_[name] to test_[name] to activate 3 | // and remove above this line 4 | 5 | QUnit.test("test: Water Analysis", function (assert) { 6 | let done = assert.async(); 7 | 8 | // number of asserts 9 | assert.expect(1); 10 | 11 | frappe.run_serially([ 12 | // insert a new Water Analysis 13 | () => frappe.tests.make('Water Analysis', [ 14 | // values to be set 15 | {location: '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[72.882185,19.076395]}}]}'}, 16 | {collection_datetime: '2017-11-08 18:43:57'}, 17 | {laboratory_testing_datetime: '2017-11-10 18:43:57'} 18 | ]), 19 | () => { 20 | assert.equal(cur_frm.doc.result_datetime, '2017-11-10 18:43:57'); 21 | }, 22 | () => done() 23 | ]); 24 | 25 | }); 26 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis/test_water_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | 7 | class TestWaterAnalysis(unittest.TestCase): 8 | pass 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis/water_analysis.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Water Analysis', { 5 | onload: (frm) => { 6 | if (frm.doc.water_analysis_criteria == undefined) frm.call('load_contents'); 7 | }, 8 | refresh: (frm) => { 9 | let map_tools = ["a.leaflet-draw-draw-polyline", 10 | "a.leaflet-draw-draw-polygon", 11 | "a.leaflet-draw-draw-rectangle", 12 | "a.leaflet-draw-draw-circle", 13 | "a.leaflet-draw-draw-circlemarker"]; 14 | 15 | map_tools.forEach((element) => $(element).hide()); 16 | }, 17 | laboratory_testing_datetime: (frm) => frm.call("update_lab_result_date") 18 | }); 19 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis/water_analysis.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "HR-WAT-.YYYY.-.#####", 8 | "beta": 0, 9 | "creation": "2017-10-17 18:51:19.946950", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "location", 25 | "fieldtype": "Geolocation", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 1, 32 | "in_standard_filter": 0, 33 | "label": "Location", 34 | "length": 0, 35 | "no_copy": 0, 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "column_break_2", 57 | "fieldtype": "Column Break", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 0, 64 | "in_standard_filter": 0, 65 | "label": "", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "collection_datetime", 89 | "fieldtype": "Datetime", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Collection Datetime", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 1, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "laboratory_testing_datetime", 121 | "fieldtype": "Datetime", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 0, 128 | "in_standard_filter": 0, 129 | "label": "Laboratory Testing Datetime", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | }, 145 | { 146 | "allow_bulk_edit": 0, 147 | "allow_in_quick_entry": 0, 148 | "allow_on_submit": 0, 149 | "bold": 0, 150 | "collapsible": 0, 151 | "columns": 0, 152 | "fieldname": "result_datetime", 153 | "fieldtype": "Datetime", 154 | "hidden": 0, 155 | "ignore_user_permissions": 0, 156 | "ignore_xss_filter": 0, 157 | "in_filter": 0, 158 | "in_global_search": 0, 159 | "in_list_view": 0, 160 | "in_standard_filter": 0, 161 | "label": "Result Datetime", 162 | "length": 0, 163 | "no_copy": 0, 164 | "permlevel": 0, 165 | "precision": "", 166 | "print_hide": 0, 167 | "print_hide_if_no_value": 0, 168 | "read_only": 0, 169 | "remember_last_selected_value": 0, 170 | "report_hide": 0, 171 | "reqd": 0, 172 | "search_index": 0, 173 | "set_only_once": 0, 174 | "translatable": 0, 175 | "unique": 0 176 | }, 177 | { 178 | "allow_bulk_edit": 0, 179 | "allow_in_quick_entry": 0, 180 | "allow_on_submit": 0, 181 | "bold": 0, 182 | "collapsible": 0, 183 | "columns": 0, 184 | "fieldname": "section_break_4", 185 | "fieldtype": "Section Break", 186 | "hidden": 0, 187 | "ignore_user_permissions": 0, 188 | "ignore_xss_filter": 0, 189 | "in_filter": 0, 190 | "in_global_search": 0, 191 | "in_list_view": 0, 192 | "in_standard_filter": 0, 193 | "length": 0, 194 | "no_copy": 0, 195 | "permlevel": 0, 196 | "precision": "", 197 | "print_hide": 0, 198 | "print_hide_if_no_value": 0, 199 | "read_only": 0, 200 | "remember_last_selected_value": 0, 201 | "report_hide": 0, 202 | "reqd": 0, 203 | "search_index": 0, 204 | "set_only_once": 0, 205 | "translatable": 0, 206 | "unique": 0 207 | }, 208 | { 209 | "allow_bulk_edit": 0, 210 | "allow_in_quick_entry": 0, 211 | "allow_on_submit": 0, 212 | "bold": 0, 213 | "collapsible": 0, 214 | "columns": 0, 215 | "fieldname": "type_of_sample", 216 | "fieldtype": "Data", 217 | "hidden": 0, 218 | "ignore_user_permissions": 0, 219 | "ignore_xss_filter": 0, 220 | "in_filter": 0, 221 | "in_global_search": 0, 222 | "in_list_view": 0, 223 | "in_standard_filter": 0, 224 | "label": "Type of Sample", 225 | "length": 0, 226 | "no_copy": 0, 227 | "permlevel": 0, 228 | "precision": "", 229 | "print_hide": 0, 230 | "print_hide_if_no_value": 0, 231 | "read_only": 0, 232 | "remember_last_selected_value": 0, 233 | "report_hide": 0, 234 | "reqd": 0, 235 | "search_index": 0, 236 | "set_only_once": 0, 237 | "translatable": 0, 238 | "unique": 0 239 | }, 240 | { 241 | "allow_bulk_edit": 0, 242 | "allow_in_quick_entry": 0, 243 | "allow_on_submit": 0, 244 | "bold": 0, 245 | "collapsible": 0, 246 | "columns": 0, 247 | "fieldname": "container", 248 | "fieldtype": "Data", 249 | "hidden": 0, 250 | "ignore_user_permissions": 0, 251 | "ignore_xss_filter": 0, 252 | "in_filter": 0, 253 | "in_global_search": 0, 254 | "in_list_view": 0, 255 | "in_standard_filter": 0, 256 | "label": "Container", 257 | "length": 0, 258 | "no_copy": 0, 259 | "permlevel": 0, 260 | "precision": "", 261 | "print_hide": 0, 262 | "print_hide_if_no_value": 0, 263 | "read_only": 0, 264 | "remember_last_selected_value": 0, 265 | "report_hide": 0, 266 | "reqd": 0, 267 | "search_index": 0, 268 | "set_only_once": 0, 269 | "translatable": 0, 270 | "unique": 0 271 | }, 272 | { 273 | "allow_bulk_edit": 0, 274 | "allow_in_quick_entry": 0, 275 | "allow_on_submit": 0, 276 | "bold": 0, 277 | "collapsible": 0, 278 | "columns": 0, 279 | "fieldname": "origin", 280 | "fieldtype": "Data", 281 | "hidden": 0, 282 | "ignore_user_permissions": 0, 283 | "ignore_xss_filter": 0, 284 | "in_filter": 0, 285 | "in_global_search": 0, 286 | "in_list_view": 0, 287 | "in_standard_filter": 0, 288 | "label": "Origin", 289 | "length": 0, 290 | "no_copy": 0, 291 | "permlevel": 0, 292 | "precision": "", 293 | "print_hide": 0, 294 | "print_hide_if_no_value": 0, 295 | "read_only": 0, 296 | "remember_last_selected_value": 0, 297 | "report_hide": 0, 298 | "reqd": 0, 299 | "search_index": 0, 300 | "set_only_once": 0, 301 | "translatable": 0, 302 | "unique": 0 303 | }, 304 | { 305 | "allow_bulk_edit": 0, 306 | "allow_in_quick_entry": 0, 307 | "allow_on_submit": 0, 308 | "bold": 0, 309 | "collapsible": 0, 310 | "columns": 0, 311 | "fieldname": "column_break_8", 312 | "fieldtype": "Column Break", 313 | "hidden": 0, 314 | "ignore_user_permissions": 0, 315 | "ignore_xss_filter": 0, 316 | "in_filter": 0, 317 | "in_global_search": 0, 318 | "in_list_view": 0, 319 | "in_standard_filter": 0, 320 | "length": 0, 321 | "no_copy": 0, 322 | "permlevel": 0, 323 | "precision": "", 324 | "print_hide": 0, 325 | "print_hide_if_no_value": 0, 326 | "read_only": 0, 327 | "remember_last_selected_value": 0, 328 | "report_hide": 0, 329 | "reqd": 0, 330 | "search_index": 0, 331 | "set_only_once": 0, 332 | "translatable": 0, 333 | "unique": 0 334 | }, 335 | { 336 | "allow_bulk_edit": 0, 337 | "allow_in_quick_entry": 0, 338 | "allow_on_submit": 0, 339 | "bold": 0, 340 | "collapsible": 0, 341 | "columns": 0, 342 | "fieldname": "collection_temperature", 343 | "fieldtype": "Data", 344 | "hidden": 0, 345 | "ignore_user_permissions": 0, 346 | "ignore_xss_filter": 0, 347 | "in_filter": 0, 348 | "in_global_search": 0, 349 | "in_list_view": 0, 350 | "in_standard_filter": 0, 351 | "label": "Collection Temperature ", 352 | "length": 0, 353 | "no_copy": 0, 354 | "permlevel": 0, 355 | "precision": "", 356 | "print_hide": 0, 357 | "print_hide_if_no_value": 0, 358 | "read_only": 0, 359 | "remember_last_selected_value": 0, 360 | "report_hide": 0, 361 | "reqd": 0, 362 | "search_index": 0, 363 | "set_only_once": 0, 364 | "translatable": 0, 365 | "unique": 0 366 | }, 367 | { 368 | "allow_bulk_edit": 0, 369 | "allow_in_quick_entry": 0, 370 | "allow_on_submit": 0, 371 | "bold": 0, 372 | "collapsible": 0, 373 | "columns": 0, 374 | "fieldname": "storage_temperature", 375 | "fieldtype": "Data", 376 | "hidden": 0, 377 | "ignore_user_permissions": 0, 378 | "ignore_xss_filter": 0, 379 | "in_filter": 0, 380 | "in_global_search": 0, 381 | "in_list_view": 0, 382 | "in_standard_filter": 0, 383 | "label": "Storage Temperature", 384 | "length": 0, 385 | "no_copy": 0, 386 | "permlevel": 0, 387 | "precision": "", 388 | "print_hide": 0, 389 | "print_hide_if_no_value": 0, 390 | "read_only": 0, 391 | "remember_last_selected_value": 0, 392 | "report_hide": 0, 393 | "reqd": 0, 394 | "search_index": 0, 395 | "set_only_once": 0, 396 | "translatable": 0, 397 | "unique": 0 398 | }, 399 | { 400 | "allow_bulk_edit": 0, 401 | "allow_in_quick_entry": 0, 402 | "allow_on_submit": 0, 403 | "bold": 0, 404 | "collapsible": 0, 405 | "columns": 0, 406 | "fieldname": "appearance", 407 | "fieldtype": "Data", 408 | "hidden": 0, 409 | "ignore_user_permissions": 0, 410 | "ignore_xss_filter": 0, 411 | "in_filter": 0, 412 | "in_global_search": 0, 413 | "in_list_view": 0, 414 | "in_standard_filter": 0, 415 | "label": "Appearance", 416 | "length": 0, 417 | "no_copy": 0, 418 | "permlevel": 0, 419 | "precision": "", 420 | "print_hide": 0, 421 | "print_hide_if_no_value": 0, 422 | "read_only": 0, 423 | "remember_last_selected_value": 0, 424 | "report_hide": 0, 425 | "reqd": 0, 426 | "search_index": 0, 427 | "set_only_once": 0, 428 | "translatable": 0, 429 | "unique": 0 430 | }, 431 | { 432 | "allow_bulk_edit": 0, 433 | "allow_in_quick_entry": 0, 434 | "allow_on_submit": 0, 435 | "bold": 0, 436 | "collapsible": 0, 437 | "columns": 0, 438 | "fieldname": "person_responsible", 439 | "fieldtype": "Data", 440 | "hidden": 0, 441 | "ignore_user_permissions": 0, 442 | "ignore_xss_filter": 0, 443 | "in_filter": 0, 444 | "in_global_search": 0, 445 | "in_list_view": 0, 446 | "in_standard_filter": 0, 447 | "label": "Person Responsible", 448 | "length": 0, 449 | "no_copy": 0, 450 | "permlevel": 0, 451 | "precision": "", 452 | "print_hide": 0, 453 | "print_hide_if_no_value": 0, 454 | "read_only": 0, 455 | "remember_last_selected_value": 0, 456 | "report_hide": 0, 457 | "reqd": 0, 458 | "search_index": 0, 459 | "set_only_once": 0, 460 | "translatable": 0, 461 | "unique": 0 462 | }, 463 | { 464 | "allow_bulk_edit": 0, 465 | "allow_in_quick_entry": 0, 466 | "allow_on_submit": 0, 467 | "bold": 0, 468 | "collapsible": 0, 469 | "columns": 0, 470 | "fieldname": "column_break_29", 471 | "fieldtype": "Section Break", 472 | "hidden": 0, 473 | "ignore_user_permissions": 0, 474 | "ignore_xss_filter": 0, 475 | "in_filter": 0, 476 | "in_global_search": 0, 477 | "in_list_view": 0, 478 | "in_standard_filter": 0, 479 | "label": "Water Analysis Criteria", 480 | "length": 0, 481 | "no_copy": 0, 482 | "permlevel": 0, 483 | "precision": "", 484 | "print_hide": 0, 485 | "print_hide_if_no_value": 0, 486 | "read_only": 0, 487 | "remember_last_selected_value": 0, 488 | "report_hide": 0, 489 | "reqd": 0, 490 | "search_index": 0, 491 | "set_only_once": 0, 492 | "translatable": 0, 493 | "unique": 0 494 | }, 495 | { 496 | "allow_bulk_edit": 0, 497 | "allow_in_quick_entry": 0, 498 | "allow_on_submit": 0, 499 | "bold": 0, 500 | "collapsible": 0, 501 | "columns": 0, 502 | "fieldname": "water_analysis_criteria", 503 | "fieldtype": "Table", 504 | "hidden": 0, 505 | "ignore_user_permissions": 0, 506 | "ignore_xss_filter": 0, 507 | "in_filter": 0, 508 | "in_global_search": 0, 509 | "in_list_view": 0, 510 | "in_standard_filter": 0, 511 | "length": 0, 512 | "no_copy": 0, 513 | "options": "Water Analysis Criteria", 514 | "permlevel": 0, 515 | "precision": "", 516 | "print_hide": 0, 517 | "print_hide_if_no_value": 0, 518 | "read_only": 0, 519 | "remember_last_selected_value": 0, 520 | "report_hide": 0, 521 | "reqd": 0, 522 | "search_index": 0, 523 | "set_only_once": 0, 524 | "translatable": 0, 525 | "unique": 0 526 | } 527 | ], 528 | "has_web_view": 0, 529 | "hide_heading": 0, 530 | "hide_toolbar": 0, 531 | "idx": 0, 532 | "image_view": 0, 533 | "in_create": 0, 534 | "is_submittable": 0, 535 | "issingle": 0, 536 | "istable": 0, 537 | "max_attachments": 0, 538 | "modified": "2018-11-04 03:29:08.325644", 539 | "modified_by": "Administrator", 540 | "module": "Agriculture", 541 | "name": "Water Analysis", 542 | "name_case": "", 543 | "owner": "Administrator", 544 | "permissions": [ 545 | { 546 | "amend": 0, 547 | "cancel": 0, 548 | "create": 1, 549 | "delete": 1, 550 | "email": 1, 551 | "export": 1, 552 | "if_owner": 0, 553 | "import": 0, 554 | "permlevel": 0, 555 | "print": 1, 556 | "read": 1, 557 | "report": 1, 558 | "role": "Agriculture Manager", 559 | "set_user_permissions": 0, 560 | "share": 1, 561 | "submit": 0, 562 | "write": 1 563 | }, 564 | { 565 | "amend": 0, 566 | "cancel": 0, 567 | "create": 0, 568 | "delete": 0, 569 | "email": 1, 570 | "export": 1, 571 | "if_owner": 0, 572 | "import": 0, 573 | "permlevel": 0, 574 | "print": 1, 575 | "read": 1, 576 | "report": 1, 577 | "role": "Agriculture User", 578 | "set_user_permissions": 0, 579 | "share": 1, 580 | "submit": 0, 581 | "write": 1 582 | } 583 | ], 584 | "quick_entry": 0, 585 | "read_only": 0, 586 | "read_only_onload": 0, 587 | "restrict_to_domain": "Agriculture", 588 | "show_name_in_global_search": 0, 589 | "sort_field": "modified", 590 | "sort_order": "DESC", 591 | "track_changes": 1, 592 | "track_seen": 0, 593 | "track_views": 0 594 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis/water_analysis.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe import _ 7 | from frappe.model.document import Document 8 | 9 | 10 | class WaterAnalysis(Document): 11 | @frappe.whitelist() 12 | def load_contents(self): 13 | docs = frappe.get_all("Agriculture Analysis Criteria", filters={'linked_doctype':'Water Analysis'}) 14 | for doc in docs: 15 | self.append('water_analysis_criteria', {'title': str(doc.name)}) 16 | 17 | @frappe.whitelist() 18 | def update_lab_result_date(self): 19 | if not self.result_datetime: 20 | self.result_datetime = self.laboratory_testing_datetime 21 | 22 | def validate(self): 23 | if self.collection_datetime > self.laboratory_testing_datetime: 24 | frappe.throw(_('Lab testing datetime cannot be before collection datetime')) 25 | if self.laboratory_testing_datetime > self.result_datetime: 26 | frappe.throw(_('Lab result datetime cannot be before testing datetime')) 27 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis_criteria/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/water_analysis_criteria/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-12-05 23:36:22.723558", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "title", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Title", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Agriculture Analysis Criteria", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "value", 57 | "fieldtype": "Data", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 1, 64 | "in_standard_filter": 0, 65 | "label": "Value", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "minimum_permissible_value", 89 | "fieldtype": "Data", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Minimum Permissible Value", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 0, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "maximum_permissible_value", 121 | "fieldtype": "Data", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 1, 128 | "in_standard_filter": 0, 129 | "label": "Maximum Permissible Value", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | } 145 | ], 146 | "has_web_view": 0, 147 | "hide_heading": 0, 148 | "hide_toolbar": 0, 149 | "idx": 0, 150 | "image_view": 0, 151 | "in_create": 0, 152 | "is_submittable": 0, 153 | "issingle": 0, 154 | "istable": 1, 155 | "max_attachments": 0, 156 | "modified": "2018-11-04 03:26:07.026834", 157 | "modified_by": "Administrator", 158 | "module": "Agriculture", 159 | "name": "Water Analysis Criteria", 160 | "name_case": "", 161 | "owner": "Administrator", 162 | "permissions": [], 163 | "quick_entry": 1, 164 | "read_only": 0, 165 | "read_only_onload": 0, 166 | "restrict_to_domain": "Agriculture", 167 | "show_name_in_global_search": 0, 168 | "sort_field": "modified", 169 | "sort_order": "DESC", 170 | "track_changes": 1, 171 | "track_seen": 0, 172 | "track_views": 0 173 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/water_analysis_criteria/water_analysis_criteria.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class WaterAnalysisCriteria(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/weather/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather/test_weather.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors 2 | # See license.txt 3 | 4 | import unittest 5 | 6 | 7 | class TestWeather(unittest.TestCase): 8 | pass 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather/weather.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on('Weather', { 5 | onload: (frm) => { 6 | if (frm.doc.weather_parameter == undefined) frm.call('load_contents'); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather/weather.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "autoname": "format:WEA-{date}-{location}", 8 | "beta": 0, 9 | "creation": "2017-10-17 19:01:05.095598", 10 | "custom": 0, 11 | "docstatus": 0, 12 | "doctype": "DocType", 13 | "document_type": "", 14 | "editable_grid": 1, 15 | "engine": "InnoDB", 16 | "fields": [ 17 | { 18 | "allow_bulk_edit": 0, 19 | "allow_in_quick_entry": 0, 20 | "allow_on_submit": 0, 21 | "bold": 0, 22 | "collapsible": 0, 23 | "columns": 0, 24 | "fieldname": "location", 25 | "fieldtype": "Link", 26 | "hidden": 0, 27 | "ignore_user_permissions": 0, 28 | "ignore_xss_filter": 0, 29 | "in_filter": 0, 30 | "in_global_search": 0, 31 | "in_list_view": 0, 32 | "in_standard_filter": 0, 33 | "label": "Location", 34 | "length": 0, 35 | "no_copy": 0, 36 | "options": "Location", 37 | "permlevel": 0, 38 | "precision": "", 39 | "print_hide": 0, 40 | "print_hide_if_no_value": 0, 41 | "read_only": 0, 42 | "remember_last_selected_value": 0, 43 | "report_hide": 0, 44 | "reqd": 0, 45 | "search_index": 0, 46 | "set_only_once": 0, 47 | "translatable": 0, 48 | "unique": 0 49 | }, 50 | { 51 | "allow_bulk_edit": 0, 52 | "allow_in_quick_entry": 0, 53 | "allow_on_submit": 0, 54 | "bold": 0, 55 | "collapsible": 0, 56 | "columns": 0, 57 | "fieldname": "column_break_2", 58 | "fieldtype": "Column Break", 59 | "hidden": 0, 60 | "ignore_user_permissions": 0, 61 | "ignore_xss_filter": 0, 62 | "in_filter": 0, 63 | "in_global_search": 0, 64 | "in_list_view": 0, 65 | "in_standard_filter": 0, 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "date", 89 | "fieldtype": "Date", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Date", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 1, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "source", 121 | "fieldtype": "Data", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 0, 128 | "in_standard_filter": 0, 129 | "label": "Source", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | }, 145 | { 146 | "allow_bulk_edit": 0, 147 | "allow_in_quick_entry": 0, 148 | "allow_on_submit": 0, 149 | "bold": 0, 150 | "collapsible": 0, 151 | "columns": 0, 152 | "fieldname": "section_break_3", 153 | "fieldtype": "Section Break", 154 | "hidden": 0, 155 | "ignore_user_permissions": 0, 156 | "ignore_xss_filter": 0, 157 | "in_filter": 0, 158 | "in_global_search": 0, 159 | "in_list_view": 0, 160 | "in_standard_filter": 0, 161 | "length": 0, 162 | "no_copy": 0, 163 | "permlevel": 0, 164 | "precision": "", 165 | "print_hide": 0, 166 | "print_hide_if_no_value": 0, 167 | "read_only": 0, 168 | "remember_last_selected_value": 0, 169 | "report_hide": 0, 170 | "reqd": 0, 171 | "search_index": 0, 172 | "set_only_once": 0, 173 | "translatable": 0, 174 | "unique": 0 175 | }, 176 | { 177 | "allow_bulk_edit": 0, 178 | "allow_in_quick_entry": 0, 179 | "allow_on_submit": 0, 180 | "bold": 0, 181 | "collapsible": 0, 182 | "columns": 0, 183 | "fieldname": "section_break_9", 184 | "fieldtype": "Section Break", 185 | "hidden": 0, 186 | "ignore_user_permissions": 0, 187 | "ignore_xss_filter": 0, 188 | "in_filter": 0, 189 | "in_global_search": 0, 190 | "in_list_view": 0, 191 | "in_standard_filter": 0, 192 | "label": "Weather Parameter", 193 | "length": 0, 194 | "no_copy": 0, 195 | "permlevel": 0, 196 | "precision": "", 197 | "print_hide": 0, 198 | "print_hide_if_no_value": 0, 199 | "read_only": 0, 200 | "remember_last_selected_value": 0, 201 | "report_hide": 0, 202 | "reqd": 0, 203 | "search_index": 0, 204 | "set_only_once": 0, 205 | "translatable": 0, 206 | "unique": 0 207 | }, 208 | { 209 | "allow_bulk_edit": 0, 210 | "allow_in_quick_entry": 0, 211 | "allow_on_submit": 0, 212 | "bold": 0, 213 | "collapsible": 0, 214 | "columns": 0, 215 | "fieldname": "weather_parameter", 216 | "fieldtype": "Table", 217 | "hidden": 0, 218 | "ignore_user_permissions": 0, 219 | "ignore_xss_filter": 0, 220 | "in_filter": 0, 221 | "in_global_search": 0, 222 | "in_list_view": 0, 223 | "in_standard_filter": 0, 224 | "length": 0, 225 | "no_copy": 0, 226 | "options": "Weather Parameter", 227 | "permlevel": 0, 228 | "precision": "", 229 | "print_hide": 0, 230 | "print_hide_if_no_value": 0, 231 | "read_only": 0, 232 | "remember_last_selected_value": 0, 233 | "report_hide": 0, 234 | "reqd": 0, 235 | "search_index": 0, 236 | "set_only_once": 0, 237 | "translatable": 0, 238 | "unique": 0 239 | } 240 | ], 241 | "has_web_view": 0, 242 | "hide_heading": 0, 243 | "hide_toolbar": 0, 244 | "idx": 0, 245 | "image_view": 0, 246 | "in_create": 0, 247 | "is_submittable": 0, 248 | "issingle": 0, 249 | "istable": 0, 250 | "max_attachments": 0, 251 | "modified": "2018-11-04 03:31:36.839743", 252 | "modified_by": "Administrator", 253 | "module": "Agriculture", 254 | "name": "Weather", 255 | "name_case": "", 256 | "owner": "Administrator", 257 | "permissions": [ 258 | { 259 | "amend": 0, 260 | "cancel": 0, 261 | "create": 1, 262 | "delete": 1, 263 | "email": 1, 264 | "export": 1, 265 | "if_owner": 0, 266 | "import": 0, 267 | "permlevel": 0, 268 | "print": 1, 269 | "read": 1, 270 | "report": 1, 271 | "role": "Agriculture Manager", 272 | "set_user_permissions": 0, 273 | "share": 1, 274 | "submit": 0, 275 | "write": 1 276 | }, 277 | { 278 | "amend": 0, 279 | "cancel": 0, 280 | "create": 0, 281 | "delete": 0, 282 | "email": 1, 283 | "export": 1, 284 | "if_owner": 0, 285 | "import": 0, 286 | "permlevel": 0, 287 | "print": 1, 288 | "read": 1, 289 | "report": 1, 290 | "role": "Agriculture User", 291 | "set_user_permissions": 0, 292 | "share": 1, 293 | "submit": 0, 294 | "write": 1 295 | } 296 | ], 297 | "quick_entry": 0, 298 | "read_only": 0, 299 | "read_only_onload": 0, 300 | "restrict_to_domain": "Agriculture", 301 | "show_name_in_global_search": 0, 302 | "sort_field": "modified", 303 | "sort_order": "DESC", 304 | "track_changes": 1, 305 | "track_seen": 0, 306 | "track_views": 0 307 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather/weather.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | import frappe 6 | from frappe.model.document import Document 7 | 8 | 9 | class Weather(Document): 10 | @frappe.whitelist() 11 | def load_contents(self): 12 | docs = frappe.get_all("Agriculture Analysis Criteria", filters={'linked_doctype':'Weather'}) 13 | for doc in docs: 14 | self.append('weather_parameter', {'title': str(doc.name)}) 15 | -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather_parameter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/agriculture/doctype/weather_parameter/__init__.py -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather_parameter/weather_parameter.json: -------------------------------------------------------------------------------- 1 | { 2 | "allow_copy": 0, 3 | "allow_events_in_timeline": 0, 4 | "allow_guest_to_view": 0, 5 | "allow_import": 0, 6 | "allow_rename": 0, 7 | "beta": 0, 8 | "creation": "2017-12-06 00:19:15.967334", 9 | "custom": 0, 10 | "docstatus": 0, 11 | "doctype": "DocType", 12 | "document_type": "", 13 | "editable_grid": 1, 14 | "engine": "InnoDB", 15 | "fields": [ 16 | { 17 | "allow_bulk_edit": 0, 18 | "allow_in_quick_entry": 0, 19 | "allow_on_submit": 0, 20 | "bold": 0, 21 | "collapsible": 0, 22 | "columns": 0, 23 | "fieldname": "title", 24 | "fieldtype": "Link", 25 | "hidden": 0, 26 | "ignore_user_permissions": 0, 27 | "ignore_xss_filter": 0, 28 | "in_filter": 0, 29 | "in_global_search": 0, 30 | "in_list_view": 1, 31 | "in_standard_filter": 0, 32 | "label": "Title", 33 | "length": 0, 34 | "no_copy": 0, 35 | "options": "Agriculture Analysis Criteria", 36 | "permlevel": 0, 37 | "precision": "", 38 | "print_hide": 0, 39 | "print_hide_if_no_value": 0, 40 | "read_only": 0, 41 | "remember_last_selected_value": 0, 42 | "report_hide": 0, 43 | "reqd": 1, 44 | "search_index": 0, 45 | "set_only_once": 0, 46 | "translatable": 0, 47 | "unique": 0 48 | }, 49 | { 50 | "allow_bulk_edit": 0, 51 | "allow_in_quick_entry": 0, 52 | "allow_on_submit": 0, 53 | "bold": 0, 54 | "collapsible": 0, 55 | "columns": 0, 56 | "fieldname": "value", 57 | "fieldtype": "Data", 58 | "hidden": 0, 59 | "ignore_user_permissions": 0, 60 | "ignore_xss_filter": 0, 61 | "in_filter": 0, 62 | "in_global_search": 0, 63 | "in_list_view": 1, 64 | "in_standard_filter": 0, 65 | "label": "Value", 66 | "length": 0, 67 | "no_copy": 0, 68 | "permlevel": 0, 69 | "precision": "", 70 | "print_hide": 0, 71 | "print_hide_if_no_value": 0, 72 | "read_only": 0, 73 | "remember_last_selected_value": 0, 74 | "report_hide": 0, 75 | "reqd": 0, 76 | "search_index": 0, 77 | "set_only_once": 0, 78 | "translatable": 0, 79 | "unique": 0 80 | }, 81 | { 82 | "allow_bulk_edit": 0, 83 | "allow_in_quick_entry": 0, 84 | "allow_on_submit": 0, 85 | "bold": 0, 86 | "collapsible": 0, 87 | "columns": 0, 88 | "fieldname": "minimum_permissible_value", 89 | "fieldtype": "Data", 90 | "hidden": 0, 91 | "ignore_user_permissions": 0, 92 | "ignore_xss_filter": 0, 93 | "in_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 1, 96 | "in_standard_filter": 0, 97 | "label": "Minimum Permissible Value", 98 | "length": 0, 99 | "no_copy": 0, 100 | "permlevel": 0, 101 | "precision": "", 102 | "print_hide": 0, 103 | "print_hide_if_no_value": 0, 104 | "read_only": 0, 105 | "remember_last_selected_value": 0, 106 | "report_hide": 0, 107 | "reqd": 0, 108 | "search_index": 0, 109 | "set_only_once": 0, 110 | "translatable": 0, 111 | "unique": 0 112 | }, 113 | { 114 | "allow_bulk_edit": 0, 115 | "allow_in_quick_entry": 0, 116 | "allow_on_submit": 0, 117 | "bold": 0, 118 | "collapsible": 0, 119 | "columns": 0, 120 | "fieldname": "maximum_permissible_value", 121 | "fieldtype": "Data", 122 | "hidden": 0, 123 | "ignore_user_permissions": 0, 124 | "ignore_xss_filter": 0, 125 | "in_filter": 0, 126 | "in_global_search": 0, 127 | "in_list_view": 1, 128 | "in_standard_filter": 0, 129 | "label": "Maximum Permissible Value", 130 | "length": 0, 131 | "no_copy": 0, 132 | "permlevel": 0, 133 | "precision": "", 134 | "print_hide": 0, 135 | "print_hide_if_no_value": 0, 136 | "read_only": 0, 137 | "remember_last_selected_value": 0, 138 | "report_hide": 0, 139 | "reqd": 0, 140 | "search_index": 0, 141 | "set_only_once": 0, 142 | "translatable": 0, 143 | "unique": 0 144 | } 145 | ], 146 | "has_web_view": 0, 147 | "hide_heading": 0, 148 | "hide_toolbar": 0, 149 | "idx": 0, 150 | "image_view": 0, 151 | "in_create": 0, 152 | "is_submittable": 0, 153 | "issingle": 0, 154 | "istable": 1, 155 | "max_attachments": 0, 156 | "modified": "2018-11-04 03:26:58.794373", 157 | "modified_by": "Administrator", 158 | "module": "Agriculture", 159 | "name": "Weather Parameter", 160 | "name_case": "", 161 | "owner": "Administrator", 162 | "permissions": [], 163 | "quick_entry": 1, 164 | "read_only": 0, 165 | "read_only_onload": 0, 166 | "restrict_to_domain": "Agriculture", 167 | "show_name_in_global_search": 0, 168 | "sort_field": "modified", 169 | "sort_order": "DESC", 170 | "track_changes": 1, 171 | "track_seen": 0, 172 | "track_views": 0 173 | } -------------------------------------------------------------------------------- /agriculture/agriculture/doctype/weather_parameter/weather_parameter.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors 2 | # For license information, please see license.txt 3 | 4 | 5 | from frappe.model.document import Document 6 | 7 | 8 | class WeatherParameter(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /agriculture/agriculture/setup.py: -------------------------------------------------------------------------------- 1 | import frappe 2 | from frappe import _ 3 | from erpnext.setup.utils import insert_record 4 | 5 | def setup_agriculture(): 6 | if frappe.get_all('Agriculture Analysis Criteria'): 7 | # already setup 8 | return 9 | create_agriculture_data() 10 | add_additional_permissions() 11 | 12 | def create_agriculture_data(): 13 | records = [ 14 | dict( 15 | doctype='Item Group', 16 | item_group_name='Fertilizer', 17 | is_group=0, 18 | parent_item_group=_('All Item Groups')), 19 | dict( 20 | doctype='Item Group', 21 | item_group_name='Seed', 22 | is_group=0, 23 | parent_item_group=_('All Item Groups')), 24 | dict( 25 | doctype='Item Group', 26 | item_group_name='By-product', 27 | is_group=0, 28 | parent_item_group=_('All Item Groups')), 29 | dict( 30 | doctype='Item Group', 31 | item_group_name='Produce', 32 | is_group=0, 33 | parent_item_group=_('All Item Groups')), 34 | dict( 35 | doctype='Agriculture Analysis Criteria', 36 | title='Nitrogen Content', 37 | standard=1, 38 | linked_doctype='Fertilizer'), 39 | dict( 40 | doctype='Agriculture Analysis Criteria', 41 | title='Phosphorous Content', 42 | standard=1, 43 | linked_doctype='Fertilizer'), 44 | dict( 45 | doctype='Agriculture Analysis Criteria', 46 | title='Potassium Content', 47 | standard=1, 48 | linked_doctype='Fertilizer'), 49 | dict( 50 | doctype='Agriculture Analysis Criteria', 51 | title='Calcium Content', 52 | standard=1, 53 | linked_doctype='Fertilizer'), 54 | dict( 55 | doctype='Agriculture Analysis Criteria', 56 | title='Sulphur Content', 57 | standard=1, 58 | linked_doctype='Fertilizer'), 59 | dict( 60 | doctype='Agriculture Analysis Criteria', 61 | title='Magnesium Content', 62 | standard=1, 63 | linked_doctype='Fertilizer'), 64 | dict( 65 | doctype='Agriculture Analysis Criteria', 66 | title='Iron Content', 67 | standard=1, 68 | linked_doctype='Fertilizer'), 69 | dict( 70 | doctype='Agriculture Analysis Criteria', 71 | title='Copper Content', 72 | standard=1, 73 | linked_doctype='Fertilizer'), 74 | dict( 75 | doctype='Agriculture Analysis Criteria', 76 | title='Zinc Content', 77 | standard=1, 78 | linked_doctype='Fertilizer'), 79 | dict( 80 | doctype='Agriculture Analysis Criteria', 81 | title='Boron Content', 82 | standard=1, 83 | linked_doctype='Fertilizer'), 84 | dict( 85 | doctype='Agriculture Analysis Criteria', 86 | title='Manganese Content', 87 | standard=1, 88 | linked_doctype='Fertilizer'), 89 | dict( 90 | doctype='Agriculture Analysis Criteria', 91 | title='Chlorine Content', 92 | standard=1, 93 | linked_doctype='Fertilizer'), 94 | dict( 95 | doctype='Agriculture Analysis Criteria', 96 | title='Molybdenum Content', 97 | standard=1, 98 | linked_doctype='Fertilizer'), 99 | dict( 100 | doctype='Agriculture Analysis Criteria', 101 | title='Sodium Content', 102 | standard=1, 103 | linked_doctype='Fertilizer'), 104 | dict( 105 | doctype='Agriculture Analysis Criteria', 106 | title='Humic Acid', 107 | standard=1, 108 | linked_doctype='Fertilizer'), 109 | dict( 110 | doctype='Agriculture Analysis Criteria', 111 | title='Fulvic Acid', 112 | standard=1, 113 | linked_doctype='Fertilizer'), 114 | dict( 115 | doctype='Agriculture Analysis Criteria', 116 | title='Inert', 117 | standard=1, 118 | linked_doctype='Fertilizer'), 119 | dict( 120 | doctype='Agriculture Analysis Criteria', 121 | title='Others', 122 | standard=1, 123 | linked_doctype='Fertilizer'), 124 | dict( 125 | doctype='Agriculture Analysis Criteria', 126 | title='Nitrogen', 127 | standard=1, 128 | linked_doctype='Plant Analysis'), 129 | dict( 130 | doctype='Agriculture Analysis Criteria', 131 | title='Phosphorous', 132 | standard=1, 133 | linked_doctype='Plant Analysis'), 134 | dict( 135 | doctype='Agriculture Analysis Criteria', 136 | title='Potassium', 137 | standard=1, 138 | linked_doctype='Plant Analysis'), 139 | dict( 140 | doctype='Agriculture Analysis Criteria', 141 | title='Calcium', 142 | standard=1, 143 | linked_doctype='Plant Analysis'), 144 | dict( 145 | doctype='Agriculture Analysis Criteria', 146 | title='Magnesium', 147 | standard=1, 148 | linked_doctype='Plant Analysis'), 149 | dict( 150 | doctype='Agriculture Analysis Criteria', 151 | title='Sulphur', 152 | standard=1, 153 | linked_doctype='Plant Analysis'), 154 | dict( 155 | doctype='Agriculture Analysis Criteria', 156 | title='Boron', 157 | standard=1, 158 | linked_doctype='Plant Analysis'), 159 | dict( 160 | doctype='Agriculture Analysis Criteria', 161 | title='Copper', 162 | standard=1, 163 | linked_doctype='Plant Analysis'), 164 | dict( 165 | doctype='Agriculture Analysis Criteria', 166 | title='Iron', 167 | standard=1, 168 | linked_doctype='Plant Analysis'), 169 | dict( 170 | doctype='Agriculture Analysis Criteria', 171 | title='Manganese', 172 | standard=1, 173 | linked_doctype='Plant Analysis'), 174 | dict( 175 | doctype='Agriculture Analysis Criteria', 176 | title='Zinc', 177 | standard=1, 178 | linked_doctype='Plant Analysis'), 179 | dict( 180 | doctype='Agriculture Analysis Criteria', 181 | title='Depth (in cm)', 182 | standard=1, 183 | linked_doctype='Soil Analysis'), 184 | dict( 185 | doctype='Agriculture Analysis Criteria', 186 | title='Soil pH', 187 | standard=1, 188 | linked_doctype='Soil Analysis'), 189 | dict( 190 | doctype='Agriculture Analysis Criteria', 191 | title='Salt Concentration (%)', 192 | standard=1, 193 | linked_doctype='Soil Analysis'), 194 | dict( 195 | doctype='Agriculture Analysis Criteria', 196 | title='Organic Matter (%)', 197 | standard=1, 198 | linked_doctype='Soil Analysis'), 199 | dict( 200 | doctype='Agriculture Analysis Criteria', 201 | title='CEC (Cation Exchange Capacity) (MAQ/100mL)', 202 | standard=1, 203 | linked_doctype='Soil Analysis'), 204 | dict( 205 | doctype='Agriculture Analysis Criteria', 206 | title='Potassium Saturation (%)', 207 | standard=1, 208 | linked_doctype='Soil Analysis'), 209 | dict( 210 | doctype='Agriculture Analysis Criteria', 211 | title='Calcium Saturation (%)', 212 | standard=1, 213 | linked_doctype='Soil Analysis'), 214 | dict( 215 | doctype='Agriculture Analysis Criteria', 216 | title='Manganese Saturation (%)', 217 | standard=1, 218 | linked_doctype='Soil Analysis'), 219 | dict( 220 | doctype='Agriculture Analysis Criteria', 221 | title='Nirtogen (ppm)', 222 | standard=1, 223 | linked_doctype='Soil Analysis'), 224 | dict( 225 | doctype='Agriculture Analysis Criteria', 226 | title='Phosphorous (ppm)', 227 | standard=1, 228 | linked_doctype='Soil Analysis'), 229 | dict( 230 | doctype='Agriculture Analysis Criteria', 231 | title='Potassium (ppm)', 232 | standard=1, 233 | linked_doctype='Soil Analysis'), 234 | dict( 235 | doctype='Agriculture Analysis Criteria', 236 | title='Calcium (ppm)', 237 | standard=1, 238 | linked_doctype='Soil Analysis'), 239 | dict( 240 | doctype='Agriculture Analysis Criteria', 241 | title='Magnesium (ppm)', 242 | standard=1, 243 | linked_doctype='Soil Analysis'), 244 | dict( 245 | doctype='Agriculture Analysis Criteria', 246 | title='Sulphur (ppm)', 247 | standard=1, 248 | linked_doctype='Soil Analysis'), 249 | dict( 250 | doctype='Agriculture Analysis Criteria', 251 | title='Copper (ppm)', 252 | standard=1, 253 | linked_doctype='Soil Analysis'), 254 | dict( 255 | doctype='Agriculture Analysis Criteria', 256 | title='Iron (ppm)', 257 | standard=1, 258 | linked_doctype='Soil Analysis'), 259 | dict( 260 | doctype='Agriculture Analysis Criteria', 261 | title='Manganese (ppm)', 262 | standard=1, 263 | linked_doctype='Soil Analysis'), 264 | dict( 265 | doctype='Agriculture Analysis Criteria', 266 | title='Zinc (ppm)', 267 | standard=1, 268 | linked_doctype='Soil Analysis'), 269 | dict( 270 | doctype='Agriculture Analysis Criteria', 271 | title='Aluminium (ppm)', 272 | standard=1, 273 | linked_doctype='Soil Analysis'), 274 | dict( 275 | doctype='Agriculture Analysis Criteria', 276 | title='Water pH', 277 | standard=1, 278 | linked_doctype='Water Analysis'), 279 | dict( 280 | doctype='Agriculture Analysis Criteria', 281 | title='Conductivity (mS/cm)', 282 | standard=1, 283 | linked_doctype='Water Analysis'), 284 | dict( 285 | doctype='Agriculture Analysis Criteria', 286 | title='Hardness (mg/CaCO3)', 287 | standard=1, 288 | linked_doctype='Water Analysis'), 289 | dict( 290 | doctype='Agriculture Analysis Criteria', 291 | title='Turbidity (NTU)', 292 | standard=1, 293 | linked_doctype='Water Analysis'), 294 | dict( 295 | doctype='Agriculture Analysis Criteria', 296 | title='Odor', 297 | standard=1, 298 | linked_doctype='Water Analysis'), 299 | dict( 300 | doctype='Agriculture Analysis Criteria', 301 | title='Color', 302 | standard=1, 303 | linked_doctype='Water Analysis'), 304 | dict( 305 | doctype='Agriculture Analysis Criteria', 306 | title='Nitrate (mg/L)', 307 | standard=1, 308 | linked_doctype='Water Analysis'), 309 | dict( 310 | doctype='Agriculture Analysis Criteria', 311 | title='Nirtite (mg/L)', 312 | standard=1, 313 | linked_doctype='Water Analysis'), 314 | dict( 315 | doctype='Agriculture Analysis Criteria', 316 | title='Calcium (mg/L)', 317 | standard=1, 318 | linked_doctype='Water Analysis'), 319 | dict( 320 | doctype='Agriculture Analysis Criteria', 321 | title='Magnesium (mg/L)', 322 | standard=1, 323 | linked_doctype='Water Analysis'), 324 | dict( 325 | doctype='Agriculture Analysis Criteria', 326 | title='Sulphate (mg/L)', 327 | standard=1, 328 | linked_doctype='Water Analysis'), 329 | dict( 330 | doctype='Agriculture Analysis Criteria', 331 | title='Boron (mg/L)', 332 | standard=1, 333 | linked_doctype='Water Analysis'), 334 | dict( 335 | doctype='Agriculture Analysis Criteria', 336 | title='Copper (mg/L)', 337 | standard=1, 338 | linked_doctype='Water Analysis'), 339 | dict( 340 | doctype='Agriculture Analysis Criteria', 341 | title='Iron (mg/L)', 342 | standard=1, 343 | linked_doctype='Water Analysis'), 344 | dict( 345 | doctype='Agriculture Analysis Criteria', 346 | title='Manganese (mg/L)', 347 | standard=1, 348 | linked_doctype='Water Analysis'), 349 | dict( 350 | doctype='Agriculture Analysis Criteria', 351 | title='Zinc (mg/L)', 352 | standard=1, 353 | linked_doctype='Water Analysis'), 354 | dict( 355 | doctype='Agriculture Analysis Criteria', 356 | title='Chlorine (mg/L)', 357 | standard=1, 358 | linked_doctype='Water Analysis'), 359 | dict( 360 | doctype='Agriculture Analysis Criteria', 361 | title='Bulk Density', 362 | standard=1, 363 | linked_doctype='Soil Texture'), 364 | dict( 365 | doctype='Agriculture Analysis Criteria', 366 | title='Field Capacity', 367 | standard=1, 368 | linked_doctype='Soil Texture'), 369 | dict( 370 | doctype='Agriculture Analysis Criteria', 371 | title='Wilting Point', 372 | standard=1, 373 | linked_doctype='Soil Texture'), 374 | dict( 375 | doctype='Agriculture Analysis Criteria', 376 | title='Hydraulic Conductivity', 377 | standard=1, 378 | linked_doctype='Soil Texture'), 379 | dict( 380 | doctype='Agriculture Analysis Criteria', 381 | title='Organic Matter', 382 | standard=1, 383 | linked_doctype='Soil Texture'), 384 | dict( 385 | doctype='Agriculture Analysis Criteria', 386 | title='Temperature High', 387 | standard=1, 388 | linked_doctype='Weather'), 389 | dict( 390 | doctype='Agriculture Analysis Criteria', 391 | title='Temperature Low', 392 | standard=1, 393 | linked_doctype='Weather'), 394 | dict( 395 | doctype='Agriculture Analysis Criteria', 396 | title='Temperature Average', 397 | standard=1, 398 | linked_doctype='Weather'), 399 | dict( 400 | doctype='Agriculture Analysis Criteria', 401 | title='Dew Point', 402 | standard=1, 403 | linked_doctype='Weather'), 404 | dict( 405 | doctype='Agriculture Analysis Criteria', 406 | title='Precipitation Received', 407 | standard=1, 408 | linked_doctype='Weather'), 409 | dict( 410 | doctype='Agriculture Analysis Criteria', 411 | title='Humidity', 412 | standard=1, 413 | linked_doctype='Weather'), 414 | dict( 415 | doctype='Agriculture Analysis Criteria', 416 | title='Pressure', 417 | standard=1, 418 | linked_doctype='Weather'), 419 | dict( 420 | doctype='Agriculture Analysis Criteria', 421 | title='Insolation/ PAR (Photosynthetically Active Radiation)', 422 | standard=1, 423 | linked_doctype='Weather'), 424 | dict( 425 | doctype='Agriculture Analysis Criteria', 426 | title='Degree Days', 427 | standard=1, 428 | linked_doctype='Weather') 429 | ] 430 | insert_record(records) 431 | 432 | def add_additional_permissions(): 433 | frappe.get_doc({ 434 | "doctype": "Custom DocPerm", 435 | "parent": "Location", 436 | "role": "Agriculture Manager", 437 | "create": 1, 438 | "delete": 1, 439 | "email": 1, 440 | "export": 1, 441 | "print": 1, 442 | "read": 1, 443 | "report": 1, 444 | "share": 1, 445 | "write": 1 446 | }).insert() 447 | 448 | frappe.get_doc({ 449 | "doctype": "Custom DocPerm", 450 | "parent": "Location", 451 | "role": "Agriculture User", 452 | "email": 1, 453 | "export": 1, 454 | "print": 1, 455 | "read": 1, 456 | "report": 1, 457 | "share": 1, 458 | "write": 1 459 | }).insert() 460 | 461 | def cleanup_role_and_permissions(): 462 | for role in ["Agriculture Manager", "Agriculture User"]: 463 | frappe.db.delete("Custom DocPerm", {"role": role}) 464 | frappe.db.delete("Role", role) 465 | frappe.db.commit() 466 | -------------------------------------------------------------------------------- /agriculture/agriculture/workspace/agriculture/agriculture.json: -------------------------------------------------------------------------------- 1 | { 2 | "charts": [], 3 | "content": "[{\"type\": \"header\", \"data\": {\"text\": \"Reports & Masters\", \"level\": 4, \"col\": 12}}, {\"type\": \"card\", \"data\": {\"card_name\": \"Crops & Lands\", \"col\": 4}}, {\"type\": \"card\", \"data\": {\"card_name\": \"Analytics\", \"col\": 4}}, {\"type\": \"card\", \"data\": {\"card_name\": \"Diseases & Fertilizers\", \"col\": 4}}]", 4 | "creation": "2020-03-02 17:23:34.339274", 5 | "docstatus": 0, 6 | "doctype": "Workspace", 7 | "for_user": "", 8 | "hide_custom": 0, 9 | "icon": "agriculture", 10 | "idx": 0, 11 | "label": "Agriculture", 12 | "links": [ 13 | { 14 | "hidden": 0, 15 | "is_query_report": 0, 16 | "label": "Crops & Lands", 17 | "link_count": 0, 18 | "onboard": 0, 19 | "type": "Card Break" 20 | }, 21 | { 22 | "dependencies": "", 23 | "hidden": 0, 24 | "is_query_report": 0, 25 | "label": "Crop", 26 | "link_count": 0, 27 | "link_to": "Crop", 28 | "link_type": "DocType", 29 | "onboard": 1, 30 | "type": "Link" 31 | }, 32 | { 33 | "dependencies": "", 34 | "hidden": 0, 35 | "is_query_report": 0, 36 | "label": "Crop Cycle", 37 | "link_count": 0, 38 | "link_to": "Crop Cycle", 39 | "link_type": "DocType", 40 | "onboard": 1, 41 | "type": "Link" 42 | }, 43 | { 44 | "dependencies": "", 45 | "hidden": 0, 46 | "is_query_report": 0, 47 | "label": "Location", 48 | "link_count": 0, 49 | "link_to": "Location", 50 | "link_type": "DocType", 51 | "onboard": 1, 52 | "type": "Link" 53 | }, 54 | { 55 | "hidden": 0, 56 | "is_query_report": 0, 57 | "label": "Analytics", 58 | "link_count": 0, 59 | "onboard": 0, 60 | "type": "Card Break" 61 | }, 62 | { 63 | "dependencies": "", 64 | "hidden": 0, 65 | "is_query_report": 0, 66 | "label": "Plant Analysis", 67 | "link_count": 0, 68 | "link_to": "Plant Analysis", 69 | "link_type": "DocType", 70 | "onboard": 0, 71 | "type": "Link" 72 | }, 73 | { 74 | "dependencies": "", 75 | "hidden": 0, 76 | "is_query_report": 0, 77 | "label": "Soil Analysis", 78 | "link_count": 0, 79 | "link_to": "Soil Analysis", 80 | "link_type": "DocType", 81 | "onboard": 0, 82 | "type": "Link" 83 | }, 84 | { 85 | "dependencies": "", 86 | "hidden": 0, 87 | "is_query_report": 0, 88 | "label": "Water Analysis", 89 | "link_count": 0, 90 | "link_to": "Water Analysis", 91 | "link_type": "DocType", 92 | "onboard": 0, 93 | "type": "Link" 94 | }, 95 | { 96 | "dependencies": "", 97 | "hidden": 0, 98 | "is_query_report": 0, 99 | "label": "Soil Texture", 100 | "link_count": 0, 101 | "link_to": "Soil Texture", 102 | "link_type": "DocType", 103 | "onboard": 0, 104 | "type": "Link" 105 | }, 106 | { 107 | "dependencies": "", 108 | "hidden": 0, 109 | "is_query_report": 0, 110 | "label": "Weather", 111 | "link_count": 0, 112 | "link_to": "Weather", 113 | "link_type": "DocType", 114 | "onboard": 0, 115 | "type": "Link" 116 | }, 117 | { 118 | "dependencies": "", 119 | "hidden": 0, 120 | "is_query_report": 0, 121 | "label": "Agriculture Analysis Criteria", 122 | "link_count": 0, 123 | "link_to": "Agriculture Analysis Criteria", 124 | "link_type": "DocType", 125 | "onboard": 0, 126 | "type": "Link" 127 | }, 128 | { 129 | "hidden": 0, 130 | "is_query_report": 0, 131 | "label": "Diseases & Fertilizers", 132 | "link_count": 0, 133 | "onboard": 0, 134 | "type": "Card Break" 135 | }, 136 | { 137 | "dependencies": "", 138 | "hidden": 0, 139 | "is_query_report": 0, 140 | "label": "Disease", 141 | "link_count": 0, 142 | "link_to": "Disease", 143 | "link_type": "DocType", 144 | "onboard": 1, 145 | "type": "Link" 146 | }, 147 | { 148 | "dependencies": "", 149 | "hidden": 0, 150 | "is_query_report": 0, 151 | "label": "Fertilizer", 152 | "link_count": 0, 153 | "link_to": "Fertilizer", 154 | "link_type": "DocType", 155 | "onboard": 1, 156 | "type": "Link" 157 | } 158 | ], 159 | "modified": "2021-08-05 12:15:54.595198", 160 | "modified_by": "Administrator", 161 | "module": "Agriculture", 162 | "name": "Agriculture", 163 | "owner": "Administrator", 164 | "parent_page": "", 165 | "public": 1, 166 | "restrict_to_domain": "Agriculture", 167 | "roles": [], 168 | "sequence_id": 3, 169 | "shortcuts": [], 170 | "title": "Agriculture" 171 | } -------------------------------------------------------------------------------- /agriculture/config/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/config/__init__.py -------------------------------------------------------------------------------- /agriculture/config/desktop.py: -------------------------------------------------------------------------------- 1 | from frappe import _ 2 | 3 | def get_data(): 4 | return [ 5 | { 6 | "module_name": "Agriculture", 7 | "color": "grey", 8 | "icon": "octicon octicon-file-directory", 9 | "type": "module", 10 | "label": _("Agriculture") 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /agriculture/config/docs.py: -------------------------------------------------------------------------------- 1 | """ 2 | Configuration for docs 3 | """ 4 | 5 | # source_link = "https://github.com/[org_name]/agriculture" 6 | # headline = "App that does everything" 7 | # sub_heading = "Yes, you got that right the first time, everything" 8 | 9 | def get_context(context): 10 | context.brand_html = "Agriculture" 11 | -------------------------------------------------------------------------------- /agriculture/hooks.py: -------------------------------------------------------------------------------- 1 | from . import __version__ as app_version 2 | 3 | app_name = "agriculture" 4 | app_title = "Agriculture" 5 | app_publisher = "Frappe" 6 | app_description = "Agriculture" 7 | app_icon = "octicon octicon-file-directory" 8 | app_color = "grey" 9 | app_email = "pandikunta@frappe.io" 10 | app_license = "MIT" 11 | 12 | 13 | required_apps = ["erpnext"] 14 | 15 | # Includes in 16 | # ------------------ 17 | 18 | # include js, css files in header of desk.html 19 | # app_include_css = "/assets/agriculture/css/agriculture.css" 20 | # app_include_js = "/assets/agriculture/js/agriculture.js" 21 | 22 | # include js, css files in header of web template 23 | # web_include_css = "/assets/agriculture/css/agriculture.css" 24 | # web_include_js = "/assets/agriculture/js/agriculture.js" 25 | 26 | # include custom scss in every website theme (without file extension ".scss") 27 | # website_theme_scss = "agriculture/public/scss/website" 28 | 29 | # include js, css files in header of web form 30 | # webform_include_js = {"doctype": "public/js/doctype.js"} 31 | # webform_include_css = {"doctype": "public/css/doctype.css"} 32 | 33 | # include js in page 34 | # page_js = {"page" : "public/js/file.js"} 35 | 36 | # include js in doctype views 37 | # doctype_js = {"doctype" : "public/js/doctype.js"} 38 | # doctype_list_js = {"doctype" : "public/js/doctype_list.js"} 39 | # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} 40 | # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} 41 | 42 | # Home Pages 43 | # ---------- 44 | 45 | # application home page (will override Website Settings) 46 | # home_page = "login" 47 | 48 | # website user home page (by Role) 49 | # role_home_page = { 50 | # "Role": "home_page" 51 | # } 52 | 53 | # Generators 54 | # ---------- 55 | 56 | # automatically create page for each record of this doctype 57 | # website_generators = ["Web Page"] 58 | 59 | # Jinja 60 | # ---------- 61 | 62 | # add methods and filters to jinja environment 63 | # jinja = { 64 | # "methods": "agriculture.utils.jinja_methods", 65 | # "filters": "agriculture.utils.jinja_filters" 66 | # } 67 | 68 | # Installation 69 | # ------------ 70 | 71 | # before_install = "agriculture.install.before_install" 72 | after_install = "agriculture.agriculture.setup.setup_agriculture" 73 | 74 | # Uninstallation 75 | # ------------ 76 | 77 | # before_uninstall = "agriculture.uninstall.before_uninstall" 78 | after_uninstall = "agriculture.agriculture.setup.cleanup_role_and_permissions" 79 | 80 | # Desk Notifications 81 | # ------------------ 82 | # See frappe.core.notifications.get_notification_config 83 | 84 | # notification_config = "agriculture.notifications.get_notification_config" 85 | 86 | # Permissions 87 | # ----------- 88 | # Permissions evaluated in scripted ways 89 | 90 | # permission_query_conditions = { 91 | # "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", 92 | # } 93 | # 94 | # has_permission = { 95 | # "Event": "frappe.desk.doctype.event.event.has_permission", 96 | # } 97 | 98 | # DocType Class 99 | # --------------- 100 | # Override standard doctype classes 101 | 102 | # override_doctype_class = { 103 | # "ToDo": "custom_app.overrides.CustomToDo" 104 | # } 105 | 106 | # Document Events 107 | # --------------- 108 | # Hook on document methods and events 109 | 110 | # doc_events = { 111 | # "*": { 112 | # "on_update": "method", 113 | # "on_cancel": "method", 114 | # "on_trash": "method" 115 | # } 116 | # } 117 | 118 | # Scheduled Tasks 119 | # --------------- 120 | 121 | # scheduler_events = { 122 | # "all": [ 123 | # "agriculture.tasks.all" 124 | # ], 125 | # "daily": [ 126 | # "agriculture.tasks.daily" 127 | # ], 128 | # "hourly": [ 129 | # "agriculture.tasks.hourly" 130 | # ], 131 | # "weekly": [ 132 | # "agriculture.tasks.weekly" 133 | # ], 134 | # "monthly": [ 135 | # "agriculture.tasks.monthly" 136 | # ], 137 | # } 138 | 139 | # Testing 140 | # ------- 141 | 142 | # before_tests = "agriculture.install.before_tests" 143 | 144 | # Overriding Methods 145 | # ------------------------------ 146 | # 147 | # override_whitelisted_methods = { 148 | # "frappe.desk.doctype.event.event.get_events": "agriculture.event.get_events" 149 | # } 150 | # 151 | # each overriding function accepts a `data` argument; 152 | # generated from the base implementation of the doctype dashboard, 153 | # along with any modifications made in other Frappe apps 154 | # override_doctype_dashboards = { 155 | # "Task": "agriculture.task.get_dashboard_data" 156 | # } 157 | 158 | # exempt linked doctypes from being automatically cancelled 159 | # 160 | # auto_cancel_exempted_doctypes = ["Auto Repeat"] 161 | 162 | 163 | # User Data Protection 164 | # -------------------- 165 | 166 | # user_data_fields = [ 167 | # { 168 | # "doctype": "{doctype_1}", 169 | # "filter_by": "{filter_by}", 170 | # "redact_fields": ["{field_1}", "{field_2}"], 171 | # "partial": 1, 172 | # }, 173 | # { 174 | # "doctype": "{doctype_2}", 175 | # "filter_by": "{filter_by}", 176 | # "partial": 1, 177 | # }, 178 | # { 179 | # "doctype": "{doctype_3}", 180 | # "strict": False, 181 | # }, 182 | # { 183 | # "doctype": "{doctype_4}" 184 | # } 185 | # ] 186 | 187 | # Authentication and authorization 188 | # -------------------------------- 189 | 190 | # auth_hooks = [ 191 | # "agriculture.auth.validate" 192 | # ] 193 | 194 | global_search_doctypes = { 195 | "Agriculture": [ 196 | {'doctype': 'Weather', 'index': 1}, 197 | {'doctype': 'Soil Texture', 'index': 2}, 198 | {'doctype': 'Water Analysis', 'index': 3}, 199 | {'doctype': 'Soil Analysis', 'index': 4}, 200 | {'doctype': 'Plant Analysis', 'index': 5}, 201 | {'doctype': 'Agriculture Analysis Criteria', 'index': 6}, 202 | {'doctype': 'Disease', 'index': 7}, 203 | {'doctype': 'Crop', 'index': 8}, 204 | {'doctype': 'Fertilizer', 'index': 9}, 205 | {'doctype': 'Crop Cycle', 'index': 10} 206 | ] 207 | } 208 | 209 | domains = { 210 | 'Agriculture': 'agriculture.agriculture.agriculture', 211 | } 212 | 213 | -------------------------------------------------------------------------------- /agriculture/modules.txt: -------------------------------------------------------------------------------- 1 | Agriculture -------------------------------------------------------------------------------- /agriculture/patches.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/patches.txt -------------------------------------------------------------------------------- /agriculture/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/templates/__init__.py -------------------------------------------------------------------------------- /agriculture/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frappe/agriculture/109c8815ff1cec73340b39cc66a946896f055804/agriculture/templates/pages/__init__.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # frappe -- https://github.com/frappe/frappe is installed via 'bench init' -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | with open("requirements.txt") as f: 4 | install_requires = f.read().strip().split("\n") 5 | 6 | # get version from __version__ variable in agriculture/__init__.py 7 | from agriculture import __version__ as version 8 | 9 | setup( 10 | name="agriculture", 11 | version=version, 12 | description="Agriculture", 13 | author="Frappe", 14 | author_email="pandikunta@frappe.io", 15 | packages=find_packages(), 16 | zip_safe=False, 17 | include_package_data=True, 18 | install_requires=install_requires 19 | ) 20 | --------------------------------------------------------------------------------