From 1284b9b17d31836984ec708ad320d9ac766cd6ed Mon Sep 17 00:00:00 2001 From: P-Froggy <60393001+P-Froggy@users.noreply.github.com> Date: Thu, 18 Jun 2020 02:11:15 +0200 Subject: [PATCH 01/18] fix: Set Value of wrong Bank Account Field in Payment Entry Company bank account was wrongly inserted into the field "Party Bank Account" in payment entry, instead of "Bank Account". Adds filters for "Party Bank Account" based on selected Party (I forgot to create a PR for version-12 back in February, see commit #393a626). Also changes the label of "Default Bank Account" to "Default Company Bank Account", like suggested in PR #20632 #### Please Note This is kind of a revert of PR #19390. However, it seems like the function "get_party_bank_account" in Bank Account doctype changed how it worked since it is clearly pulling the default company bank account. --- .../accounts/doctype/payment_entry/payment_entry.js | 10 ++++++---- erpnext/buying/doctype/supplier/supplier.json | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 74be4c4ef0f..70c485133f0 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -25,7 +25,7 @@ frappe.ui.form.on('Payment Entry', { }); frm.set_query("party_type", function() { return{ - "filters": { + filters: { "name": ["in", Object.keys(frappe.boot.party_account_types)], } } @@ -33,14 +33,16 @@ frappe.ui.form.on('Payment Entry', { frm.set_query("party_bank_account", function() { return { filters: { - "is_company_account":0 + is_company_account: 0, + party_type: frm.doc.party_type, + party: frm.doc.party } } }); frm.set_query("bank_account", function() { return { filters: { - "is_company_account":1 + is_company_account: 1 } } }); @@ -326,7 +328,7 @@ frappe.ui.form.on('Payment Entry', { () => { frm.set_party_account_based_on_party = false; if (r.message.bank_account) { - frm.set_value("party_bank_account", r.message.bank_account); + frm.set_value("bank_account", r.message.bank_account); } } ]); diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index e78abd62615..7a18160e39f 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -97,7 +97,7 @@ { "fieldname": "default_bank_account", "fieldtype": "Link", - "label": "Default Bank Account", + "label": "Default Company Bank Account", "options": "Bank Account" }, { @@ -385,7 +385,7 @@ "idx": 370, "image_field": "image", "links": [], - "modified": "2020-03-17 09:48:30.578242", + "modified": "2020-06-17 23:28:30", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", From af9e44f0590b72a7569c77859ff70901cc08eeb7 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 24 Jul 2020 18:18:49 +0530 Subject: [PATCH 02/18] fix(payment-request): do not set guest as administrator (#22803) --- erpnext/accounts/doctype/payment_request/payment_request.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index c863ce8e7f7..29d78a9726f 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -140,9 +140,6 @@ class PaymentRequest(Document): }) def set_as_paid(self): - if frappe.session.user == "Guest": - frappe.set_user("Administrator") - payment_entry = self.create_payment_entry() self.make_invoice() @@ -254,7 +251,7 @@ class PaymentRequest(Document): if status in ["Authorized", "Completed"]: redirect_to = None - self.run_method("set_as_paid") + self.set_as_paid() # if shopping cart enabled and in session if (shopping_cart_settings.enabled and hasattr(frappe.local, "session") From ca6ec72ade016bfd0d189ed1b178a5ce7b9d1535 Mon Sep 17 00:00:00 2001 From: bhavesh95863 <34086262+bhavesh95863@users.noreply.github.com> Date: Sun, 26 Jul 2020 14:03:03 +0530 Subject: [PATCH 03/18] fix: Add missing translation function for freeze message (#22812) * fix[missing translation function] missing translation function * fix[missing translation function for message] missing translation function for message * fix[add missing translation function] add missing translation function * Update payroll_entry.js Co-authored-by: Rucha Mahabal --- .../student_attendance_tool/student_attendance_tool.js | 4 ++-- erpnext/healthcare/doctype/lab_test/lab_test_list.js | 2 +- .../healthcare/doctype/patient_encounter/patient_encounter.js | 4 ++-- erpnext/hr/doctype/payroll_entry/payroll_entry.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js index cc9607da19f..0384505ec21 100644 --- a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js +++ b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js @@ -140,7 +140,7 @@ education.StudentsEditor = Class.extend({ frappe.call({ method: "erpnext.education.api.mark_attendance", freeze: true, - freeze_message: "Marking attendance", + freeze_message: __("Marking attendance"), args: { "students_present": students_present, "students_absent": students_absent, @@ -180,4 +180,4 @@ education.StudentsEditor = Class.extend({ ` ); } -}); \ No newline at end of file +}); diff --git a/erpnext/healthcare/doctype/lab_test/lab_test_list.js b/erpnext/healthcare/doctype/lab_test/lab_test_list.js index 1f6a12f935f..2e76bb8ddd8 100644 --- a/erpnext/healthcare/doctype/lab_test/lab_test_list.js +++ b/erpnext/healthcare/doctype/lab_test/lab_test_list.js @@ -52,7 +52,7 @@ var create_multiple_dialog = function(listview){ } }, freeze: true, - freeze_message: "Creating Lab Test..." + freeze_message: __("Creating Lab Test...") }); dialog.hide(); } diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js index c1b0b18dba4..e6ceb5c0fc3 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js @@ -116,7 +116,7 @@ var schedule_inpatient = function(frm) { } }, freeze: true, - freeze_message: "Process Inpatient Scheduling" + freeze_message: __("Process Inpatient Scheduling") }); }; @@ -130,7 +130,7 @@ var schedule_discharge = function(frm) { } }, freeze: true, - freeze_message: "Process Discharge" + freeze_message: __("Process Discharge") }); }; diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.js b/erpnext/hr/doctype/payroll_entry/payroll_entry.js index da25d7574e0..ab4b6e7d0db 100644 --- a/erpnext/hr/doctype/payroll_entry/payroll_entry.js +++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.js @@ -211,7 +211,7 @@ frappe.ui.form.on('Payroll Entry', { }, doc: frm.doc, freeze: true, - freeze_message: 'Validating Employee Attendance...' + freeze_message: __('Validating Employee Attendance...') }); }else{ frm.fields_dict.attendance_detail_html.html(""); @@ -235,7 +235,7 @@ const submit_salary_slip = function (frm) { callback: function() {frm.events.refresh(frm);}, doc: frm.doc, freeze: true, - freeze_message: 'Submitting Salary Slips and creating Journal Entry...' + freeze_message: __('Submitting Salary Slips and creating Journal Entry...') }); }, function() { From b7efef79dce76d7065a878dc3f7a8474f5ba6119 Mon Sep 17 00:00:00 2001 From: Marica Date: Mon, 27 Jul 2020 14:54:59 +0530 Subject: [PATCH 04/18] fix: Exploded Item Rate (#22816) --- erpnext/manufacturing/doctype/bom/bom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 067a6f7674d..68f796ba1bc 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -539,7 +539,7 @@ class BOM(WebsiteGenerator): 'image' : d.image, 'stock_uom' : d.stock_uom, 'stock_qty' : flt(d.stock_qty), - 'rate' : d.base_rate, + 'rate' : flt(d.base_rate) / flt(d.conversion_factor), 'include_item_in_manufacturing': d.include_item_in_manufacturing })) From b2eddedfb14ad86cef7500a441006d575dec4799 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Wed, 29 Jul 2020 17:19:11 +0530 Subject: [PATCH 05/18] fix: change owner fieldtype to Link in Lead Owner Efficiency Report (#22840) --- .../crm/report/lead_owner_efficiency/lead_owner_efficiency.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py index 6172a75fdd8..cb37fb4edfb 100644 --- a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py +++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py @@ -17,7 +17,8 @@ def get_columns(): { "fieldname": "lead_owner", "label": _("Lead Owner"), - "fieldtype": "Data", + "fieldtype": "Link", + "options": "User", "width": "130" }, { From 3d2fa59e6d99f3f38eb3d45bc505501647a35a59 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Thu, 30 Jul 2020 13:27:47 +0530 Subject: [PATCH 06/18] fix(Education): course wise assessment report labels (#22805) * fix: add labels to chart datasets in course wise assessment * fix: change label for final grade Co-authored-by: Marica --- .../course_wise_assessment_report.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py index ce581486ec3..1043e5bd45b 100644 --- a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py +++ b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py @@ -42,7 +42,7 @@ def execute(filters=None): # create the list of possible grades if student_row[scrub_criteria] not in grades: grades.append(student_row[scrub_criteria]) - + # create the dict of for gradewise analysis if student_row[scrub_criteria] not in grade_wise_analysis[criteria]: grade_wise_analysis[criteria][student_row[scrub_criteria]] = 1 @@ -101,7 +101,7 @@ def get_formatted_result(args, get_assessment_criteria=False, get_course=False, # create the nested dictionary structure as given below: # ..... - # "Total Score" -> assessment criteria used for totaling and args.assessment_group -> for totaling all the assesments + # "Final Grade" -> assessment criteria used for totaling and args.assessment_group -> for totaling all the assesments student_details = {} formatted_assessment_result = defaultdict(dict) @@ -123,13 +123,13 @@ def get_formatted_result(args, get_assessment_criteria=False, get_course=False, formatted_assessment_result[result.student][result.course][assessment_group]\ [assessment_criteria]["grade"] = tmp_grade - # create the assessment criteria "Total Score" with the sum of all the scores of the assessment criteria in a given assessment group + # create the assessment criteria "Final Grade" with the sum of all the scores of the assessment criteria in a given assessment group def add_total_score(result, assessment_group): - if "Total Score" not in formatted_assessment_result[result.student][result.course][assessment_group]: - formatted_assessment_result[result.student][result.course][assessment_group]["Total Score"] = frappe._dict({ - "assessment_criteria": "Total Score", "maximum_score": result.maximum_score, "score": result.score, "grade": result.grade}) + if "Final Grade" not in formatted_assessment_result[result.student][result.course][assessment_group]: + formatted_assessment_result[result.student][result.course][assessment_group]["Final Grade"] = frappe._dict({ + "assessment_criteria": "Final Grade", "maximum_score": result.maximum_score, "score": result.score, "grade": result.grade}) else: - add_score_and_recalculate_grade(result, assessment_group, "Total Score") + add_score_and_recalculate_grade(result, assessment_group, "Final Grade") for result in assessment_result: if result.student not in student_details: @@ -152,7 +152,7 @@ def get_formatted_result(args, get_assessment_criteria=False, get_course=False, elif create_total_dict: if get_all_assessment_groups: formatted_assessment_result[result.student][result.course][result.assessment_group]\ - [result.assessment_criteria] = assessment_criteria_details + [result.assessment_criteria] = assessment_criteria_details if not formatted_assessment_result[result.student][result.course][args.assessment_group]: formatted_assessment_result[result.student][result.course][args.assessment_group] = defaultdict(dict) formatted_assessment_result[result.student][result.course][args.assessment_group]\ @@ -166,7 +166,7 @@ def get_formatted_result(args, get_assessment_criteria=False, get_course=False, add_total_score(result, args.assessment_group) total_maximum_score = formatted_assessment_result[result.student][result.course][args.assessment_group]\ - ["Total Score"]["maximum_score"] + ["Final Grade"]["maximum_score"] if get_assessment_criteria: assessment_criteria_dict[result.assessment_criteria] = formatted_assessment_result[result.student][result.course]\ [args.assessment_group][result.assessment_criteria]["maximum_score"] @@ -174,7 +174,7 @@ def get_formatted_result(args, get_assessment_criteria=False, get_course=False, course_dict[result.course] = total_maximum_score if get_assessment_criteria and total_maximum_score: - assessment_criteria_dict["Total Score"] = total_maximum_score + assessment_criteria_dict["Final Grade"] = total_maximum_score return { "student_details": student_details, @@ -220,7 +220,7 @@ def get_chart_data(grades, criteria_list, kounter): datasets = [] for grade in grades: - tmp = frappe._dict({"values":[], "title": grade}) + tmp = frappe._dict({"name": grade, "values":[]}) for criteria in criteria_list: if grade in kounter[criteria]: tmp["values"].append(kounter[criteria][grade]) From a9cfe0c95c28a83c2fd24fa52730d6dabdd8025d Mon Sep 17 00:00:00 2001 From: Marica Date: Mon, 3 Aug 2020 14:56:46 +0530 Subject: [PATCH 07/18] fix: Misleading description in Warehouse (#22879) --- erpnext/stock/doctype/warehouse/warehouse.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/warehouse/warehouse.json b/erpnext/stock/doctype/warehouse/warehouse.json index 909d8216308..3df2506884b 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.json +++ b/erpnext/stock/doctype/warehouse/warehouse.json @@ -44,7 +44,6 @@ "oldfieldtype": "Section Break" }, { - "description": "If blank, parent Warehouse Account or company default will be considered", "fieldname": "warehouse_name", "fieldtype": "Data", "label": "Warehouse Name", @@ -234,7 +233,8 @@ "icon": "fa fa-building", "idx": 1, "is_tree": 1, - "modified": "2020-07-22 14:46:37.650475", + "links": [], + "modified": "2020-08-03 11:19:35.943330", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse", From ec46b8c73b0a7f92647c008014d5c71fcd8ea732 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 3 Aug 2020 15:39:29 +0530 Subject: [PATCH 08/18] fix: Bank Clearance of POS purchase invoice (#22884) --- .../bank_reconciliation.py | 22 +- .../purchase_invoice/purchase_invoice.json | 8 +- .../sales_invoice_payment.json | 379 ++++-------------- 3 files changed, 100 insertions(+), 309 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 48fd154a4db..0b33b2e5cd7 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -60,12 +60,13 @@ class BankReconciliation(Document): """.format(condition=condition), {"account": self.account, "from":self.from_date, "to": self.to_date, "bank_account": self.bank_account}, as_dict=1) - pos_entries = [] + + pos_sales_invoices, pos_purchase_invoices = [], [] if self.include_pos_transactions: - pos_entries = frappe.db.sql(""" + pos_sales_invoices = frappe.db.sql(""" select "Sales Invoice Payment" as payment_document, sip.name as payment_entry, sip.amount as debit, - si.posting_date, si.debit_to as against_account, sip.clearance_date, + si.posting_date, si.customer as against_account, sip.clearance_date, account.account_currency, 0 as credit from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account where @@ -75,7 +76,20 @@ class BankReconciliation(Document): si.posting_date ASC, si.name DESC """, {"account":self.account, "from":self.from_date, "to":self.to_date}, as_dict=1) - entries = sorted(list(payment_entries)+list(journal_entries+list(pos_entries)), + pos_purchase_invoices = frappe.db.sql(""" + select + "Purchase Invoice" as payment_document, pi.name as payment_entry, pi.paid_amount as credit, + pi.posting_date, pi.supplier as against_account, pi.clearance_date, + account.account_currency, 0 as debit + from `tabPurchase Invoice` pi, `tabAccount` account + where + pi.cash_bank_account=%(account)s and pi.docstatus=1 and account.name = pi.cash_bank_account + and pi.posting_date >= %(from)s and pi.posting_date <= %(to)s + order by + pi.posting_date ASC, pi.name DESC + """, {"account": self.account, "from": self.from_date, "to": self.to_date}, as_dict=1) + + entries = sorted(list(payment_entries) + list(journal_entries + list(pos_sales_invoices) + list(pos_purchase_invoices)), key=lambda k: k['posting_date'] or getdate(nowdate())) self.set('payment_entries', []) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index f65479ca01d..47769021e27 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -962,8 +962,10 @@ { "fieldname": "clearance_date", "fieldtype": "Date", - "hidden": 1, - "label": "Clearance Date" + "label": "Clearance Date", + "no_copy": 1, + "print_hide": 1, + "read_only": 1 }, { "fieldname": "col_br_payments", @@ -1298,7 +1300,7 @@ "icon": "fa fa-file-text", "idx": 204, "is_submittable": 1, - "modified": "2020-07-01 12:41:54.851217", + "modified": "2020-08-03 13:08:19.611710", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json index 52cf810ae4c..f5398579581 100644 --- a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json +++ b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json @@ -1,314 +1,89 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2016-05-08 23:49:38.842621", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, + "creation": "2016-05-08 23:49:38.842621", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "default", + "mode_of_payment", + "amount", + "column_break_3", + "account", + "type", + "base_amount", + "clearance_date" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:parent.doctype == 'POS Profile'", - "fetch_if_empty": 0, - "fieldname": "default", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Default", - "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, - "translatable": 0, - "unique": 0 - }, + "default": "0", + "depends_on": "eval:parent.doctype == 'POS Profile'", + "fieldname": "default", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Default" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Mode of Payment", - "length": 0, - "no_copy": 0, - "options": "Mode of Payment", - "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": "mode_of_payment", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Mode of Payment", + "options": "Mode of Payment", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "depends_on": "eval:parent.doctype == 'Sales Invoice'", - "fetch_if_empty": 0, - "fieldname": "amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Amount", - "length": 0, - "no_copy": 0, - "options": "currency", - "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 - }, + "default": "0", + "depends_on": "eval:parent.doctype == 'Sales Invoice'", + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "options": "currency", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_3", - "fieldtype": "Column Break", - "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, - "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, - "translatable": 0, - "unique": 0 - }, + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "account", - "fieldtype": "Link", - "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": "Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "account", + "fieldtype": "Link", + "label": "Account", + "options": "Account", + "print_hide": 1, + "read_only": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_from": "mode_of_payment.type", - "fetch_if_empty": 0, - "fieldname": "type", - "fieldtype": "Read Only", - "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": "Type", - "length": 0, - "no_copy": 0, - "options": "", - "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, - "translatable": 0, - "unique": 0 - }, + "fetch_from": "mode_of_payment.type", + "fieldname": "type", + "fieldtype": "Read Only", + "label": "Type" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "base_amount", - "fieldtype": "Currency", - "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": "Base Amount (Company Currency)", - "length": 0, - "no_copy": 1, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "base_amount", + "fieldtype": "Currency", + "label": "Base Amount (Company Currency)", + "no_copy": 1, + "options": "Company:company:default_currency", + "print_hide": 1, + "read_only": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "clearance_date", - "fieldtype": "Date", - "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": "Clearance Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldname": "clearance_date", + "fieldtype": "Date", + "label": "Clearance Date", + "no_copy": 1, + "print_hide": 1, + "read_only": 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": 1, - "max_attachments": 0, - "modified": "2019-03-19 14:54:56.524556", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Sales Invoice Payment", - "name_case": "", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 0, - "track_seen": 0, - "track_views": 0 + ], + "istable": 1, + "modified": "2020-08-03 13:07:49.260534", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Payment", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC" } \ No newline at end of file From 4f6a25539a1e004de24e9d19ae04d366c3aeb8cf Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 3 Aug 2020 15:51:39 +0530 Subject: [PATCH 09/18] fix: TypeError while concatenating account number and name in COA (#22886) --- .../doctype/account/chart_of_accounts/chart_of_accounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py index 1bf9196a4f7..0e3b24cda3d 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py @@ -225,7 +225,7 @@ def build_tree_from_json(chart_template, chart_data=None): account['parent_account'] = parent account['expandable'] = True if identify_is_group(child) else False - account['value'] = (child.get('account_number') + ' - ' + account_name) \ + account['value'] = (cstr(child.get('account_number')).strip() + ' - ' + account_name) \ if child.get('account_number') else account_name accounts.append(account) _import_accounts(child, account['value']) From 9afebd311f7c78c5a02282193b9585eca3911c4f Mon Sep 17 00:00:00 2001 From: Marica Date: Mon, 3 Aug 2020 20:39:41 +0530 Subject: [PATCH 10/18] fix: Reposition description in Warehouse (#22896) --- erpnext/stock/doctype/warehouse/warehouse.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/warehouse/warehouse.json b/erpnext/stock/doctype/warehouse/warehouse.json index 3df2506884b..6e40bc53d07 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.json +++ b/erpnext/stock/doctype/warehouse/warehouse.json @@ -84,6 +84,7 @@ "fieldtype": "Column Break" }, { + "description": "If blank, parent Warehouse Account or company default will be considered in transactions", "fieldname": "account", "fieldtype": "Link", "label": "Account", @@ -234,7 +235,7 @@ "idx": 1, "is_tree": 1, "links": [], - "modified": "2020-08-03 11:19:35.943330", + "modified": "2020-08-03 18:41:52.442502", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse", From 02fcf569e6490c80d1947fd7652cb4cc7450dad2 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 3 Aug 2020 20:41:37 +0530 Subject: [PATCH 11/18] fix: SQL query in accounts receivable, payable reports (#22891) --- .../report/accounts_receivable/accounts_receivable.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 724e8b74437..04fc33220d9 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -643,8 +643,10 @@ class ReceivablePayableReport(object): account_type = "Receivable" if self.party_type == "Customer" else "Payable" accounts = [d.name for d in frappe.get_all("Account", filters={"account_type": account_type, "company": self.filters.company})] - conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts))) - values += accounts + + if accounts: + conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts))) + values += accounts def add_customer_filters(self, conditions, values): if self.filters.get("customer_group"): From d2593f0af54b74fb7d37f5aa720da740a667982a Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Tue, 4 Aug 2020 19:29:56 +0530 Subject: [PATCH 12/18] fix: set half day date None if half day is unchecked (#22905) --- erpnext/hr/doctype/leave_application/leave_application.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js index df4cf71b776..7b274119244 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -39,6 +39,9 @@ frappe.ui.form.on("Leave Application", { validate: function(frm) { frm.toggle_reqd("half_day_date", frm.doc.half_day == 1); + if (frm.doc.half_day == 0){ + frm.doc.half_day_date = ""; + } }, make_dashboard: function(frm) { From 97e96cec517a01ae2b46e16c6a90ee5c0af158bf Mon Sep 17 00:00:00 2001 From: Marica Date: Wed, 5 Aug 2020 17:10:50 +0530 Subject: [PATCH 13/18] fix: get_regional_address_details missing positional arg 'company' (#22920) --- erpnext/regional/india/taxes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/regional/india/taxes.js b/erpnext/regional/india/taxes.js index 1e59032db10..44891a76a0b 100644 --- a/erpnext/regional/india/taxes.js +++ b/erpnext/regional/india/taxes.js @@ -10,6 +10,8 @@ erpnext.setup_auto_gst_taxation = (doctype) => { frm.trigger('get_tax_template'); }, get_tax_template: function(frm) { + if (!frm.doc.company) return; + let party_details = { 'shipping_address': frm.doc.shipping_address || '', 'shipping_address_name': frm.doc.shipping_address_name || '', From 10604664d403ae272542e7a85f14eeb88bea36c0 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 19 Jul 2020 21:20:28 +0530 Subject: [PATCH 14/18] fix: Error due to commma in Pricing rule name --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 6 ++++-- erpnext/accounts/doctype/pricing_rule/utils.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index b7c6d4a9728..fcc467536d2 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -247,7 +247,9 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa if pricing_rules: rules = [] + print(pricing_rules, "$$$$$$") for pricing_rule in pricing_rules: + print(pricing_rule) if not pricing_rule: continue if isinstance(pricing_rule, string_types): @@ -280,7 +282,7 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa item_details.has_pricing_rule = 1 - item_details.pricing_rules = ','.join([d.pricing_rule for d in rules]) + item_details.pricing_rules = frappe.as_json([d.pricing_rule for d in rules]) if not doc: return item_details @@ -370,7 +372,7 @@ def set_discount_amount(rate, item_details): def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None): from erpnext.accounts.doctype.pricing_rule.utils import get_pricing_rule_items - for d in pricing_rules.split(','): + for d in json.loads(pricing_rules): if not d or not frappe.db.exists("Pricing Rule", d): continue pricing_rule = frappe.get_cached_doc('Pricing Rule', d) diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index dc27cfb3342..7d20208fc79 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -471,7 +471,7 @@ def apply_pricing_rule_on_transaction(doc): doc.set_missing_values() def get_applied_pricing_rules(item_row): - return (item_row.get("pricing_rules").split(',') + return (json.loads(item_row.get("pricing_rules")) if item_row.get("pricing_rules") else []) def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None): From 579167d1ded5ed788428e94654a388744701bd10 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 19 Jul 2020 21:40:33 +0530 Subject: [PATCH 15/18] fix: Remove print statement --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index fcc467536d2..bb4f5bc602c 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -247,9 +247,7 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa if pricing_rules: rules = [] - print(pricing_rules, "$$$$$$") for pricing_rule in pricing_rules: - print(pricing_rule) if not pricing_rule: continue if isinstance(pricing_rule, string_types): From dd64cd1512739da4c3cebb7e260fd980ff117fa0 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 8 Jul 2020 11:27:25 +0530 Subject: [PATCH 16/18] fix: Add default cost center in payment reconciliation JV --- .../payment_reconciliation/payment_reconciliation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index 8eaad7acd4b..35d8d34c518 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -281,7 +281,8 @@ def reconcile_dr_cr_note(dr_cr_notes, company): 'party_type': d.party_type, d.dr_or_cr: abs(d.allocated_amount), 'reference_type': d.against_voucher_type, - 'reference_name': d.against_voucher + 'reference_name': d.against_voucher, + 'cost_center': erpnext.get_default_cost_center(company) }, { 'account': d.account, @@ -290,7 +291,8 @@ def reconcile_dr_cr_note(dr_cr_notes, company): reconcile_dr_or_cr: (abs(d.allocated_amount) if abs(d.unadjusted_amount) > abs(d.allocated_amount) else abs(d.unadjusted_amount)), 'reference_type': d.voucher_type, - 'reference_name': d.voucher_no + 'reference_name': d.voucher_no, + 'cost_center': erpnext.get_default_cost_center(company) } ] }) From b3cdd91d65cd731c0d458d5225320826cd45d655 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 20 Jul 2020 10:12:17 +0530 Subject: [PATCH 17/18] fix: Tests --- erpnext/controllers/taxes_and_totals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 82f820c4252..7534bf43a69 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -593,7 +593,7 @@ class calculate_taxes_and_totals(object): base_rate_with_margin = 0.0 if item.price_list_rate: if item.pricing_rules and not self.doc.ignore_pricing_rule: - for d in item.pricing_rules.split(','): + for d in json.loads(item.pricing_rules): pricing_rule = frappe.get_cached_doc('Pricing Rule', d) if (pricing_rule.margin_type == 'Amount' and pricing_rule.currency == self.doc.currency)\ From 2cf4168009c0b32ee885ba1a16bc5a5aad97f1e2 Mon Sep 17 00:00:00 2001 From: Afshan <33727827+AfshanKhan@users.noreply.github.com> Date: Thu, 6 Aug 2020 19:04:35 +0530 Subject: [PATCH 18/18] =?UTF-8?q?fix:=20show=20or=20hide=20section=20or=20?= =?UTF-8?q?attributes=20depending=20on=20other=20attributes=E2=80=A6=20(#2?= =?UTF-8?q?2933)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: show or hide section or attributes depending on other attributes for better UI * fix:depends on: batch_no for retain sample Co-authored-by: Marica --- erpnext/stock/doctype/item/item.js | 2 +- erpnext/stock/doctype/item/item.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index c10e62973bb..34476273c28 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -117,7 +117,7 @@ frappe.ui.form.on("Item", { const stock_exists = (frm.doc.__onload && frm.doc.__onload.stock_exists) ? 1 : 0; - ['is_stock_item', 'has_serial_no', 'has_batch_no'].forEach((fieldname) => { + ['is_stock_item', 'has_serial_no', 'has_batch_no', 'has_variants'].forEach((fieldname) => { frm.set_df_property(fieldname, 'read_only', stock_exists); }); diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index b7c2b962f97..11be6588957 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -472,6 +472,7 @@ }, { "default": "0", + "depends_on": "has_batch_no", "fieldname": "retain_sample", "fieldtype": "Check", "label": "Retain Sample" @@ -498,7 +499,7 @@ "oldfieldtype": "Select" }, { - "depends_on": "eval:doc.is_stock_item || doc.is_fixed_asset", + "depends_on": "has_serial_no", "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.", "fieldname": "serial_no_series", "fieldtype": "Data", @@ -1059,7 +1060,7 @@ "idx": 2, "image_field": "image", "max_attachments": 1, - "modified": "2020-07-01 12:43:10.656530", + "modified": "2020-08-06 17:03:26.594319", "modified_by": "Administrator", "module": "Stock", "name": "Item",