From 020c6e9175fe4e743efb9424e1e20fb412052253 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Wed, 24 Jun 2020 15:22:45 +0530 Subject: [PATCH 01/49] fix: Create salary slip button disappears --- .../doctype/payroll_entry/payroll_entry.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js index 1ae3553b9b94..0415ebf2fce3 100644 --- a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js +++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js @@ -30,6 +30,7 @@ frappe.ui.form.on('Payroll Entry', { ).toggleClass('btn-primary', !(frm.doc.employees || []).length); } if ((frm.doc.employees || []).length) { + frm.page.clear_primary_action(); frm.page.set_primary_action(__('Create Salary Slips'), () => { frm.save('Submit').then(()=>{ frm.page.clear_primary_action(); @@ -49,13 +50,14 @@ frappe.ui.form.on('Payroll Entry', { return frappe.call({ doc: frm.doc, method: 'fill_employee_details', - callback: function(r) { - if (r.docs[0].employees){ - frm.save(); - frm.refresh(); - if(r.docs[0].validate_attendance){ - render_employee_attendance(frm, r.message); - } + }).then(r => { + if (r.docs[0].employees){ + frm.employees = r.docs[0].employees; + frm.dirty(); + frm.save(); + frm.refresh(); + if(r.docs[0].validate_attendance){ + render_employee_attendance(frm, r.message); } } }) From d1bf6e027734a57b1ca6b73b9db84dabc744cbd5 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 29 Jun 2020 21:14:03 +0530 Subject: [PATCH 02/49] fix: Do not ignore validate methods on GLL entry submit --- erpnext/accounts/general_ledger.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index bfe35ab0068d..da9123b92a37 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -140,10 +140,8 @@ def make_entry(args, adv_adj, update_outstanding): gle = frappe.new_doc("GL Entry") gle.update(args) gle.flags.ignore_permissions = 1 - gle.validate() gle.db_insert() gle.run_method("on_update_with_args", adv_adj, update_outstanding) - gle.flags.ignore_validate = True gle.submit() # check against budget From 8230e41a4202924b24521dc51543b2412d9f56db Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 29 Jun 2020 21:20:05 +0530 Subject: [PATCH 03/49] fix: Insert instead of DB insert --- erpnext/accounts/general_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index da9123b92a37..a245d63f52b9 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -140,7 +140,7 @@ def make_entry(args, adv_adj, update_outstanding): gle = frappe.new_doc("GL Entry") gle.update(args) gle.flags.ignore_permissions = 1 - gle.db_insert() + gle.insert() gle.run_method("on_update_with_args", adv_adj, update_outstanding) gle.submit() From 8f2cb0beb6f2774a21b95573a86aee6fbd95d956 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Tue, 30 Jun 2020 12:11:03 +0530 Subject: [PATCH 04/49] fix: set half day date None if half day is unchecked --- erpnext/hr/doctype/leave_application/leave_application.js | 2 ++ erpnext/hr/doctype/leave_application/leave_application.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js index fb1f2c00b138..9413120bc5f2 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -40,6 +40,8 @@ frappe.ui.form.on("Leave Application", { validate: function(frm) { if (frm.doc.from_date == frm.doc.to_date && frm.doc.half_day == 1){ frm.doc.half_day_date = frm.doc.from_date; + }else if (frm.doc.half_day == 0){ + frm.doc.half_day_date = undefined; } frm.toggle_reqd("half_day_date", frm.doc.half_day == 1); }, diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 0423824c0e94..3f25f583833a 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -293,6 +293,8 @@ def validate_optional_leave(self): def set_half_day_date(self): if self.from_date == self.to_date and self.half_day == 1: self.half_day_date = self.from_date + elif self.half_day == 0: + self.half_day_date = None def notify_employee(self): employee = frappe.get_doc("Employee", self.employee) From 41c0c9f46bc8765171d3268d6b8b2afa8d765e54 Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 18 Jun 2020 11:18:44 +0500 Subject: [PATCH 05/49] fix: Item Tax Template --- erpnext/controllers/queries.py | 3 ++- erpnext/public/js/controllers/transaction.js | 3 ++- erpnext/stock/doctype/item_tax/item_tax.json | 15 +++++++++++---- erpnext/stock/get_item_details.py | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index f6a8d27d4404..ee8364a40e3a 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -570,7 +570,8 @@ def get_tax_template(doctype, txt, searchfield, start, page_len, filters): args = { 'item_code': filters.get('item_code'), 'posting_date': filters.get('valid_from'), - 'tax_category': filters.get('tax_category') + 'tax_category': filters.get('tax_category'), + 'company': filters.get('company') } taxes = _get_item_tax_template(args, taxes, for_validate=True) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 905f6fb80f52..3c56a636bd15 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1835,7 +1835,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ if (doc.tax_category) filters['tax_category'] = doc.tax_category; - + if (doc.company) + filters['company'] = doc.company; return { query: "erpnext.controllers.queries.get_tax_template", filters: filters diff --git a/erpnext/stock/doctype/item_tax/item_tax.json b/erpnext/stock/doctype/item_tax/item_tax.json index a93e4636add7..cf3c0e9c3471 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.json +++ b/erpnext/stock/doctype/item_tax/item_tax.json @@ -1,5 +1,4 @@ { - "actions": [], "creation": "2013-02-22 01:28:01", "doctype": "DocType", "editable_grid": 1, @@ -7,7 +6,8 @@ "field_order": [ "item_tax_template", "tax_category", - "valid_from" + "valid_from", + "company" ], "fields": [ { @@ -34,12 +34,19 @@ "fieldtype": "Date", "in_list_view": 1, "label": "Valid From" + }, + { + "fetch_from": "item_tax_template.company", + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "options": "Company" } ], "idx": 1, "istable": 1, - "links": [], - "modified": "2019-12-28 21:54:40.807849", + "modified": "2020-06-18 02:30:44.610171", "modified_by": "Administrator", "module": "Stock", "name": "Item Tax", diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 0ed3b276e39e..08ee6300ffe1 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -442,7 +442,7 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False): taxes_with_no_validity = [] for tax in taxes: - if tax.valid_from: + if tax.valid_from and tax.company == args['company']: # In purchase Invoice first preference will be given to supplier invoice date # if supplier date is not present then posting date validation_date = args.get('transaction_date') or args.get('bill_date') or args.get('posting_date') From e39649bc9e30c39a99b2642a19dc571dcfbe70cd Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 18 Jun 2020 11:42:53 +0500 Subject: [PATCH 06/49] fix: Item Tax Template with no validity --- erpnext/stock/get_item_details.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 08ee6300ffe1..67333f4aa9bd 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -450,7 +450,8 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False): if getdate(tax.valid_from) <= getdate(validation_date): taxes_with_validity.append(tax) else: - taxes_with_no_validity.append(tax) + if tax.company == args['company']: + taxes_with_no_validity.append(tax) if taxes_with_validity: taxes = sorted(taxes_with_validity, key = lambda i: i.valid_from, reverse=True) From 728bf0e6dd282ddff629edcd37879b5608beda08 Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 18 Jun 2020 12:21:42 +0500 Subject: [PATCH 07/49] fix: Item Tax Template --- erpnext/controllers/taxes_and_totals.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 4e568e2795ac..a9eb9963bfe4 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -53,7 +53,8 @@ def validate_item_tax_template(self): 'tax_category': self.doc.get('tax_category'), 'posting_date': self.doc.get('posting_date'), 'bill_date': self.doc.get('bill_date'), - 'transaction_date': self.doc.get('transaction_date') + 'transaction_date': self.doc.get('transaction_date'), + 'company': self.doc.get('company') } item_group = item_doc.item_group From 015910b4c458a5ad89be796ead759e76eaed2794 Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 18 Jun 2020 23:15:22 +0500 Subject: [PATCH 08/49] Company Field Added in Item Tax Template --- .../item_tax_template/item_tax_template.js | 12 + .../item_tax_template/item_tax_template.json | 225 ++++++------------ 2 files changed, 83 insertions(+), 154 deletions(-) diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template.js b/erpnext/accounts/doctype/item_tax_template/item_tax_template.js index 42abdb809bad..e30ef61a2327 100644 --- a/erpnext/accounts/doctype/item_tax_template/item_tax_template.js +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template.js @@ -6,6 +6,18 @@ frappe.ui.form.on('Item Tax Template', { frm.set_query("tax_type", "taxes", function(doc) { return { filters: [ + ['Account', 'company', '=', frm.doc.company], + ['Account', 'is_group', '=', 0], + ['Account', 'account_type', 'in', ['Tax', 'Chargeable', 'Income Account', 'Expense Account', 'Expenses Included In Valuation']] + ] + } + }); + }, + company: function (frm) { + frm.set_query("tax_type", "taxes", function(doc) { + return { + filters: [ + ['Account', 'company', '=', frm.doc.company], ['Account', 'is_group', '=', 0], ['Account', 'account_type', 'in', ['Tax', 'Chargeable', 'Income Account', 'Expense Account', 'Expenses Included In Valuation']] ] diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template.json b/erpnext/accounts/doctype/item_tax_template/item_tax_template.json index f713cfc0bacb..856c371ecfaa 100644 --- a/erpnext/accounts/doctype/item_tax_template/item_tax_template.json +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template.json @@ -1,168 +1,85 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:title", - "beta": 0, - "creation": "2018-11-22 22:45:00.370913", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "Setup", - "editable_grid": 1, - "engine": "InnoDB", + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:title", + "creation": "2018-11-22 22:45:00.370913", + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "title", + "company", + "taxes" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "title", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 1, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Title", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "fieldname": "title", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Title", + "no_copy": 1, + "reqd": 1, "unique": 1 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "taxes", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Tax Rates", - "length": 0, - "no_copy": 0, - "options": "Item Tax Template Detail", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldname": "taxes", + "fieldtype": "Table", + "label": "Tax Rates", + "options": "Item Tax Template Detail", + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "reqd": 1 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2018-12-21 23:51:16.328340", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Item Tax Template", - "name_case": "", - "owner": "Administrator", + ], + "modified": "2020-06-18 20:27:42.615842", + "modified_by": "ahmad@havenir.com", + "module": "Accounts", + "name": "Item Tax Template", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, "write": 1 - }, + }, { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, "write": 1 - }, + }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts User", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 0 + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "share": 1 } - ], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, - "search_fields": "", - "show_name_in_global_search": 1, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0, - "track_views": 0 + ], + "show_name_in_global_search": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file From ad3d44d62272c87d275ae26adc4b5338ace698c8 Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 18 Jun 2020 23:16:16 +0500 Subject: [PATCH 09/49] fix: Item Tax Template check on company field --- erpnext/stock/doctype/item_tax/item_tax.json | 5 +++-- erpnext/stock/get_item_details.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item_tax/item_tax.json b/erpnext/stock/doctype/item_tax/item_tax.json index cf3c0e9c3471..8ff6f69fdb09 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.json +++ b/erpnext/stock/doctype/item_tax/item_tax.json @@ -41,12 +41,13 @@ "fieldtype": "Link", "in_list_view": 1, "label": "Company", - "options": "Company" + "options": "Company", + "read_only": 1 } ], "idx": 1, "istable": 1, - "modified": "2020-06-18 02:30:44.610171", + "modified": "2020-06-18 22:53:44.546967", "modified_by": "Administrator", "module": "Stock", "name": "Item Tax", diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 67333f4aa9bd..143a8ebef854 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -413,7 +413,7 @@ def get_item_tax_info(company, tax_category, item_codes): continue out[item_code] = {} item = frappe.get_cached_doc("Item", item_code) - get_item_tax_template({"tax_category": tax_category}, item, out[item_code]) + get_item_tax_template({"company": company, "tax_category": tax_category}, item, out[item_code]) out[item_code]["item_tax_rate"] = get_item_tax_map(company, out[item_code].get("item_tax_template"), as_json=True) return out From 261ecba3d64afd0b746c72933255c2c5427fef4b Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 25 Jun 2020 01:56:53 +0500 Subject: [PATCH 10/49] Company field removed from Item Taxes Table --- erpnext/stock/doctype/item_tax/item_tax.json | 14 ++------------ erpnext/stock/get_item_details.py | 5 +++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/erpnext/stock/doctype/item_tax/item_tax.json b/erpnext/stock/doctype/item_tax/item_tax.json index 8ff6f69fdb09..ae36efc7e3f5 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.json +++ b/erpnext/stock/doctype/item_tax/item_tax.json @@ -6,8 +6,7 @@ "field_order": [ "item_tax_template", "tax_category", - "valid_from", - "company" + "valid_from" ], "fields": [ { @@ -34,20 +33,11 @@ "fieldtype": "Date", "in_list_view": 1, "label": "Valid From" - }, - { - "fetch_from": "item_tax_template.company", - "fieldname": "company", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Company", - "options": "Company", - "read_only": 1 } ], "idx": 1, "istable": 1, - "modified": "2020-06-18 22:53:44.546967", + "modified": "2020-06-25 01:40:28.859752", "modified_by": "Administrator", "module": "Stock", "name": "Item Tax", diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 143a8ebef854..e6a545f6ecf9 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -442,7 +442,8 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False): taxes_with_no_validity = [] for tax in taxes: - if tax.valid_from and tax.company == args['company']: + tax_company = frappe.get_value("Item Tax Template", tax.item_tax_template, 'company') + if tax.valid_from and tax_company == args['company']: # In purchase Invoice first preference will be given to supplier invoice date # if supplier date is not present then posting date validation_date = args.get('transaction_date') or args.get('bill_date') or args.get('posting_date') @@ -450,7 +451,7 @@ def _get_item_tax_template(args, taxes, out={}, for_validate=False): if getdate(tax.valid_from) <= getdate(validation_date): taxes_with_validity.append(tax) else: - if tax.company == args['company']: + if tax_company == args['company']: taxes_with_no_validity.append(tax) if taxes_with_validity: From f933cf80dffb4f650ea453ea697a36d7d98eb343 Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 25 Jun 2020 02:12:35 +0500 Subject: [PATCH 11/49] Patch for Updating item Tax Template Company --- .../patches/v12_0/update_item_tax_template_company.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 erpnext/patches/v12_0/update_item_tax_template_company.py diff --git a/erpnext/patches/v12_0/update_item_tax_template_company.py b/erpnext/patches/v12_0/update_item_tax_template_company.py new file mode 100644 index 000000000000..54ce78ed2221 --- /dev/null +++ b/erpnext/patches/v12_0/update_item_tax_template_company.py @@ -0,0 +1,11 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + item_tax_template_list = frappe.get_list('Item Tax Template') + for template in item_tax_template_list: + doc = frappe.get_doc('Item Tax Template', template.name) + for tax in doc.taxes: + doc.company = frappe.get_value('Account', tax.tax_type, 'company') + break + doc.save() \ No newline at end of file From b2725577b204d1d32da38f584a752150c0003a11 Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Thu, 25 Jun 2020 02:20:42 +0500 Subject: [PATCH 12/49] Patch file updated --- erpnext/patches.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index c7a7abf81962..7fe5c61c4fbe 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -707,3 +707,5 @@ erpnext.patches.v13_0.move_doctype_reports_and_notification_from_hr_to_payroll # erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings #22-06-2020 erpnext.patches.v13_0.check_is_income_tax_component #22-06-2020 erpnext.patches.v12_0.add_taxjar_integration_field +execute:frappe.reload_doc('account', 'doctype', 'item_tax_template') +erpnext.patches.v12_0.update_item_tax_template_company From 405b20884bf3a6f53628d1c398775a69627f6fcf Mon Sep 17 00:00:00 2001 From: mohammadahmad1990 Date: Fri, 3 Jul 2020 15:15:27 +0500 Subject: [PATCH 13/49] fix: patch --- erpnext/patches.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 7fe5c61c4fbe..62dd775b9cde 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -707,5 +707,5 @@ erpnext.patches.v13_0.move_doctype_reports_and_notification_from_hr_to_payroll # erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings #22-06-2020 erpnext.patches.v13_0.check_is_income_tax_component #22-06-2020 erpnext.patches.v12_0.add_taxjar_integration_field -execute:frappe.reload_doc('account', 'doctype', 'item_tax_template') +execute:frappe.reload_doc('accounts', 'doctype', 'item_tax_template') erpnext.patches.v12_0.update_item_tax_template_company From d7adacd3e290db5cc1318ebddeb0ea27e6d2fb5b Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 3 Jul 2020 18:39:51 +0530 Subject: [PATCH 14/49] feat: Added all companies option in employee tree to view employee accress all companies --- erpnext/hr/doctype/employee/employee.py | 6 +++++- erpnext/hr/doctype/employee/employee_tree.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 4d49503d2dc9..7338cbb6c85e 100755 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -413,7 +413,11 @@ def get_employee_emails(employee_list): @frappe.whitelist() def get_children(doctype, parent=None, company=None, is_root=False, is_tree=False): - filters = [['company', '=', company]] + + filters = [] + if company and company != 'All Companies': + filters = [['company', '=', company]] + fields = ['name as value', 'employee_name as title'] if is_root: diff --git a/erpnext/hr/doctype/employee/employee_tree.js b/erpnext/hr/doctype/employee/employee_tree.js index 0a2da63058a3..9ab091a1eb6f 100644 --- a/erpnext/hr/doctype/employee/employee_tree.js +++ b/erpnext/hr/doctype/employee/employee_tree.js @@ -4,7 +4,7 @@ frappe.treeview_settings['Employee'] = { { fieldname: "company", fieldtype:"Select", - options: erpnext.utils.get_tree_options("company"), + options: ['All Companies'].concat(erpnext.utils.get_tree_options("company")), label: __("Company"), default: erpnext.utils.get_tree_default("company") } From be05c4e14ae3db924b1b904abe1eb6328f28d0a7 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 5 Jul 2020 18:16:16 +0530 Subject: [PATCH 15/49] fix: Codacy and minor fixes --- erpnext/accounts/doctype/item_tax_template/item_tax_template.js | 2 +- erpnext/patches.txt | 1 - erpnext/patches/v12_0/update_item_tax_template_company.py | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template.js b/erpnext/accounts/doctype/item_tax_template/item_tax_template.js index e30ef61a2327..e921a0d949d4 100644 --- a/erpnext/accounts/doctype/item_tax_template/item_tax_template.js +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template.js @@ -13,7 +13,7 @@ frappe.ui.form.on('Item Tax Template', { } }); }, - company: function (frm) { + company: function (frm) { frm.set_query("tax_type", "taxes", function(doc) { return { filters: [ diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 62dd775b9cde..cd4a221843c8 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -707,5 +707,4 @@ erpnext.patches.v13_0.move_doctype_reports_and_notification_from_hr_to_payroll # erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings #22-06-2020 erpnext.patches.v13_0.check_is_income_tax_component #22-06-2020 erpnext.patches.v12_0.add_taxjar_integration_field -execute:frappe.reload_doc('accounts', 'doctype', 'item_tax_template') erpnext.patches.v12_0.update_item_tax_template_company diff --git a/erpnext/patches/v12_0/update_item_tax_template_company.py b/erpnext/patches/v12_0/update_item_tax_template_company.py index 54ce78ed2221..f7496999b334 100644 --- a/erpnext/patches/v12_0/update_item_tax_template_company.py +++ b/erpnext/patches/v12_0/update_item_tax_template_company.py @@ -2,6 +2,8 @@ import frappe def execute(): + frappe.reload_doc('accounts', 'doctype', 'item_tax_template') + item_tax_template_list = frappe.get_list('Item Tax Template') for template in item_tax_template_list: doc = frappe.get_doc('Item Tax Template', template.name) From e88f2bb05325c267ee28d5221aae53c0a6d8ffd5 Mon Sep 17 00:00:00 2001 From: Anupam K Date: Mon, 6 Jul 2020 12:34:05 +0530 Subject: [PATCH 16/49] number card filter --- erpnext/crm/dashboard_fixtures.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/erpnext/crm/dashboard_fixtures.py b/erpnext/crm/dashboard_fixtures.py index 0535cbbcc952..901c0581f4c1 100644 --- a/erpnext/crm/dashboard_fixtures.py +++ b/erpnext/crm/dashboard_fixtures.py @@ -172,7 +172,9 @@ def get_number_cards(): "doctype": "Number Card", "document_type": "Lead", "name": "New Lead (Last 1 Month)", - "filters_json": json.dumps([["Lead","creation","Previous","1 month",False]]), + "filters_json": json.dumps([ + ["Lead", "creation", "Timespan", "last month"] + ]), "function": "Count", "is_public": 1, "label": _("New Lead (Last 1 Month)"), @@ -183,7 +185,9 @@ def get_number_cards(): "doctype": "Number Card", "document_type": "Opportunity", "name": "New Opportunity (Last 1 Month)", - "filters_json": json.dumps([["Opportunity","creation","Previous","1 month",False]]), + "filters_json": json.dumps([ + ["Opportunity", "creation", "Timespan", "last month"] + ]), "function": "Count", "is_public": 1, "label": _("New Opportunity (Last 1 Month)"), @@ -194,7 +198,10 @@ def get_number_cards(): "doctype": "Number Card", "document_type": "Opportunity", "name": "Won Opportunity (Last 1 Month)", - "filters_json": json.dumps([["Opportunity","creation","Previous","1 month",False]]), + "filters_json": json.dumps([ + ["Opportunity", "status", "=", "Converted",False], + ["Opportunity", "creation", "Timespan", "last month"] + ]), "function": "Count", "is_public": 1, "label": _("Won Opportunity (Last 1 Month)"), From f642be97270373043e99370e79a9b952d347c00a Mon Sep 17 00:00:00 2001 From: Mitali Deshpande Date: Tue, 7 Jul 2020 15:59:41 +0530 Subject: [PATCH 17/49] fix: Changed error message in the Product Bundle --- erpnext/selling/doctype/product_bundle/product_bundle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/product_bundle/product_bundle.py b/erpnext/selling/doctype/product_bundle/product_bundle.py index c8a71677f93b..55580c467154 100644 --- a/erpnext/selling/doctype/product_bundle/product_bundle.py +++ b/erpnext/selling/doctype/product_bundle/product_bundle.py @@ -26,7 +26,7 @@ def validate_main_item(self): def validate_child_items(self): for item in self.items: if frappe.db.exists("Product Bundle", item.item_code): - frappe.throw(_("Child Item should not be a Product Bundle. Please remove item `{0}` and save").format(item.item_code)) + frappe.throw(_("Row #{0}: Child Item should not be a Product Bundle. Please remove item `{1}` and Save").format(item.idx, frappe.bold(item.item_code))) def get_new_item_code(doctype, txt, searchfield, start, page_len, filters): from erpnext.controllers.queries import get_match_cond From 8bc92b90f5cfa45aba101aa674962487b938968a Mon Sep 17 00:00:00 2001 From: Anupam K Date: Wed, 8 Jul 2020 00:56:21 +0530 Subject: [PATCH 18/49] updating lead.py --- erpnext/crm/doctype/lead/lead.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index ec7d14d6ae39..315d298eb431 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -114,10 +114,12 @@ def has_lost_quotation(self): def set_lead_name(self): if not self.lead_name: # Check for leads being created through data import - if not self.company_name and not self.flags.ignore_mandatory: + if not self.company_name and not self.email_id and not self.flags.ignore_mandatory: frappe.throw(_("A Lead requires either a person's name or an organization's name")) - - self.lead_name = self.company_name + elif self.company_name: + self.lead_name = self.company_name + else: + self.lead_name = self.email_id.split("@")[0] def set_title(self): if self.organization_lead: From 6669f7457a86d57aebbdaafa1b67ab79f4369478 Mon Sep 17 00:00:00 2001 From: Anupam K Date: Wed, 8 Jul 2020 01:24:53 +0530 Subject: [PATCH 19/49] hr dashboard number card filter fix --- erpnext/hr/dashboard_fixtures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/dashboard_fixtures.py b/erpnext/hr/dashboard_fixtures.py index 6d8091be647b..1e9b4f3c93a1 100644 --- a/erpnext/hr/dashboard_fixtures.py +++ b/erpnext/hr/dashboard_fixtures.py @@ -123,7 +123,7 @@ def get_number_cards(): number_cards.append( get_number_cards_doc("Employee", "New Joinees (Last year)", filters_json = json.dumps([ - ["Employee","date_of_joining","Previous","1 year"], + ["Employee","date_of_joining","Timespan","last year"], ["Employee","status","=","Active"] ]) ) @@ -131,7 +131,7 @@ def get_number_cards(): number_cards.append( get_number_cards_doc("Employee", "Employees Left (Last year)", filters_json = json.dumps([ - ["Employee", "relieving_date", "Previous", "1 year"], + ["Employee", "relieving_date", "Timespan", "last year"], ["Employee", "status", "=", "Left"] ]) ) @@ -139,7 +139,7 @@ def get_number_cards(): number_cards.append( get_number_cards_doc("Job Applicant", "Total Applicants (Last month)", filters_json = json.dumps([ - ["Job Applicant", "creation", "Previous", "1 month"] + ["Job Applicant", "creation", "Timespan", "last month"] ]) ) ) From 8c5c74ca065cbcb7a10793de1f4bbfd4114eddd1 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 8 Jul 2020 09:20:13 +0530 Subject: [PATCH 20/49] fix: Remove trailing spaces from labels --- erpnext/stock/doctype/item_price/item_price.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item_price/item_price.json b/erpnext/stock/doctype/item_price/item_price.json index 2e0ddfdaefcc..5f62381f8b3b 100644 --- a/erpnext/stock/doctype/item_price/item_price.json +++ b/erpnext/stock/doctype/item_price/item_price.json @@ -172,7 +172,7 @@ "default": "Today", "fieldname": "valid_from", "fieldtype": "Date", - "label": "Valid From " + "label": "Valid From" }, { "default": "0", @@ -187,7 +187,7 @@ { "fieldname": "valid_upto", "fieldtype": "Date", - "label": "Valid Upto " + "label": "Valid Upto" }, { "fieldname": "section_break_24", @@ -208,7 +208,7 @@ "icon": "fa fa-flag", "idx": 1, "links": [], - "modified": "2020-02-28 14:21:25.580331", + "modified": "2020-07-06 22:31:32.943475", "modified_by": "Administrator", "module": "Stock", "name": "Item Price", From f3a6e30e6ab73a6f81df698cd9216ef565a32e22 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 8 Jul 2020 10:45:55 +0530 Subject: [PATCH 21/49] fix: Check if homepage is not setup-wizard The new desk changes sets the default homepage to 'workspace'. To avoid problem in the future, check if the value is not setup-wizard. Also throw an exception if the check passes, so it exits with error. --- erpnext/setup/install.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 74ff0ecfd8f6..44f26bfd4aba 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -29,12 +29,12 @@ def after_install(): def check_setup_wizard_not_completed(): - if frappe.db.get_default('desktop:home_page') == 'desktop': - print() - print("ERPNext can only be installed on a fresh site where the setup wizard is not completed") - print("You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall") - print() - return False + if frappe.db.get_default('desktop:home_page') != 'setup-wizard': + message = """Cannot install ERPNext. + +ERPNext can only be installed on a fresh site where the setup wizard is not completed. +You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall""" + frappe.throw(message, exc=frappe.IncompatibleApp) def set_single_defaults(): From 0a06580e2c5e66c59b66d42878d26846c8320dcd Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 8 Jul 2020 12:06:28 +0530 Subject: [PATCH 22/49] fix: Update message Co-authored-by: gavin --- erpnext/setup/install.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 44f26bfd4aba..d470d75a8fce 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -30,9 +30,7 @@ def after_install(): def check_setup_wizard_not_completed(): if frappe.db.get_default('desktop:home_page') != 'setup-wizard': - message = """Cannot install ERPNext. - -ERPNext can only be installed on a fresh site where the setup wizard is not completed. + message = """ERPNext can only be installed on a fresh site where the setup wizard is not completed. You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall""" frappe.throw(message, exc=frappe.IncompatibleApp) @@ -105,4 +103,3 @@ def add_company_to_session_defaults(): "ref_doctype": "Company" }) settings.save() - From e862b3f9ce523422c986642111614f1059b20932 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 8 Jul 2020 12:34:15 +0530 Subject: [PATCH 23/49] Update payroll_entry.js --- erpnext/payroll/doctype/payroll_entry/payroll_entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js index 0415ebf2fce3..8d35a7be4719 100644 --- a/erpnext/payroll/doctype/payroll_entry/payroll_entry.js +++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js @@ -51,7 +51,7 @@ frappe.ui.form.on('Payroll Entry', { doc: frm.doc, method: 'fill_employee_details', }).then(r => { - if (r.docs[0].employees){ + if (r.docs && r.docs[0].employees){ frm.employees = r.docs[0].employees; frm.dirty(); frm.save(); From 1fce8b7475b827c099656ef8447d65dd4b157b98 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 8 Jul 2020 12:40:01 +0530 Subject: [PATCH 24/49] Update leave_application.js --- erpnext/hr/doctype/leave_application/leave_application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js index 9413120bc5f2..4001a4550755 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -41,7 +41,7 @@ frappe.ui.form.on("Leave Application", { if (frm.doc.from_date == frm.doc.to_date && frm.doc.half_day == 1){ frm.doc.half_day_date = frm.doc.from_date; }else if (frm.doc.half_day == 0){ - frm.doc.half_day_date = undefined; + frm.doc.half_day_date = ""; } frm.toggle_reqd("half_day_date", frm.doc.half_day == 1); }, From 5d514fe4df89575b4d4111be9d55d216293eafdc Mon Sep 17 00:00:00 2001 From: Michelle Alva <50285544+michellealva@users.noreply.github.com> Date: Wed, 8 Jul 2020 14:25:51 +0530 Subject: [PATCH 25/49] fix: grammatical fixes in module onboarding (#22580) * fix: grammatical fixes in module onboarding * fix: more grammatical changes for consistency * fix: Reorder Stock Onboarding * fix: update success message * fix: change order of stock onboarding steps Co-authored-by: Marica --- .../module_onboarding/accounts/accounts.json | 9 +++-- .../create_a_customer/create_a_customer.json | 2 +- .../create_a_product/create_a_product.json | 4 +-- .../module_onboarding/assets/assets.json | 11 +++---- .../create_a_fixed_asset_item.json | 5 ++- .../create_an_asset/create_an_asset.json | 5 ++- .../create_an_asset_category.json | 33 ++++++++++--------- .../introduction_to_assets.json | 3 ++ .../purchase_an_asset_item.json | 5 ++- .../module_onboarding/buying/buying.json | 7 ++-- .../buying_settings/buying_settings.json | 10 +++--- .../setup_your_warehouse.json | 4 +-- erpnext/crm/module_onboarding/crm/crm.json | 9 +++-- .../healthcare/healthcare.json | 9 +++-- .../human_resource/human_resource.json | 9 +++-- .../manufacturing/manufacturing.json | 10 +++--- .../module_onboarding/payroll/payroll.json | 9 +++-- .../create_employee/create_employee.json | 2 +- .../create_payroll_period.json | 2 +- .../payroll_settings/payroll_settings.json | 10 +++--- .../module_onboarding/selling/selling.json | 7 ++-- .../setup_your_warehouse.json | 4 +-- .../stock/module_onboarding/stock/stock.json | 4 +-- .../create_a_supplier/create_a_supplier.json | 2 +- .../setup_your_warehouse.json | 4 +-- 25 files changed, 93 insertions(+), 86 deletions(-) diff --git a/erpnext/accounts/module_onboarding/accounts/accounts.json b/erpnext/accounts/module_onboarding/accounts/accounts.json index 12da4400284c..ba1a779b4c17 100644 --- a/erpnext/accounts/module_onboarding/accounts/accounts.json +++ b/erpnext/accounts/module_onboarding/accounts/accounts.json @@ -13,7 +13,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/accounts", "idx": 0, "is_complete": 0, - "modified": "2020-05-14 22:11:06.475938", + "modified": "2020-07-08 14:06:09.033880", "modified_by": "Administrator", "module": "Accounts", "name": "Accounts", @@ -44,8 +44,7 @@ "step": "Configure Account Settings" } ], - "subtitle": "Accounts, invoices and taxation.", - "success_message": "The Accounts module is now set up!", - "title": "Let's Setup Your Accounts and Taxes.", - "user_can_dismiss": 1 + "subtitle": "Accounts, Invoices, Taxation, and more.", + "success_message": "The Accounts Module is all set up!", + "title": "Let's Set Up Your Accounts and Taxes." } \ No newline at end of file diff --git a/erpnext/accounts/onboarding_step/create_a_customer/create_a_customer.json b/erpnext/accounts/onboarding_step/create_a_customer/create_a_customer.json index bb396d268ae6..5a403b06cf0e 100644 --- a/erpnext/accounts/onboarding_step/create_a_customer/create_a_customer.json +++ b/erpnext/accounts/onboarding_step/create_a_customer/create_a_customer.json @@ -8,7 +8,7 @@ "is_mandatory": 0, "is_single": 0, "is_skipped": 0, - "modified": "2020-05-14 17:46:41.831517", + "modified": "2020-06-01 13:16:19.731719", "modified_by": "Administrator", "name": "Create a Customer", "owner": "Administrator", diff --git a/erpnext/accounts/onboarding_step/create_a_product/create_a_product.json b/erpnext/accounts/onboarding_step/create_a_product/create_a_product.json index 450bee1f40b7..d2068e167b75 100644 --- a/erpnext/accounts/onboarding_step/create_a_product/create_a_product.json +++ b/erpnext/accounts/onboarding_step/create_a_product/create_a_product.json @@ -1,6 +1,6 @@ { "action": "Create Entry", - "creation": "2020-05-14 17:45:28.554605", + "creation": "2020-05-12 18:16:06.624554", "docstatus": 0, "doctype": "Onboarding Step", "idx": 0, @@ -8,7 +8,7 @@ "is_mandatory": 0, "is_single": 0, "is_skipped": 0, - "modified": "2020-05-14 17:45:28.554605", + "modified": "2020-05-12 18:30:02.489949", "modified_by": "Administrator", "name": "Create a Product", "owner": "Administrator", diff --git a/erpnext/assets/module_onboarding/assets/assets.json b/erpnext/assets/module_onboarding/assets/assets.json index 66dd60ae81f2..1086ab4bcdb7 100644 --- a/erpnext/assets/module_onboarding/assets/assets.json +++ b/erpnext/assets/module_onboarding/assets/assets.json @@ -13,7 +13,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/asset", "idx": 0, "is_complete": 0, - "modified": "2020-05-08 16:17:31.685943", + "modified": "2020-07-08 14:05:51.828497", "modified_by": "Administrator", "module": "Assets", "name": "Assets", @@ -27,7 +27,7 @@ }, { "step": "Create an Asset Category" - }, + }, { "step": "Purchase an Asset Item" }, @@ -35,8 +35,7 @@ "step": "Create an Asset" } ], - "subtitle": "Assets, Depreciations, Repairs and more", - "success_message": "The Asset Module is all set up!", - "title": "Let's Setup Asset Management", - "user_can_dismiss": 1 + "subtitle": "Assets, Depreciations, Repairs, and more.", + "success_message": "The Assets Module is all set up!", + "title": "Let's Set Up the Assets Module." } \ No newline at end of file diff --git a/erpnext/assets/onboarding_step/create_a_fixed_asset_item/create_a_fixed_asset_item.json b/erpnext/assets/onboarding_step/create_a_fixed_asset_item/create_a_fixed_asset_item.json index f5818c091f17..51702d9cb52b 100644 --- a/erpnext/assets/onboarding_step/create_a_fixed_asset_item/create_a_fixed_asset_item.json +++ b/erpnext/assets/onboarding_step/create_a_fixed_asset_item/create_a_fixed_asset_item.json @@ -6,11 +6,14 @@ "idx": 0, "is_complete": 0, "is_mandatory": 0, + "is_single": 0, "is_skipped": 0, "modified": "2020-05-08 13:20:00.259985", "modified_by": "Administrator", "name": "Create a Fixed Asset Item", "owner": "Administrator", "reference_document": "Item", - "title": "Create a Fixed Asset Item" + "show_full_form": 0, + "title": "Create a Fixed Asset Item", + "validate_action": 0 } \ No newline at end of file diff --git a/erpnext/assets/onboarding_step/create_an_asset/create_an_asset.json b/erpnext/assets/onboarding_step/create_an_asset/create_an_asset.json index 5488b1d7b4e5..b4f8a05e378a 100644 --- a/erpnext/assets/onboarding_step/create_an_asset/create_an_asset.json +++ b/erpnext/assets/onboarding_step/create_an_asset/create_an_asset.json @@ -6,11 +6,14 @@ "idx": 0, "is_complete": 0, "is_mandatory": 0, + "is_single": 0, "is_skipped": 0, "modified": "2020-05-08 13:21:53.332538", "modified_by": "Administrator", "name": "Create an Asset", "owner": "Administrator", "reference_document": "Asset", - "title": "Create an Asset" + "show_full_form": 0, + "title": "Create an Asset", + "validate_action": 0 } \ No newline at end of file diff --git a/erpnext/assets/onboarding_step/create_an_asset_category/create_an_asset_category.json b/erpnext/assets/onboarding_step/create_an_asset_category/create_an_asset_category.json index 3bf54af348ad..ffdb954b951f 100644 --- a/erpnext/assets/onboarding_step/create_an_asset_category/create_an_asset_category.json +++ b/erpnext/assets/onboarding_step/create_an_asset_category/create_an_asset_category.json @@ -1,16 +1,19 @@ { - "action": "Create Entry", - "creation": "2020-05-08 13:21:53.332538", - "docstatus": 0, - "doctype": "Onboarding Step", - "idx": 0, - "is_complete": 0, - "is_mandatory": 0, - "is_skipped": 0, - "modified": "2020-05-08 13:21:53.332538", - "modified_by": "Administrator", - "name": "Create an Asset Category", - "owner": "Administrator", - "reference_document": "Asset Category", - "title": "Create an Asset Category" - } \ No newline at end of file + "action": "Create Entry", + "creation": "2020-05-08 13:21:53.332538", + "docstatus": 0, + "doctype": "Onboarding Step", + "idx": 0, + "is_complete": 0, + "is_mandatory": 0, + "is_single": 0, + "is_skipped": 0, + "modified": "2020-05-08 13:21:53.332538", + "modified_by": "Administrator", + "name": "Create an Asset Category", + "owner": "Administrator", + "reference_document": "Asset Category", + "show_full_form": 0, + "title": "Create an Asset Category", + "validate_action": 0 +} \ No newline at end of file diff --git a/erpnext/assets/onboarding_step/introduction_to_assets/introduction_to_assets.json b/erpnext/assets/onboarding_step/introduction_to_assets/introduction_to_assets.json index d48dd1cd3d25..d89da2719710 100644 --- a/erpnext/assets/onboarding_step/introduction_to_assets/introduction_to_assets.json +++ b/erpnext/assets/onboarding_step/introduction_to_assets/introduction_to_assets.json @@ -6,11 +6,14 @@ "idx": 0, "is_complete": 0, "is_mandatory": 0, + "is_single": 0, "is_skipped": 0, "modified": "2020-05-08 16:06:16.625646", "modified_by": "Administrator", "name": "Introduction to Assets", "owner": "Administrator", + "show_full_form": 0, "title": "Introduction to Assets", + "validate_action": 0, "video_url": "https://www.youtube.com/watch?v=I-K8pLRmvSo" } \ No newline at end of file diff --git a/erpnext/assets/onboarding_step/purchase_an_asset_item/purchase_an_asset_item.json b/erpnext/assets/onboarding_step/purchase_an_asset_item/purchase_an_asset_item.json index 732ff7f733b5..ce3185ef449d 100644 --- a/erpnext/assets/onboarding_step/purchase_an_asset_item/purchase_an_asset_item.json +++ b/erpnext/assets/onboarding_step/purchase_an_asset_item/purchase_an_asset_item.json @@ -6,11 +6,14 @@ "idx": 0, "is_complete": 0, "is_mandatory": 0, + "is_single": 0, "is_skipped": 0, "modified": "2020-05-08 13:21:28.208059", "modified_by": "Administrator", "name": "Purchase an Asset Item", "owner": "Administrator", "reference_document": "Purchase Receipt", - "title": "Purchase an Asset Item" + "show_full_form": 0, + "title": "Purchase an Asset Item", + "validate_action": 0 } \ No newline at end of file diff --git a/erpnext/buying/module_onboarding/buying/buying.json b/erpnext/buying/module_onboarding/buying/buying.json index 6e4bbc95a249..887f85b82d16 100644 --- a/erpnext/buying/module_onboarding/buying/buying.json +++ b/erpnext/buying/module_onboarding/buying/buying.json @@ -19,7 +19,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/buying", "idx": 0, "is_complete": 0, - "modified": "2020-06-01 12:55:09.234944", + "modified": "2020-07-08 14:05:28.273641", "modified_by": "Administrator", "module": "Buying", "name": "Buying", @@ -47,8 +47,7 @@ "step": "Buying Settings" } ], - "subtitle": "Products, Purchases, Analysis and more.", + "subtitle": "Products, Purchases, Analysis, and more.", "success_message": "The Buying Module is all set up!", - "title": "Let's Set Up the Buying Module.", - "user_can_dismiss": 1 + "title": "Let's Set Up the Buying Module." } \ No newline at end of file diff --git a/erpnext/buying/onboarding_step/buying_settings/buying_settings.json b/erpnext/buying/onboarding_step/buying_settings/buying_settings.json index 6d765af13731..a788ccd4cc9d 100644 --- a/erpnext/buying/onboarding_step/buying_settings/buying_settings.json +++ b/erpnext/buying/onboarding_step/buying_settings/buying_settings.json @@ -1,19 +1,19 @@ { - "action": "Show Form Tour", + "action": "Update Settings", "creation": "2020-05-06 15:53:44.667414", "docstatus": 0, "doctype": "Onboarding Step", "idx": 0, "is_complete": 0, - "is_mandatory": 1, - "is_single": 1, + "is_mandatory": 0, + "is_single": 0, "is_skipped": 0, - "modified": "2020-06-01 12:52:57.668870", + "modified": "2020-05-12 18:30:06.323797", "modified_by": "Administrator", "name": "Buying Settings", "owner": "Administrator", "reference_document": "Buying Settings", "show_full_form": 0, "title": "Configure Buying Settings.", - "validate_action": 0 + "validate_action": 1 } \ No newline at end of file diff --git a/erpnext/buying/onboarding_step/setup_your_warehouse/setup_your_warehouse.json b/erpnext/buying/onboarding_step/setup_your_warehouse/setup_your_warehouse.json index 557c905bd6c6..9457deee2620 100644 --- a/erpnext/buying/onboarding_step/setup_your_warehouse/setup_your_warehouse.json +++ b/erpnext/buying/onboarding_step/setup_your_warehouse/setup_your_warehouse.json @@ -8,13 +8,13 @@ "is_mandatory": 0, "is_single": 0, "is_skipped": 0, - "modified": "2020-05-19 18:54:19.383397", + "modified": "2020-07-04 12:33:16.970031", "modified_by": "Administrator", "name": "Setup your Warehouse", "owner": "Administrator", "path": "Tree/Warehouse", "reference_document": "Warehouse", "show_full_form": 0, - "title": "Setup your Warehouse", + "title": "Set up your Warehouse", "validate_action": 1 } \ No newline at end of file diff --git a/erpnext/crm/module_onboarding/crm/crm.json b/erpnext/crm/module_onboarding/crm/crm.json index 44d672a7b59e..8315218c8425 100644 --- a/erpnext/crm/module_onboarding/crm/crm.json +++ b/erpnext/crm/module_onboarding/crm/crm.json @@ -16,7 +16,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/CRM", "idx": 0, "is_complete": 0, - "modified": "2020-05-28 21:07:41.278784", + "modified": "2020-07-08 14:05:42.644448", "modified_by": "Administrator", "module": "CRM", "name": "CRM", @@ -35,8 +35,7 @@ "step": "Create and Send Quotation" } ], - "subtitle": "Lead, Opportunity, Customer and more.", - "success_message": "CRM Module is all Set Up!", - "title": "Let's Set Up Your CRM.", - "user_can_dismiss": 1 + "subtitle": "Lead, Opportunity, Customer, and more.", + "success_message": "The CRM Module is all set up!", + "title": "Let's Set Up Your CRM." } \ No newline at end of file diff --git a/erpnext/healthcare/module_onboarding/healthcare/healthcare.json b/erpnext/healthcare/module_onboarding/healthcare/healthcare.json index 3e50726060a2..56c3c1355998 100644 --- a/erpnext/healthcare/module_onboarding/healthcare/healthcare.json +++ b/erpnext/healthcare/module_onboarding/healthcare/healthcare.json @@ -10,7 +10,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/healthcare", "idx": 0, "is_complete": 0, - "modified": "2020-05-26 23:16:37.603361", + "modified": "2020-07-08 14:06:19.512946", "modified_by": "Administrator", "module": "Healthcare", "name": "Healthcare", @@ -35,8 +35,7 @@ "step": "Explore Clinical Procedure Templates" } ], - "subtitle": "Patients, Practitioner Schedules, Settings and more.", - "success_message": "Yayy! The Healthcare Module is all set up!", - "title": "Let's Setup the Healthcare Module", - "user_can_dismiss": 1 + "subtitle": "Patients, Practitioner Schedules, Settings, and more.", + "success_message": "The Healthcare Module is all set up!", + "title": "Let's Set Up the Healthcare Module." } \ No newline at end of file diff --git a/erpnext/hr/module_onboarding/human_resource/human_resource.json b/erpnext/hr/module_onboarding/human_resource/human_resource.json index e64582b407cb..518c002bcaa4 100644 --- a/erpnext/hr/module_onboarding/human_resource/human_resource.json +++ b/erpnext/hr/module_onboarding/human_resource/human_resource.json @@ -13,7 +13,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources", "idx": 0, "is_complete": 0, - "modified": "2020-05-20 11:20:07.992597", + "modified": "2020-07-08 14:05:47.018799", "modified_by": "Administrator", "module": "HR", "name": "Human Resource", @@ -44,8 +44,7 @@ "step": "HR Settings" } ], - "subtitle": "Employee, Leaves and more.", - "success_message": "The HR Module is all set up!", - "title": "Let's Setup the Human Resource Module. ", - "user_can_dismiss": 0 + "subtitle": "Employee, Leaves, and more.", + "success_message": "The Human Resource Module is all set up!", + "title": "Let's Set Up the Human Resource Module. " } \ No newline at end of file diff --git a/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json b/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json index a36b63a1d951..7b5747e393f2 100644 --- a/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json +++ b/erpnext/manufacturing/module_onboarding/manufacturing/manufacturing.json @@ -19,7 +19,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/manufacturing", "idx": 0, "is_complete": 0, - "modified": "2020-06-29 20:25:36.899106", + "modified": "2020-07-08 14:05:56.197563", "modified_by": "Administrator", "module": "Manufacturing", "name": "Manufacturing", @@ -50,7 +50,7 @@ "step": "Explore Manufacturing Settings" } ], - "subtitle": "Products, Raw Materials, BOM, Work Order and more.", - "success_message": "Manufacturing module is all setup!", - "title": "Let's Set Up the Manufacturing Module" -} + "subtitle": "Products, Raw Materials, BOM, Work Order, and more.", + "success_message": "Manufacturing module is all set up!", + "title": "Let's Set Up the Manufacturing Module." +} \ No newline at end of file diff --git a/erpnext/payroll/module_onboarding/payroll/payroll.json b/erpnext/payroll/module_onboarding/payroll/payroll.json index 7ed786faeea2..b5226b2aca37 100644 --- a/erpnext/payroll/module_onboarding/payroll/payroll.json +++ b/erpnext/payroll/module_onboarding/payroll/payroll.json @@ -13,7 +13,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources/payroll-entry", "idx": 0, "is_complete": 0, - "modified": "2020-06-29 17:00:25.113341", + "modified": "2020-07-08 14:06:13.994310", "modified_by": "Administrator", "module": "Payroll", "name": "Payroll", @@ -44,8 +44,7 @@ "step": "Payroll Settings" } ], - "subtitle": "Salary, Compensations and more.", - "success_message": "The Payroll is all set up!", - "title": "Let's Setup the Payroll Module. ", - "user_can_dismiss": 1 + "subtitle": "Salary, Compensation, and more.", + "success_message": "The Payroll Module is all set up!", + "title": "Let's Set Up the Payroll Module. " } \ No newline at end of file diff --git a/erpnext/payroll/onboarding_step/create_employee/create_employee.json b/erpnext/payroll/onboarding_step/create_employee/create_employee.json index 5839ae6ca4a9..3aa33c6d862a 100644 --- a/erpnext/payroll/onboarding_step/create_employee/create_employee.json +++ b/erpnext/payroll/onboarding_step/create_employee/create_employee.json @@ -15,5 +15,5 @@ "reference_document": "Employee", "show_full_form": 0, "title": "Create Employee", - "validate_action": 1 + "validate_action": 0 } \ No newline at end of file diff --git a/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json b/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json index b1a7cc27344b..4bae67546c70 100644 --- a/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json +++ b/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json @@ -8,7 +8,7 @@ "is_mandatory": 1, "is_single": 0, "is_skipped": 0, - "modified": "2020-06-29 11:53:54.553947", + "modified": "2020-06-01 11:53:54.553947", "modified_by": "Administrator", "name": "Create Payroll Period", "owner": "Administrator", diff --git a/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json b/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json index a7cf7bf98841..946b8c8707ab 100644 --- a/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json +++ b/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json @@ -1,19 +1,19 @@ { - "action": "Update Settings", + "action": "Go to Page", "creation": "2020-06-04 16:34:29.664917", "docstatus": 0, "doctype": "Onboarding Step", "idx": 0, "is_complete": 0, "is_mandatory": 0, - "is_single": 1, + "is_single": 0, "is_skipped": 0, - "modified": "2020-06-29 16:34:29.664917", + "modified": "2020-06-04 16:34:29.664917", "modified_by": "Administrator", "name": "Payroll Settings", "owner": "Administrator", - "reference_document": "Payroll Settings", + "path": "#Form/Payroll Settings", "show_full_form": 0, "title": "Payroll Settings", - "validate_action": 0 + "validate_action": 1 } \ No newline at end of file diff --git a/erpnext/selling/module_onboarding/selling/selling.json b/erpnext/selling/module_onboarding/selling/selling.json index 10a33c9cf52b..160208ff6802 100644 --- a/erpnext/selling/module_onboarding/selling/selling.json +++ b/erpnext/selling/module_onboarding/selling/selling.json @@ -19,7 +19,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/selling", "idx": 0, "is_complete": 0, - "modified": "2020-06-01 13:35:16.100512", + "modified": "2020-07-08 14:05:37.669753", "modified_by": "Administrator", "module": "Selling", "name": "Selling", @@ -47,8 +47,7 @@ "step": "Selling Settings" } ], - "subtitle": "Products, Sales, Analysis and more.", + "subtitle": "Products, Sales, Analysis, and more.", "success_message": "The Selling Module is all set up!", - "title": "Let's Set Up the Selling Module.", - "user_can_dismiss": 1 + "title": "Let's Set Up the Selling Module." } \ No newline at end of file diff --git a/erpnext/selling/onboarding_step/setup_your_warehouse/setup_your_warehouse.json b/erpnext/selling/onboarding_step/setup_your_warehouse/setup_your_warehouse.json index 557c905bd6c6..9457deee2620 100644 --- a/erpnext/selling/onboarding_step/setup_your_warehouse/setup_your_warehouse.json +++ b/erpnext/selling/onboarding_step/setup_your_warehouse/setup_your_warehouse.json @@ -8,13 +8,13 @@ "is_mandatory": 0, "is_single": 0, "is_skipped": 0, - "modified": "2020-05-19 18:54:19.383397", + "modified": "2020-07-04 12:33:16.970031", "modified_by": "Administrator", "name": "Setup your Warehouse", "owner": "Administrator", "path": "Tree/Warehouse", "reference_document": "Warehouse", "show_full_form": 0, - "title": "Setup your Warehouse", + "title": "Set up your Warehouse", "validate_action": 1 } \ No newline at end of file diff --git a/erpnext/stock/module_onboarding/stock/stock.json b/erpnext/stock/module_onboarding/stock/stock.json index 10f05d452018..1d5bf8c97ca7 100644 --- a/erpnext/stock/module_onboarding/stock/stock.json +++ b/erpnext/stock/module_onboarding/stock/stock.json @@ -19,7 +19,7 @@ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/stock", "idx": 0, "is_complete": 0, - "modified": "2020-06-29 16:41:09.440378", + "modified": "2020-07-08 14:22:07.951891", "modified_by": "Administrator", "module": "Stock", "name": "Stock", @@ -47,7 +47,7 @@ "step": "Stock Settings" } ], - "subtitle": "Inventory, Warehouses, Analysis and more.", + "subtitle": "Inventory, Warehouses, Analysis, and more.", "success_message": "The Stock Module is all set up!", "title": "Let's Set Up the Stock Module." } \ No newline at end of file diff --git a/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json b/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json index 4e753f4d84ef..7a64224bd432 100644 --- a/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json +++ b/erpnext/stock/onboarding_step/create_a_supplier/create_a_supplier.json @@ -8,7 +8,7 @@ "is_mandatory": 0, "is_single": 0, "is_skipped": 0, - "modified": "2020-06-29 16:36:53.948242", + "modified": "2020-05-14 22:09:10.043554", "modified_by": "Administrator", "name": "Create a Supplier", "owner": "Administrator", diff --git a/erpnext/stock/onboarding_step/setup_your_warehouse/setup_your_warehouse.json b/erpnext/stock/onboarding_step/setup_your_warehouse/setup_your_warehouse.json index 557c905bd6c6..9457deee2620 100644 --- a/erpnext/stock/onboarding_step/setup_your_warehouse/setup_your_warehouse.json +++ b/erpnext/stock/onboarding_step/setup_your_warehouse/setup_your_warehouse.json @@ -8,13 +8,13 @@ "is_mandatory": 0, "is_single": 0, "is_skipped": 0, - "modified": "2020-05-19 18:54:19.383397", + "modified": "2020-07-04 12:33:16.970031", "modified_by": "Administrator", "name": "Setup your Warehouse", "owner": "Administrator", "path": "Tree/Warehouse", "reference_document": "Warehouse", "show_full_form": 0, - "title": "Setup your Warehouse", + "title": "Set up your Warehouse", "validate_action": 1 } \ No newline at end of file From e0ff0cfcb9f03fc09d40b2d640adfb21af8c1779 Mon Sep 17 00:00:00 2001 From: Afshan <33727827+AfshanKhan@users.noreply.github.com> Date: Wed, 8 Jul 2020 14:40:22 +0530 Subject: [PATCH 26/49] fix: fetch "Employee Leave Policy" from "Employee Grade" if available (#22570) * fix:fetch "Employee Leave Policy" from "Employee Grade" if available * fix: checked "Fetch IF Empty" checkbox Co-authored-by: Marica --- erpnext/hr/doctype/employee/employee.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json index 7dacacf12b05..f2afe065d1ed 100644 --- a/erpnext/hr/doctype/employee/employee.json +++ b/erpnext/hr/doctype/employee/employee.json @@ -410,6 +410,8 @@ "options": "Branch" }, { + "fetch_from": "grade.default_leave_policy", + "fetch_if_empty": 1, "fieldname": "leave_policy", "fieldtype": "Link", "label": "Leave Policy", @@ -804,16 +806,14 @@ "fieldname": "expense_approver", "fieldtype": "Link", "label": "Expense Approver", - "options": "User", - "show_days": 1, - "show_seconds": 1 + "options": "User" } ], "icon": "fa fa-user", "idx": 24, "image_field": "image", "links": [], - "modified": "2020-06-18 18:01:27.223535", + "modified": "2020-07-03 21:28:04.109189", "modified_by": "Administrator", "module": "HR", "name": "Employee", From 45b01d2c0242b95af45495362cecd9ccc814869b Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Wed, 8 Jul 2020 15:39:45 +0530 Subject: [PATCH 27/49] feat: add medical coding fields to Healthcare DocTypes (#22501) * feat: add medical coding fields to templates * feat: fetch medical codes from templates in forms * fix: codacy issues Co-authored-by: Marica --- .../clinical_procedure.json | 11 +- .../clinical_procedure_template.js | 10 + .../clinical_procedure_template.json | 25 ++- .../healthcare/doctype/lab_test/lab_test.json | 13 +- .../lab_test_template/lab_test_template.js | 11 +- .../lab_test_template/lab_test_template.json | 24 ++- .../doctype/medical_code/medical_code.json | 203 +++++------------- .../therapy_session/therapy_session.json | 11 +- .../doctype/therapy_type/therapy_type.js | 10 + .../doctype/therapy_type/therapy_type.json | 25 ++- 10 files changed, 189 insertions(+), 154 deletions(-) diff --git a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.json b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.json index eaf8d80ba8c7..b1d62da03256 100644 --- a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.json +++ b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.json @@ -11,6 +11,7 @@ "title", "appointment", "procedure_template", + "medical_code", "column_break_30", "company", "invoiced", @@ -290,11 +291,19 @@ "no_copy": 1, "print_hide": 1, "read_only": 1 + }, + { + "fetch_from": "procedure_template.medical_code", + "fieldname": "medical_code", + "fieldtype": "Link", + "label": "Medical Code", + "options": "Medical Code", + "read_only": 1 } ], "is_submittable": 1, "links": [], - "modified": "2020-04-27 21:36:23.796924", + "modified": "2020-06-29 14:28:11.779815", "modified_by": "Administrator", "module": "Healthcare", "name": "Clinical Procedure", diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.js b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.js index 16d4540c7c5b..1ef110dc6f46 100644 --- a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.js +++ b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.js @@ -30,6 +30,16 @@ frappe.ui.form.on('Clinical Procedure Template', { mark_change_in_item(frm); }, + medical_code: function(frm) { + frm.set_query("medical_code", function() { + return { + filters: { + medical_code_standard: frm.doc.medical_code_standard + } + }; + }); + }, + refresh: function(frm) { frm.fields_dict['items'].grid.set_column_disp('barcode', false); frm.fields_dict['items'].grid.set_column_disp('batch_no', false); diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json index 9cfd682f1d2d..17ac7eb1f957 100644 --- a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json +++ b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json @@ -21,6 +21,9 @@ "is_billable", "rate", "medical_department", + "medical_coding_section", + "medical_code_standard", + "medical_code", "consumables", "consume_stock", "items", @@ -46,7 +49,6 @@ "fieldname": "item_code", "fieldtype": "Data", "label": "Item Code", - "options": "Item", "read_only_depends_on": "eval: !doc.__islocal ", "reqd": 1 }, @@ -173,10 +175,29 @@ "no_copy": 1, "options": "Item", "read_only": 1 + }, + { + "collapsible": 1, + "fieldname": "medical_coding_section", + "fieldtype": "Section Break", + "label": "Medical Coding" + }, + { + "fieldname": "medical_code_standard", + "fieldtype": "Link", + "label": "Medical Code Standard", + "options": "Medical Code Standard" + }, + { + "depends_on": "medical_code_standard", + "fieldname": "medical_code", + "fieldtype": "Link", + "label": "Medical Code", + "options": "Medical Code" } ], "links": [], - "modified": "2020-02-28 14:16:13.184981", + "modified": "2020-06-29 14:12:27.158130", "modified_by": "Administrator", "module": "Healthcare", "name": "Clinical Procedure Template", diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.json b/erpnext/healthcare/doctype/lab_test/lab_test.json index 17dc1edd8c16..88eeb46a2425 100644 --- a/erpnext/healthcare/doctype/lab_test/lab_test.json +++ b/erpnext/healthcare/doctype/lab_test/lab_test.json @@ -33,9 +33,10 @@ "user", "invoiced", "sb_first", + "template", "lab_test_name", "column_break_26", - "template", + "medical_code", "lab_test_group", "sb_normal", "normal_test_items", @@ -424,11 +425,19 @@ "print_hide": 1, "read_only": 1, "report_hide": 1 + }, + { + "fetch_from": "template.medical_code", + "fieldname": "medical_code", + "fieldtype": "Link", + "label": "Medical Code", + "options": "Medical Code", + "read_only": 1 } ], "is_submittable": 1, "links": [], - "modified": "2020-04-04 19:16:29.131168", + "modified": "2020-06-29 14:24:26.509721", "modified_by": "Administrator", "module": "Healthcare", "name": "Lab Test", diff --git a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.js b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.js index 5c9bf49e608b..c3eedbbdf1fc 100644 --- a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.js +++ b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.js @@ -8,7 +8,7 @@ frappe.ui.form.on("Lab Test Template",{ if (!frm.doc.lab_test_description) frm.set_value("lab_test_description", frm.doc.lab_test_name); }, - refresh : function(frm) { + refresh: function(frm) { // Restrict Special, Grouped type templates in Child TestGroups frm.set_query("lab_test_template", "lab_test_groups", function() { return { @@ -17,6 +17,15 @@ frappe.ui.form.on("Lab Test Template",{ } }; }); + }, + medical_code: function(frm) { + frm.set_query("medical_code", function() { + return { + filters: { + medical_code_standard: frm.doc.medical_code_standard + } + }; + }); } }); diff --git a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json index a606bc4b1d0d..ebd2ec0246f8 100644 --- a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json +++ b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.json @@ -19,6 +19,9 @@ "disabled", "is_billable", "lab_test_rate", + "medical_coding_section", + "medical_code_standard", + "medical_code", "section_break_normal", "lab_test_uom", "lab_test_normal_range", @@ -237,10 +240,29 @@ "fieldtype": "Text", "ignore_xss_filter": 1, "label": "Collection Details" + }, + { + "collapsible": 1, + "fieldname": "medical_coding_section", + "fieldtype": "Section Break", + "label": "Medical Coding" + }, + { + "depends_on": "medical_code_standard", + "fieldname": "medical_code", + "fieldtype": "Link", + "label": "Medical Code", + "options": "Medical Code" + }, + { + "fieldname": "medical_code_standard", + "fieldtype": "Link", + "label": "Medical Code Standard", + "options": "Medical Code Standard" } ], "links": [], - "modified": "2020-03-25 16:53:01.740103", + "modified": "2020-06-29 14:07:20.772219", "modified_by": "Administrator", "module": "Healthcare", "name": "Lab Test Template", diff --git a/erpnext/healthcare/doctype/medical_code/medical_code.json b/erpnext/healthcare/doctype/medical_code/medical_code.json index a2e72475179e..5d6983090763 100644 --- a/erpnext/healthcare/doctype/medical_code/medical_code.json +++ b/erpnext/healthcare/doctype/medical_code/medical_code.json @@ -1,156 +1,69 @@ { - "allow_copy": 1, - "allow_guest_to_view": 0, - "allow_import": 1, - "allow_rename": 1, - "beta": 1, - "creation": "2017-06-21 13:02:56.122897", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "actions": [], + "allow_copy": 1, + "allow_import": 1, + "allow_rename": 1, + "beta": 1, + "creation": "2017-06-21 13:02:56.122897", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "medical_code_standard", + "code", + "description" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "medical_code_standard", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Medical Code Standard", - "length": 0, - "no_copy": 0, - "options": "Medical Code Standard", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, + "fieldname": "medical_code_standard", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Medical Code Standard", + "options": "Medical Code Standard", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "code", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 1, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Code", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, + "fieldname": "code", + "fieldtype": "Data", + "ignore_xss_filter": 1, + "in_list_view": 1, + "label": "Code", + "reqd": 1, + "unique": 1 + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 0, - "fieldname": "description", - "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 1, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "bold": 1, + "fieldname": "description", + "fieldtype": "Small Text", + "ignore_xss_filter": 1, + "in_list_view": 1, + "label": "Description" } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2017-10-04 17:08:11.053418", - "modified_by": "Administrator", - "module": "Healthcare", - "name": "Medical Code", - "name_case": "", - "owner": "Administrator", + ], + "links": [], + "modified": "2020-06-29 14:02:30.980032", + "modified_by": "Administrator", + "module": "Healthcare", + "name": "Medical Code", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Physician", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Physician", + "share": 1, "write": 1 } - ], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "restrict_to_domain": "Healthcare", - "search_fields": "code, description", - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "title_field": "", - "track_changes": 1, - "track_seen": 0 + ], + "quick_entry": 1, + "restrict_to_domain": "Healthcare", + "search_fields": "code, description", + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/healthcare/doctype/therapy_session/therapy_session.json b/erpnext/healthcare/doctype/therapy_session/therapy_session.json index 00d74a09495c..c75d9342ef1b 100644 --- a/erpnext/healthcare/doctype/therapy_session/therapy_session.json +++ b/erpnext/healthcare/doctype/therapy_session/therapy_session.json @@ -19,6 +19,7 @@ "practitioner", "department", "details_section", + "medical_code", "duration", "rate", "location", @@ -206,11 +207,19 @@ "fieldtype": "Data", "label": "Patient Name", "read_only": 1 + }, + { + "fetch_from": "therapy_type.medical_code", + "fieldname": "medical_code", + "fieldtype": "Link", + "label": "Medical Code", + "options": "Medical Code", + "read_only": 1 } ], "is_submittable": 1, "links": [], - "modified": "2020-04-29 16:49:16.286006", + "modified": "2020-06-29 14:33:34.836594", "modified_by": "Administrator", "module": "Healthcare", "name": "Therapy Session", diff --git a/erpnext/healthcare/doctype/therapy_type/therapy_type.js b/erpnext/healthcare/doctype/therapy_type/therapy_type.js index 7a61b0def033..6e155dc21f92 100644 --- a/erpnext/healthcare/doctype/therapy_type/therapy_type.js +++ b/erpnext/healthcare/doctype/therapy_type/therapy_type.js @@ -45,6 +45,16 @@ frappe.ui.form.on('Therapy Type', { medical_department: function(frm) { mark_change_in_item(frm); + }, + + medical_code: function(frm) { + frm.set_query("medical_code", function() { + return { + filters: { + medical_code_standard: frm.doc.medical_code_standard + } + }; + }); } }); diff --git a/erpnext/healthcare/doctype/therapy_type/therapy_type.json b/erpnext/healthcare/doctype/therapy_type/therapy_type.json index 0b3c3caeaabf..f365b1df0326 100644 --- a/erpnext/healthcare/doctype/therapy_type/therapy_type.json +++ b/erpnext/healthcare/doctype/therapy_type/therapy_type.json @@ -22,6 +22,9 @@ "item_group", "column_break_12", "description", + "medical_coding_section", + "medical_code_standard", + "medical_code", "section_break_18", "therapy_for", "add_exercises", @@ -160,10 +163,30 @@ { "fieldname": "section_break_18", "fieldtype": "Section Break" + }, + { + "collapsible": 1, + "fieldname": "medical_coding_section", + "fieldtype": "Section Break", + "label": "Medical Coding", + "options": "Medical Coding" + }, + { + "fieldname": "medical_code_standard", + "fieldtype": "Link", + "label": "Medical Code Standard", + "options": "Medical Code Standard" + }, + { + "depends_on": "medical_code_standard", + "fieldname": "medical_code", + "fieldtype": "Link", + "label": "Medical Code", + "options": "Medical Code" } ], "links": [], - "modified": "2020-04-21 13:09:04.006289", + "modified": "2020-06-29 14:18:50.669951", "modified_by": "Administrator", "module": "Healthcare", "name": "Therapy Type", From 6c6c36e7805efe461d15158d03a16db6c79c6b37 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Thu, 9 Jul 2020 11:23:41 +0530 Subject: [PATCH 28/49] fix: attribute error while cancelling patient encounter --- .../healthcare/doctype/patient_encounter/patient_encounter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py index 56401a3e742a..262fc4650af7 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py @@ -73,7 +73,7 @@ def update_encounter_medical_record(encounter): insert_encounter_to_medical_record(encounter) def delete_medical_record(encounter): - frappe.db.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name) + frappe.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name) def set_subject_field(encounter): subject = frappe.bold(_('Healthcare Practitioner: ')) + encounter.practitioner + '
' From cdf55cef80ddaf170159237d1d558e1949e0c8f8 Mon Sep 17 00:00:00 2001 From: Rohan Date: Thu, 9 Jul 2020 11:36:01 +0530 Subject: [PATCH 29/49] fix: fetch project-related info in Timesheet (#22423) Co-authored-by: Marica --- erpnext/projects/doctype/task/task.js | 69 +++++++++---------------- erpnext/projects/doctype/task/task.json | 1 + erpnext/projects/doctype/task/task.py | 25 ++++++++- 3 files changed, 47 insertions(+), 48 deletions(-) diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js index 5719276669a5..a044e1dca890 100644 --- a/erpnext/projects/doctype/task/task.js +++ b/erpnext/projects/doctype/task/task.js @@ -3,55 +3,36 @@ frappe.provide("erpnext.projects"); -cur_frm.add_fetch("project", "company", "company"); - frappe.ui.form.on("Task", { - onload: function(frm) { - frm.set_query("task", "depends_on", function() { - var filters = { + setup: function (frm) { + frm.set_query("project", function () { + return { + query: "erpnext.projects.doctype.task.task.get_project" + } + }); + + frm.make_methods = { + 'Timesheet': () => frappe.model.open_mapped_doc({ + method: 'erpnext.projects.doctype.task.task.make_timesheet', + frm: frm + }) + } + }, + + onload: function (frm) { + frm.set_query("task", "depends_on", function () { + let filters = { name: ["!=", frm.doc.name] }; - if(frm.doc.project) filters["project"] = frm.doc.project; + if (frm.doc.project) filters["project"] = frm.doc.project; return { filters: filters }; }) }, - refresh: function(frm) { - frm.fields_dict['parent_task'].get_query = function () { - return { - filters: { - "is_group": 1, - } - } - } - - if (!frm.doc.is_group) { - if (!frm.is_new()) { - if (frappe.model.can_read("Timesheet")) { - frm.add_custom_button(__("Timesheet"), () => { - frappe.route_options = { "project": frm.doc.project, "task": frm.doc.name } - frappe.set_route("List", "Timesheet"); - }, __("View"), true); - } - - if (frappe.model.can_read("Expense Claim")) { - frm.add_custom_button(__("Expense Claims"), () => { - frappe.route_options = { "project": frm.doc.project, "task": frm.doc.name }; - frappe.set_route("List", "Expense Claim"); - }, __("View"), true); - } - } - } - }, - - setup: function(frm) { - frm.fields_dict.project.get_query = function() { - return { - query: "erpnext.projects.doctype.task.task.get_project" - } - }; + refresh: function (frm) { + frm.set_query("parent_task", { "is_group": 1 }); }, is_group: function (frm) { @@ -69,12 +50,8 @@ frappe.ui.form.on("Task", { }) }, - validate: function(frm) { + validate: function (frm) { frm.doc.project && frappe.model.remove_from_locals("Project", frm.doc.project); - }, - + } }); - -cur_frm.add_fetch('task', 'subject', 'subject'); -cur_frm.add_fetch('task', 'project', 'project'); diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json index 4db1f193ce23..27f1a71a528a 100644 --- a/erpnext/projects/doctype/task/task.json +++ b/erpnext/projects/doctype/task/task.json @@ -325,6 +325,7 @@ "options": "Department" }, { + "fetch_from": "project.company", "fieldname": "company", "fieldtype": "Link", "label": "Company", diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 845cdba8bfae..3b75cf42158b 100755 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -7,10 +7,11 @@ import frappe from frappe import _, throw +from frappe.desk.form.assign_to import clear, close_all_assignments +from frappe.model.mapper import get_mapped_doc from frappe.utils import add_days, cstr, date_diff, get_link_to_form, getdate, today from frappe.utils.nestedset import NestedSet -from frappe.desk.form.assign_to import close_all_assignments, clear -from frappe.utils import date_diff + class CircularReferenceError(frappe.ValidationError): pass class EndDateCannotBeGreaterThanProjectEndDateError(frappe.ValidationError): pass @@ -220,6 +221,26 @@ def set_tasks_as_overdue(): continue frappe.get_doc("Task", task.name).update_status() + +@frappe.whitelist() +def make_timesheet(source_name, target_doc=None, ignore_permissions=False): + def set_missing_values(source, target): + target.append("time_logs", { + "hours": source.actual_time, + "completed": source.status == "Completed", + "project": source.project, + "task": source.name + }) + + doclist = get_mapped_doc("Task", source_name, { + "Task": { + "doctype": "Timesheet" + } + }, target_doc, postprocess=set_missing_values, ignore_permissions=ignore_permissions) + + return doclist + + @frappe.whitelist() def get_children(doctype, parent, task=None, project=None, is_root=False): From d7563f03274564d3907164df193de9e3df004cdf Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 9 Jul 2020 19:40:18 +0530 Subject: [PATCH 30/49] fix: default overwroite property n 'company' is not defined --- .../payroll/doctype/employee_incentive/employee_incentive.py | 1 + erpnext/payroll/doctype/retention_bonus/retention_bonus.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/payroll/doctype/employee_incentive/employee_incentive.py b/erpnext/payroll/doctype/employee_incentive/employee_incentive.py index 44763fc077e2..84a97f6bb2e9 100644 --- a/erpnext/payroll/doctype/employee_incentive/employee_incentive.py +++ b/erpnext/payroll/doctype/employee_incentive/employee_incentive.py @@ -13,6 +13,7 @@ def on_submit(self): additional_salary = frappe.new_doc('Additional Salary') additional_salary.employee = self.employee additional_salary.salary_component = self.salary_component + additional_salary.overwrite_salary_structure_amount = 0 additional_salary.amount = self.incentive_amount additional_salary.payroll_date = self.payroll_date additional_salary.company = company diff --git a/erpnext/payroll/doctype/retention_bonus/retention_bonus.py b/erpnext/payroll/doctype/retention_bonus/retention_bonus.py index ed0d36cfa5ff..b8e56ae42aa1 100644 --- a/erpnext/payroll/doctype/retention_bonus/retention_bonus.py +++ b/erpnext/payroll/doctype/retention_bonus/retention_bonus.py @@ -26,6 +26,7 @@ def on_submit(self): additional_salary.amount = self.bonus_amount additional_salary.payroll_date = self.bonus_payment_date additional_salary.company = company + additional_salary.overwrite_salary_structure_amount = 0 additional_salary.ref_doctype = self.doctype additional_salary.ref_docname = self.name additional_salary.submit() @@ -53,7 +54,7 @@ def get_additional_salary(self): 'employee': self.employee, 'salary_component': self.salary_component, 'payroll_date': self.bonus_payment_date, - 'company': company, + 'company': self.company, 'docstatus': 1, 'ref_doctype': self.doctype, 'ref_docname': self.name From b74077faf5433848976b4c14b18ebeaed7994bd3 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 9 Jul 2020 19:50:41 +0530 Subject: [PATCH 31/49] fix(travis): Item Tax tempate template test --- erpnext/accounts/doctype/item_tax_template/test_records.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/accounts/doctype/item_tax_template/test_records.json b/erpnext/accounts/doctype/item_tax_template/test_records.json index db540e86aaca..4d9537d4b896 100644 --- a/erpnext/accounts/doctype/item_tax_template/test_records.json +++ b/erpnext/accounts/doctype/item_tax_template/test_records.json @@ -2,6 +2,7 @@ { "doctype": "Item Tax Template", "title": "_Test Account Excise Duty @ 10", + "company": "_Test Company", "taxes": [ { "doctype": "Item Tax Template Detail", @@ -14,6 +15,7 @@ { "doctype": "Item Tax Template", "title": "_Test Account Excise Duty @ 12", + "company": "_Test Company", "taxes": [ { "doctype": "Item Tax Template Detail", @@ -26,6 +28,7 @@ { "doctype": "Item Tax Template", "title": "_Test Account Excise Duty @ 15", + "company": "_Test Company", "taxes": [ { "doctype": "Item Tax Template Detail", @@ -38,6 +41,7 @@ { "doctype": "Item Tax Template", "title": "_Test Account Excise Duty @ 20", + "company": "_Test Company", "taxes": [ { "doctype": "Item Tax Template Detail", @@ -50,6 +54,7 @@ { "doctype": "Item Tax Template", "title": "_Test Item Tax Template 1", + "company": "_Test Company", "taxes": [ { "doctype": "Item Tax Template Detail", From 1ec2d962dbcc7ccee30e0d0a35727aa890910203 Mon Sep 17 00:00:00 2001 From: Marica Date: Thu, 9 Jul 2020 20:02:18 +0530 Subject: [PATCH 32/49] fix: Remove rename related code from Serial No (#22627) --- erpnext/stock/doctype/serial_no/serial_no.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index f3514c7385d5..90f0f5881d47 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -190,23 +190,6 @@ def on_trash(self): if sle_exists: frappe.throw(_("Cannot delete Serial No {0}, as it is used in stock transactions").format(self.name)) - def before_rename(self, old, new, merge=False): - if merge: - frappe.throw(_("Sorry, Serial Nos cannot be merged")) - - def after_rename(self, old, new, merge=False): - """rename serial_no text fields""" - for dt in frappe.db.sql("""select parent from tabDocField - where fieldname='serial_no' and fieldtype in ('Text', 'Small Text')"""): - - for item in frappe.db.sql("""select name, serial_no from `tab%s` - where serial_no like %s""" % (dt[0], frappe.db.escape('%' + old + '%'))): - - serial_nos = map(lambda i: new if i.upper()==old.upper() else i, item[1].split('\n')) - frappe.db.sql("""update `tab%s` set serial_no = %s - where name=%s""" % (dt[0], '%s', '%s'), - ('\n'.join(list(serial_nos)), item[0])) - def update_serial_no_reference(self, serial_no=None): last_sle = self.get_last_sle(serial_no) self.set_purchase_details(last_sle.get("purchase_sle")) From d14666e41914b866c8d24306bcfcda0a9fe6911b Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 9 Jul 2020 20:07:10 +0530 Subject: [PATCH 33/49] fix: incorrect delivered qty in Supplier-Wise Sales Analytics (#22631) --- .../supplier_wise_sales_analytics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py index 6a86889aa3d6..5873a7a3008d 100644 --- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py +++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py @@ -21,7 +21,7 @@ def execute(filters=None): for cd in consumed_details.get(item_code): if (cd.voucher_no not in material_transfer_vouchers): - if cd.voucher_type=="Delivery Note": + if cd.voucher_type in ["Delivery Note", "Sales Invoice"]: delivered_qty += abs(flt(cd.actual_qty)) delivered_amount += abs(flt(cd.stock_value_difference)) elif cd.voucher_type!="Delivery Note": From 3a3787f9e7594331e0285cd4485420d1ee7bb17f Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 9 Jul 2020 20:07:40 +0530 Subject: [PATCH 34/49] fix: Due to decimal issue make purchase receipt button not showing from PO (#22629) --- erpnext/buying/doctype/purchase_order/purchase_order.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 4a8146a797a1..84e3a31904d8 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -123,14 +123,14 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( } if(doc.status != "Closed") { if (doc.status != "On Hold") { - if(flt(doc.per_received, 2) < 100 && allow_receipt) { + if(flt(doc.per_received) < 100 && allow_receipt) { cur_frm.add_custom_button(__('Receipt'), this.make_purchase_receipt, __('Create')); if(doc.is_subcontracted==="Yes" && me.has_unsupplied_items()) { cur_frm.add_custom_button(__('Material to Supplier'), function() { me.make_stock_entry(); }, __("Transfer")); } } - if(flt(doc.per_billed, 2) < 100) + if(flt(doc.per_billed) < 100) cur_frm.add_custom_button(__('Invoice'), this.make_purchase_invoice, __('Create')); From fd28f1071ea0c9e5db50b87c38dc4575e07a6760 Mon Sep 17 00:00:00 2001 From: Afshan <33727827+AfshanKhan@users.noreply.github.com> Date: Fri, 10 Jul 2020 11:25:39 +0530 Subject: [PATCH 35/49] style: arrangements of filters for reports (#22636) --- .../accounts_payable/accounts_payable.js | 70 ++++++++-------- .../accounts_receivable.js | 82 +++++++++---------- 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index 2aa9618e559e..6abd6e5cf77e 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -17,41 +17,6 @@ frappe.query_reports["Accounts Payable"] = { "fieldtype": "Date", "default": frappe.datetime.get_today() }, - { - "fieldname":"ageing_based_on", - "label": __("Ageing Based On"), - "fieldtype": "Select", - "options": 'Posting Date\nDue Date\nSupplier Invoice Date', - "default": "Due Date" - }, - { - "fieldname":"range1", - "label": __("Ageing Range 1"), - "fieldtype": "Int", - "default": "30", - "reqd": 1 - }, - { - "fieldname":"range2", - "label": __("Ageing Range 2"), - "fieldtype": "Int", - "default": "60", - "reqd": 1 - }, - { - "fieldname":"range3", - "label": __("Ageing Range 3"), - "fieldtype": "Int", - "default": "90", - "reqd": 1 - }, - { - "fieldname":"range4", - "label": __("Ageing Range 4"), - "fieldtype": "Int", - "default": "120", - "reqd": 1 - }, { "fieldname":"finance_book", "label": __("Finance Book"), @@ -88,6 +53,41 @@ frappe.query_reports["Accounts Payable"] = { } } }, + { + "fieldname":"ageing_based_on", + "label": __("Ageing Based On"), + "fieldtype": "Select", + "options": 'Posting Date\nDue Date\nSupplier Invoice Date', + "default": "Due Date" + }, + { + "fieldname":"range1", + "label": __("Ageing Range 1"), + "fieldtype": "Int", + "default": "30", + "reqd": 1 + }, + { + "fieldname":"range2", + "label": __("Ageing Range 2"), + "fieldtype": "Int", + "default": "60", + "reqd": 1 + }, + { + "fieldname":"range3", + "label": __("Ageing Range 3"), + "fieldtype": "Int", + "default": "90", + "reqd": 1 + }, + { + "fieldname":"range4", + "label": __("Ageing Range 4"), + "fieldtype": "Int", + "default": "120", + "reqd": 1 + }, { "fieldname":"payment_terms_template", "label": __("Payment Terms Template"), diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index 8dc558a611d9..c999eb9b8e90 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -17,41 +17,6 @@ frappe.query_reports["Accounts Receivable"] = { "fieldtype": "Date", "default": frappe.datetime.get_today() }, - { - "fieldname":"ageing_based_on", - "label": __("Ageing Based On"), - "fieldtype": "Select", - "options": 'Posting Date\nDue Date', - "default": "Due Date" - }, - { - "fieldname":"range1", - "label": __("Ageing Range 1"), - "fieldtype": "Int", - "default": "30", - "reqd": 1 - }, - { - "fieldname":"range2", - "label": __("Ageing Range 2"), - "fieldtype": "Int", - "default": "60", - "reqd": 1 - }, - { - "fieldname":"range3", - "label": __("Ageing Range 3"), - "fieldtype": "Int", - "default": "90", - "reqd": 1 - }, - { - "fieldname":"range4", - "label": __("Ageing Range 4"), - "fieldtype": "Int", - "default": "120", - "reqd": 1 - }, { "fieldname":"finance_book", "label": __("Finance Book"), @@ -101,6 +66,41 @@ frappe.query_reports["Accounts Receivable"] = { } } }, + { + "fieldname":"ageing_based_on", + "label": __("Ageing Based On"), + "fieldtype": "Select", + "options": 'Posting Date\nDue Date', + "default": "Due Date" + }, + { + "fieldname":"range1", + "label": __("Ageing Range 1"), + "fieldtype": "Int", + "default": "30", + "reqd": 1 + }, + { + "fieldname":"range2", + "label": __("Ageing Range 2"), + "fieldtype": "Int", + "default": "60", + "reqd": 1 + }, + { + "fieldname":"range3", + "label": __("Ageing Range 3"), + "fieldtype": "Int", + "default": "90", + "reqd": 1 + }, + { + "fieldname":"range4", + "label": __("Ageing Range 4"), + "fieldtype": "Int", + "default": "120", + "reqd": 1 + }, { "fieldname":"customer_group", "label": __("Customer Group"), @@ -113,12 +113,6 @@ frappe.query_reports["Accounts Receivable"] = { "fieldtype": "Link", "options": "Payment Terms Template" }, - { - "fieldname":"territory", - "label": __("Territory"), - "fieldtype": "Link", - "options": "Territory" - }, { "fieldname":"sales_partner", "label": __("Sales Partner"), @@ -131,6 +125,12 @@ frappe.query_reports["Accounts Receivable"] = { "fieldtype": "Link", "options": "Sales Person" }, + { + "fieldname":"territory", + "label": __("Territory"), + "fieldtype": "Link", + "options": "Territory" + }, { "fieldname": "group_by_party", "label": __("Group By Customer"), From eee12fbcb4ec7bb793f2d4516b8285eb86105a10 Mon Sep 17 00:00:00 2001 From: Marica Date: Fri, 10 Jul 2020 12:34:59 +0530 Subject: [PATCH 36/49] fix: Remove redundant variable declaration (#22641) --- erpnext/utilities/transaction_base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 5bf85d1c64c4..c8e3330908fe 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -121,7 +121,6 @@ def compare_values(self, ref_doc, fields, doc=None): def validate_rate_with_reference_doc(self, ref_details): buying_doctypes = ["Purchase Order", "Purchase Invoice", "Purchase Receipt"] - selling_doctypes = ["Sales Invoice", "Delivery Note"] if self.doctype in buying_doctypes: to_disable = "Maintain same rate throughout Purchase cycle" From 7cb195b304f4098aafc74e54b2e53d4753116bd1 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 10 Jul 2020 13:33:50 +0530 Subject: [PATCH 37/49] fix: Distributed cost center query --- erpnext/accounts/report/financial_statements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 533685d703d7..ee1d54a92ed8 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -405,12 +405,12 @@ def set_gl_entries_by_account( FROM `tabDistributed Cost Center` WHERE cost_center IN %(cost_center)s AND parent NOT IN %(cost_center)s - AND is_cancelled = 0 GROUP BY parent ) as DCC_allocation WHERE company=%(company)s {additional_conditions} AND posting_date <= %(to_date)s + AND is_cancelled = 0 AND cost_center = DCC_allocation.parent """.format(additional_conditions=additional_conditions.replace("and cost_center in %(cost_center)s ", '')) From 70aa3c0b1f94030db4c2d91ed91d46e6e3c16919 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 10 Jul 2020 16:13:21 +0530 Subject: [PATCH 38/49] fix: Remove explicit exception Co-authored-by: gavin --- erpnext/setup/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index d470d75a8fce..aa9fbc0a92c8 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -32,7 +32,7 @@ def check_setup_wizard_not_completed(): if frappe.db.get_default('desktop:home_page') != 'setup-wizard': message = """ERPNext can only be installed on a fresh site where the setup wizard is not completed. You can reinstall this site (after saving your data) using: bench --site [sitename] reinstall""" - frappe.throw(message, exc=frappe.IncompatibleApp) + frappe.throw(message) def set_single_defaults(): From a6c10b1bc0fa05d5b20928f8f2c73048c1797bed Mon Sep 17 00:00:00 2001 From: marination Date: Fri, 10 Jul 2020 20:09:58 +0530 Subject: [PATCH 39/49] fix: Pricing Rule breaks if no item_code --- erpnext/accounts/doctype/pricing_rule/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index 53115f92d011..ad983830f3b8 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -319,7 +319,9 @@ def apply_internal_priority(pricing_rules, field_set, args): filtered_rules = [] for field in field_set: if args.get(field): - filtered_rules = filter(lambda x: x[field]==args[field], pricing_rules) + # filter function always returns a filter object even if empty + # list conversion is necessary to check for an empty result + filtered_rules = list(filter(lambda x: x.get(field)==args.get(field), pricing_rules)) if filtered_rules: break return filtered_rules or pricing_rules From 090bf73768d844c4ac0b299b54d350fb27434629 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:43:23 +0200 Subject: [PATCH 40/49] bump pandas to 1.0.5 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cfd0ab8e0752..108c776d8de2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ braintree==3.57.1 frappe gocardless-pro==1.11.0 googlemaps==3.1.1 -pandas==0.24.2 +pandas==1.0.5 plaid-python==3.4.0 pycountry==19.8.18 PyGithub==1.44.1 @@ -11,3 +11,4 @@ taxjar==1.9.0 tweepy==3.8.0 Unidecode==1.1.1 WooCommerce==2.1.1 +tweepy==3.8.0 From 23a65d8d01876267485ca4bfe83ac15e79d68cd5 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:46:44 +0200 Subject: [PATCH 41/49] fix: duplicate tweepy --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 108c776d8de2..912d61f7a6ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,3 @@ taxjar==1.9.0 tweepy==3.8.0 Unidecode==1.1.1 WooCommerce==2.1.1 -tweepy==3.8.0 From 87eb2827ef9e1d2fea46a9ecb721bfa5930ffb9b Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 10 Jul 2020 22:45:45 +0530 Subject: [PATCH 42/49] fix: Update tests --- erpnext/controllers/tests/test_qty_based_taxes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/controllers/tests/test_qty_based_taxes.py b/erpnext/controllers/tests/test_qty_based_taxes.py index fd9936bae995..aaeac5d9399e 100644 --- a/erpnext/controllers/tests/test_qty_based_taxes.py +++ b/erpnext/controllers/tests/test_qty_based_taxes.py @@ -30,6 +30,7 @@ def setUp(self): self.item_tax_template = frappe.get_doc({ 'doctype': 'Item Tax Template', 'title': uuid4(), + 'company': self.company.name, 'taxes': [ { 'tax_type': self.account.name, From f15ff5fbfa1aec2ec4527c259e2405bc3556507f Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 11 Jul 2020 13:58:53 +0530 Subject: [PATCH 43/49] fix: Test --- erpnext/stock/doctype/item/test_records.json | 12 ++++-------- erpnext/stock/get_item_details.py | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json index 6c1a55945c84..ce77988579a8 100644 --- a/erpnext/stock/doctype/item/test_records.json +++ b/erpnext/stock/doctype/item/test_records.json @@ -92,8 +92,7 @@ { "doctype": "Item Tax", "parentfield": "taxes", - "item_tax_template": "_Test Account Excise Duty @ 10", - "tax_category": "" + "item_tax_template": "_Test Account Excise Duty @ 10" } ], "stock_uom": "_Test UOM 1" @@ -371,8 +370,7 @@ { "doctype": "Item Tax", "parentfield": "taxes", - "item_tax_template": "_Test Account Excise Duty @ 10", - "tax_category": "" + "item_tax_template": "_Test Account Excise Duty @ 10" }, { "doctype": "Item Tax", @@ -451,14 +449,12 @@ { "doctype": "Item Tax", "parentfield": "taxes", - "item_tax_template": "_Test Account Excise Duty @ 20", - "tax_category": "" + "item_tax_template": "_Test Account Excise Duty @ 20" }, { "doctype": "Item Tax", "parentfield": "taxes", - "item_tax_template": "_Test Item Tax Template 1", - "tax_category": "_Test Tax Category 1" + "item_tax_template": "_Test Item Tax Template 1" } ] } diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 0af018bbad8e..385e477fbd50 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -636,7 +636,7 @@ def get_item_price(args, item_code, ignore_party=False): if args.get('transaction_date'): conditions += """ and %(transaction_date)s between ifnull(valid_from, '2000-01-01') and ifnull(valid_upto, '2500-12-31')""" - + if args.get('posting_date'): conditions += """ and %(posting_date)s between ifnull(valid_from, '2000-01-01') and ifnull(valid_upto, '2500-12-31')""" From 46bcb4642241ba757388cb2ba1e712163ee9d097 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 11 Jul 2020 18:36:32 +0530 Subject: [PATCH 44/49] fix: Do not use random customers --- erpnext/controllers/tests/test_mapper.py | 8 +++----- erpnext/stock/doctype/item/test_records.json | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/tests/test_mapper.py b/erpnext/controllers/tests/test_mapper.py index 8839e002a4ca..5ebf8cfa7f1f 100644 --- a/erpnext/controllers/tests/test_mapper.py +++ b/erpnext/controllers/tests/test_mapper.py @@ -14,12 +14,10 @@ def test_map_docs(self): make_test_records("Item") items = frappe.get_all("Item", fields = ["name", "item_code"], filters = {'is_sales_item': 1, 'has_variants': 0, 'disabled': 0}) - customers = frappe.get_all("Customer") - if items and customers: + if items: # Make source docs (quotations) and a target doc (sales order) - customer = random.choice(customers).name - qtn1, item_list_1 = self.make_quotation(items, customer) - qtn2, item_list_2 = self.make_quotation(items, customer) + qtn1, item_list_1 = self.make_quotation(items, '_Test Customer') + qtn2, item_list_2 = self.make_quotation(items, '_Test Customer') so, item_list_3 = self.make_sales_order() # Map source docs to target with corresponding mapper method diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json index ce77988579a8..9ca887c77e33 100644 --- a/erpnext/stock/doctype/item/test_records.json +++ b/erpnext/stock/doctype/item/test_records.json @@ -454,6 +454,7 @@ { "doctype": "Item Tax", "parentfield": "taxes", + "tax_category": "_Test Tax Category 1", "item_tax_template": "_Test Item Tax Template 1" } ] From a9820cdcf64bbff009e7775bb0d22154a4fea309 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 11 Jul 2020 19:38:51 +0530 Subject: [PATCH 45/49] fix: Remove every bit of randomness from this test --- erpnext/controllers/tests/test_mapper.py | 30 +++++------ .../doctype/sales_order/test_records.json | 52 +++++++++---------- 2 files changed, 38 insertions(+), 44 deletions(-) diff --git a/erpnext/controllers/tests/test_mapper.py b/erpnext/controllers/tests/test_mapper.py index 5ebf8cfa7f1f..66459fdbf8a3 100644 --- a/erpnext/controllers/tests/test_mapper.py +++ b/erpnext/controllers/tests/test_mapper.py @@ -13,12 +13,12 @@ def test_map_docs(self): '''Test mapping of multiple source docs on a single target doc''' make_test_records("Item") - items = frappe.get_all("Item", fields = ["name", "item_code"], filters = {'is_sales_item': 1, 'has_variants': 0, 'disabled': 0}) - if items: - # Make source docs (quotations) and a target doc (sales order) - qtn1, item_list_1 = self.make_quotation(items, '_Test Customer') - qtn2, item_list_2 = self.make_quotation(items, '_Test Customer') - so, item_list_3 = self.make_sales_order() + items = ['_Test Item', '_Test Item 2', '_Test FG Item'] + + # Make source docs (quotations) and a target doc (sales order) + qtn1, item_list_1 = self.make_quotation(items, '_Test Customer') + qtn2, item_list_2 = self.make_quotation(items, '_Test Customer') + so, item_list_3 = self.make_sales_order() # Map source docs to target with corresponding mapper method method = "erpnext.selling.doctype.quotation.quotation.make_sales_order" @@ -26,18 +26,12 @@ def test_map_docs(self): # Assert that all inserted items are present in updated sales order src_items = item_list_1 + item_list_2 + item_list_3 - self.assertEqual(set([d.item_code for d in src_items]), + self.assertEqual(set([d for d in src_items]), set([d.item_code for d in updated_so.items])) - def get_random_items(self, items, limit): - '''Get a number of random items from a list of given items''' - random_items = [] - for i in range(0, limit): - random_items.append(random.choice(items)) - return random_items - def make_quotation(self, items, customer): - item_list = self.get_random_items(items, 3) + def make_quotation(self, item_list, customer): + qtn = frappe.get_doc({ "doctype": "Quotation", "quotation_to": "Customer", @@ -47,7 +41,7 @@ def make_quotation(self, items, customer): "valid_till" : add_months(nowdate(), 1) }) for item in item_list: - qtn.append("items", {"qty": "2", "item_code": item.item_code}) + qtn.append("items", {"qty": "2", "item_code": item}) qtn.submit() return qtn, item_list @@ -58,7 +52,7 @@ def make_sales_order(self): "base_rate": 100.0, "description": "CPU", "doctype": "Sales Order Item", - "item_code": "_Test Item Home Desktop 100", + "item_code": "_Test Item", "item_name": "CPU", "parentfield": "items", "qty": 10.0, @@ -70,4 +64,4 @@ def make_sales_order(self): }) so = frappe.get_doc(frappe.get_test_records('Sales Order')[0]) so.insert(ignore_permissions=True) - return so, [item] + return so, [item.item_code] diff --git a/erpnext/selling/doctype/sales_order/test_records.json b/erpnext/selling/doctype/sales_order/test_records.json index 6cbd6c2fc17a..8a090e6d3d39 100644 --- a/erpnext/selling/doctype/sales_order/test_records.json +++ b/erpnext/selling/doctype/sales_order/test_records.json @@ -1,39 +1,39 @@ [ { "advance_paid": 0.0, - "company": "_Test Company", - "conversion_rate": 1.0, - "currency": "INR", - "customer": "_Test Customer", - "customer_group": "_Test Customer Group", - "customer_name": "_Test Customer", - "doctype": "Sales Order", - "base_grand_total": 1000.0, - "grand_total": 1000.0, - "naming_series": "_T-Sales Order-", - "order_type": "Sales", - "plc_conversion_rate": 1.0, - "price_list_currency": "INR", + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_group": "_Test Customer Group", + "customer_name": "_Test Customer", + "doctype": "Sales Order", + "base_grand_total": 1000.0, + "grand_total": 1000.0, + "naming_series": "_T-Sales Order-", + "order_type": "Sales", + "plc_conversion_rate": 1.0, + "price_list_currency": "INR", "items": [ { - "base_amount": 1000.0, - "base_rate": 100.0, - "description": "CPU", - "doctype": "Sales Order Item", - "item_code": "_Test Item Home Desktop 100", - "item_name": "CPU", - "delivery_date": "2013-02-23", - "parentfield": "items", - "qty": 10.0, - "rate": 100.0, + "base_amount": 1000.0, + "base_rate": 100.0, + "description": "CPU", + "doctype": "Sales Order Item", + "item_code": "_Test Item", + "item_name": "_Test Item 1", + "delivery_date": "2013-02-23", + "parentfield": "items", + "qty": 10.0, + "rate": 100.0, "warehouse": "_Test Warehouse - _TC", "stock_uom": "_Test UOM", "conversion_factor": 1.0, "uom": "_Test UOM" } - ], - "selling_price_list": "_Test Price List", - "territory": "_Test Territory", + ], + "selling_price_list": "_Test Price List", + "territory": "_Test Territory", "transaction_date": "2013-02-21" } ] \ No newline at end of file From c9b4ba6de84f5e3c9c6440ef47baf1f7b04c188f Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Sat, 11 Jul 2020 17:44:20 +0530 Subject: [PATCH 46/49] fix: ewaybill json had json dump of json dump, and other related fixes --- erpnext/regional/india/utils.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index 05ffa87f1448..961b8c6c3bc5 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -458,19 +458,23 @@ def generate_ewb_json(dt, dn): @frappe.whitelist() def download_ewb_json(): - data = frappe._dict(frappe.local.form_dict) - - frappe.local.response.filecontent = json.dumps(data['data'], indent=4, sort_keys=True) + data = json.loads(frappe.local.form_dict.data) + frappe.local.response.filecontent = json.dumps(data, indent=4, sort_keys=True) frappe.local.response.type = 'download' - billList = json.loads(data['data'])['billLists'] + filename_prefix = 'Bulk' + docname = frappe.local.form_dict.docname + if docname: + if docname.startswith('['): + docname = json.loads(docname) + if len(docname) == 1: + docname = docname[0] - if len(billList) > 1: - doc_name = 'Bulk' - else: - doc_name = data['docname'] + if not isinstance(docname, list): + # removes characters not allowed in a filename (https://stackoverflow.com/a/38766141/4767738) + filename_prefix = re.sub('[^\w_.)( -]', '', docname) - frappe.local.response.filename = '{0}_e-WayBill_Data_{1}.json'.format(doc_name, frappe.utils.random_string(5)) + frappe.local.response.filename = '{0}_e-WayBill_Data_{1}.json'.format(filename_prefix, frappe.utils.random_string(5)) @frappe.whitelist() def get_gstins_for_company(company): From 83cd1dcc4480f0d84179abce7ffba82dd3d9a8e5 Mon Sep 17 00:00:00 2001 From: Afshan <33727827+AfshanKhan@users.noreply.github.com> Date: Sat, 11 Jul 2020 21:54:54 +0530 Subject: [PATCH 47/49] fix: Add project filter in parent task field (#22655) * fix: Add project filter in parent task field --- erpnext/projects/doctype/task/task.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/projects/doctype/task/task.js b/erpnext/projects/doctype/task/task.js index a044e1dca890..8c6a9cf8d7c0 100644 --- a/erpnext/projects/doctype/task/task.js +++ b/erpnext/projects/doctype/task/task.js @@ -29,10 +29,16 @@ frappe.ui.form.on("Task", { filters: filters }; }) - }, - refresh: function (frm) { - frm.set_query("parent_task", { "is_group": 1 }); + frm.set_query("parent_task", function () { + let filters = { + "is_group": 1 + }; + if (frm.doc.project) filters["project"] = frm.doc.project; + return { + filters: filters + } + }); }, is_group: function (frm) { From 193e12f02a4d1ae8ad84a324dbc860851aae380b Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Sun, 12 Jul 2020 13:56:27 +0200 Subject: [PATCH 48/49] fix: download button (#22652) --- erpnext/regional/report/datev/datev.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/regional/report/datev/datev.js b/erpnext/regional/report/datev/datev.js index d8638ab05de9..55f12cf37389 100644 --- a/erpnext/regional/report/datev/datev.js +++ b/erpnext/regional/report/datev/datev.js @@ -30,7 +30,7 @@ frappe.query_reports["DATEV"] = { } ], onload: function(query_report) { - query_report.page.add_inner_button("Download DATEV Export", () => { + query_report.page.add_menu_item(__("Download DATEV File"), () => { const filters = JSON.stringify(query_report.get_values()); window.open(`/api/method/erpnext.regional.report.datev.datev.download_datev_csv?filters=${filters}`); }); From d058840094ed6b78c6dd4bb2b96b10297a206334 Mon Sep 17 00:00:00 2001 From: Afshan <33727827+AfshanKhan@users.noreply.github.com> Date: Sun, 12 Jul 2020 19:19:59 +0530 Subject: [PATCH 49/49] fix: removed fiscal year field from "Request for Quotation" doctype (#22446) * fix: removed fiscal year field from "Request for Quotation" doctype --- .../request_for_quotation.json | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json index 97aa9221e2ff..5cd8e6f4fa8e 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json @@ -1,4 +1,5 @@ { + "actions": "", "allow_import": 1, "autoname": "naming_series:", "creation": "2016-02-25 01:24:07.224790", @@ -28,7 +29,6 @@ "letter_head", "more_info", "status", - "fiscal_year", "column_break3", "amended_from" ], @@ -218,17 +218,6 @@ "reqd": 1, "search_index": 1 }, - { - "fieldname": "fiscal_year", - "fieldtype": "Link", - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "Fiscal Year", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, { "fieldname": "column_break3", "fieldtype": "Column Break" @@ -245,7 +234,8 @@ ], "icon": "fa fa-shopping-cart", "is_submittable": 1, - "modified": "2019-09-24 15:08:32.750661", + "links": [], + "modified": "2020-06-25 14:37:21.140194", "modified_by": "Administrator", "module": "Buying", "name": "Request for Quotation",