From 668ec25d198032d9a64c5da836ed06177bb266b4 Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Wed, 7 Mar 2018 15:31:08 +0530 Subject: [PATCH 01/21] Allow Item variant Rename (#13161) * [WIP] Item varient rename * [wip] Item Variant * [fix] Item Varient Rename * [fix] Item Attribution Rename * removed unwanted code --- erpnext/controllers/item_variant.py | 5 ++- .../item_variant_settings.json | 34 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py index 9eee6cc6df..bf8c88cfb0 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -92,7 +92,10 @@ def validate_is_incremental(numeric_attribute, attribute, value, item): InvalidItemAttributeValueError, title=_('Invalid Attribute')) def validate_item_attribute_value(attributes_list, attribute, attribute_value, item): - if attribute_value not in attributes_list: + allow_rename_attribute_value = frappe.db.get_single_value('Item Variant Settings', 'allow_rename_attribute_value') + if allow_rename_attribute_value: + pass + elif attribute_value not in attributes_list: frappe.throw(_("Value {0} for Attribute {1} does not exist in the list of valid Item Attribute Values for Item {2}").format( attribute_value, attribute, item), InvalidItemAttributeValueError, title=_('Invalid Attribute')) diff --git a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json index 8ad73d19d5..14808c27f3 100644 --- a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json +++ b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.json @@ -72,6 +72,38 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "", + "description": "Rename Attribute Value in Item Attribute.", + "fieldname": "allow_rename_attribute_value", + "fieldtype": "Check", + "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": "Allow Rename Attribute Value", + "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 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -144,7 +176,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-11-14 15:54:12.190518", + "modified": "2018-02-19 11:39:54.401128", "modified_by": "Administrator", "module": "Stock", "name": "Item Variant Settings", From 586e9400b113c8f627867b1be752bc9796f729d8 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Wed, 7 Mar 2018 16:28:21 +0530 Subject: [PATCH 02/21] minor fix for key error --- .../final_assessment_grades.py | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/erpnext/education/report/final_assessment_grades/final_assessment_grades.py b/erpnext/education/report/final_assessment_grades/final_assessment_grades.py index efc9aff083..e6e0ba2ebc 100644 --- a/erpnext/education/report/final_assessment_grades/final_assessment_grades.py +++ b/erpnext/education/report/final_assessment_grades/final_assessment_grades.py @@ -27,26 +27,27 @@ def execute(filters=None): course_dict = values.get("course_dict") for student in args.students: - student_row = {} - student_row["student"] = student - student_row["student_name"] = student_details[student] - for course in course_dict: - scrub_course = frappe.scrub(course) - if assessment_group in assessment_result[student][course]: - student_row["grade_" + scrub_course] = assessment_result[student][course][assessment_group]["Total Score"]["grade"] - student_row["score_" + scrub_course] = assessment_result[student][course][assessment_group]["Total Score"]["score"] + if student_details.get(student): + student_row = {} + student_row["student"] = student + student_row["student_name"] = student_details[student] + for course in course_dict: + scrub_course = frappe.scrub(course) + if assessment_group in assessment_result[student][course]: + student_row["grade_" + scrub_course] = assessment_result[student][course][assessment_group]["Total Score"]["grade"] + student_row["score_" + scrub_course] = assessment_result[student][course][assessment_group]["Total Score"]["score"] - # create the list of possible grades - if student_row["grade_" + scrub_course] not in grades: - grades.append(student_row["grade_" + scrub_course]) + # create the list of possible grades + if student_row["grade_" + scrub_course] not in grades: + grades.append(student_row["grade_" + scrub_course]) - # create the dict of for gradewise analysis - if student_row["grade_" + scrub_course] not in course_wise_analysis[course]: - course_wise_analysis[course][student_row["grade_" + scrub_course]] = 1 - else: - course_wise_analysis[course][student_row["grade_" + scrub_course]] += 1 + # create the dict of for gradewise analysis + if student_row["grade_" + scrub_course] not in course_wise_analysis[course]: + course_wise_analysis[course][student_row["grade_" + scrub_course]] = 1 + else: + course_wise_analysis[course][student_row["grade_" + scrub_course]] += 1 - data.append(student_row) + data.append(student_row) course_list = [d for d in course_dict] columns = get_column(course_dict) From 1643cce47991ab697923f1adf656661e18d1c85b Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Thu, 8 Mar 2018 06:47:17 +0100 Subject: [PATCH 03/21] fetch journal entry details (#13218) --- .../doctype/payment_entry/payment_entry.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 305c08babd..7dfa5c8561 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -684,6 +684,24 @@ def get_company_defaults(company): return ret +def get_outstanding_on_journal_entry(name): + res = frappe.db.sql( + 'SELECT ' + 'CASE WHEN party_type IN ("Customer", "Student") ' + 'THEN ifnull(sum(debit_in_account_currency - credit_in_account_currency), 0) ' + 'ELSE ifnull(sum(credit_in_account_currency - debit_in_account_currency), 0) ' + 'END as outstanding_amount ' + 'FROM `tabGL Entry` WHERE (voucher_no=%s OR against_voucher=%s) ' + 'AND party_type IS NOT NULL ' + 'AND party_type != ""', + (name, name), as_dict=1 + ) + + outstanding_amount = res[0].get('outstanding_amount', 0) if res else 0 + + return outstanding_amount + + @frappe.whitelist() def get_reference_details(reference_doctype, reference_name, party_account_currency): total_amount = outstanding_amount = exchange_rate = None @@ -694,6 +712,13 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre total_amount = ref_doc.get("grand_total") exchange_rate = 1 outstanding_amount = ref_doc.get("outstanding_amount") + elif reference_doctype == "Journal Entry" and ref_doc.docstatus == 1: + total_amount = ref_doc.get("total_amount") + if ref_doc.multi_currency: + exchange_rate = get_exchange_rate(party_account_currency, company_currency, ref_doc.posting_date) + else: + exchange_rate = 1 + outstanding_amount = get_outstanding_on_journal_entry(reference_name) elif reference_doctype != "Journal Entry": if party_account_currency == company_currency: if ref_doc.doctype == "Expense Claim": From a3a63177a147c5456fee1a2fd5119890541b0f8c Mon Sep 17 00:00:00 2001 From: Ranjith Kurungadam Date: Thu, 8 Mar 2018 16:20:22 +0530 Subject: [PATCH 04/21] fix- cannot cancel consultation, remove updating age (#13226) --- erpnext/healthcare/doctype/consultation/consultation.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/erpnext/healthcare/doctype/consultation/consultation.js b/erpnext/healthcare/doctype/consultation/consultation.js index 8ed01c35b8..8b3ecd81b8 100644 --- a/erpnext/healthcare/doctype/consultation/consultation.js +++ b/erpnext/healthcare/doctype/consultation/consultation.js @@ -23,11 +23,6 @@ frappe.ui.form.on('Consultation', { patient: frm.doc.patient }, callback: function (data) { - var age = null; - if(data.message.dob){ - age = calculate_age(data.message.dob); - } - frappe.model.set_value(frm.doctype,frm.docname, "patient_age", age); show_details(data.message); } }); From a32e57ae82a5eba8c8aadc611f9b922d1b41298d Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 8 Mar 2018 16:21:13 +0530 Subject: [PATCH 05/21] [Fix] Discount in offline POS is enabled even is it's disabled in POS Profile (#13233) --- erpnext/accounts/page/pos/pos.js | 6 +++-- erpnext/public/js/pos/pos.html | 28 +++++++++++--------- erpnext/public/js/pos/pos_selected_item.html | 2 +- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 29f27fb70c..fe71f28e61 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -393,7 +393,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.frm = {} this.frm.doc = this.doc this.set_transaction_defaults("Customer"); - this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false, + this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false; + this.frm.doc["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false; this.wrapper.html(frappe.render_template("pos", this.frm.doc)); this.make_search(); this.make_customer(); @@ -1256,6 +1257,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ $(this.wrapper).find('.selected-item').empty(); if(this.child_doc.length) { this.child_doc[0]["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false, + this.child_doc[0]["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false; this.selected_row = $(frappe.render_template("pos_selected_item", this.child_doc[0])) $(this.wrapper).find('.selected-item').html(this.selected_row) } @@ -1683,7 +1685,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ setInterval(function () { me.freeze_screen = false; me.sync_sales_invoice() - }, 60000) + }, 180000) }, sync_sales_invoice: function () { diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html index 1d9fd7c20f..af90756963 100644 --- a/erpnext/public/js/pos/pos.html +++ b/erpnext/public/js/pos/pos.html @@ -37,20 +37,22 @@
-
-
-
{%= __("Discount") %}
-
-
- % - -
-
- {%= get_currency_symbol(currency) %} - + {% if(allow_user_to_edit_discount) { %} +
+
+
{%= __("Discount") %}
+
+
+ % + +
+
+ {%= get_currency_symbol(currency) %} + +
-
+ {% } %}
{% } %}
diff --git a/erpnext/public/js/pos/pos_selected_item.html b/erpnext/public/js/pos/pos_selected_item.html index 085e048184..03c73411a4 100644 --- a/erpnext/public/js/pos/pos_selected_item.html +++ b/erpnext/public/js/pos/pos_selected_item.html @@ -9,7 +9,7 @@
{{ __("Discount") }}: %
- +
{{ __("Price") }}:
From acd3479269b87cb484d7b3fdb9898f5fa2d93f7f Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 8 Mar 2018 16:22:39 +0530 Subject: [PATCH 06/21] Bank POS transactions in bank reconciliation (#13225) --- .../bank_reconciliation.json | 32 ++++++++++++++++++- .../bank_reconciliation.py | 22 +++++++++++-- .../test_bank_reconciliation.py | 8 +++++ .../sales_invoice_payment.json | 32 ++++++++++++++++++- .../bank_reconciliation_statement.js | 7 +++- .../bank_reconciliation_statement.py | 18 ++++++++++- 6 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json index 029421990b..3ab73b717d 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json @@ -159,6 +159,36 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "include_pos_transactions", + "fieldtype": "Check", + "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": "Include POS Transactions", + "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 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -292,7 +322,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-04-21 16:58:26.902732", + "modified": "2018-03-07 18:58:48.658687", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Reconciliation", diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 0aaed8f530..b6336626be 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -53,10 +53,26 @@ class BankReconciliation(Document): posting_date ASC, name DESC """.format(condition), {"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1) - - entries = sorted(list(payment_entries)+list(journal_entries), + + pos_entries = [] + if self.include_pos_transactions: + pos_entries = 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, + account.account_currency, 0 as credit + from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account + where + sip.account=%(account)s and si.docstatus=1 and sip.parent = si.name + and account.name = sip.account and si.posting_date >= %(from)s and si.posting_date <= %(to)s {0} + order by + si.posting_date ASC, si.name DESC + """.format(condition), + {"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1) + + entries = sorted(list(payment_entries)+list(journal_entries+list(pos_entries)), key=lambda k: k['posting_date'] or getdate(nowdate())) - + self.set('payment_entries', []) self.total_amount = 0.0 diff --git a/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py new file mode 100644 index 0000000000..932fb3384c --- /dev/null +++ b/erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + +class TestBankReconciliation(unittest.TestCase): + pass 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 531622d6ac..b9e5c8d517 100644 --- a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json +++ b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json @@ -227,6 +227,36 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 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, + "unique": 0 } ], "has_web_view": 0, @@ -239,7 +269,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-07-24 17:25:03.765856", + "modified": "2018-03-07 18:34:39.552769", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Payment", diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js index 0f9fdd7c02..57fe4b05be 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js @@ -28,5 +28,10 @@ frappe.query_reports["Bank Reconciliation Statement"] = { "default": frappe.datetime.get_today(), "reqd": 1 }, + { + "fieldname":"include_pos_transactions", + "label": __("Include POS Transactions"), + "fieldtype": "Check" + }, ] -} +} \ No newline at end of file diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py index 95b7ff7545..eca59750d5 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py @@ -138,7 +138,23 @@ def get_entries(filters): and ifnull(clearance_date, '4000-01-01') > %(report_date)s """, filters, as_dict=1) - return sorted(list(payment_entries)+list(journal_entries), + pos_entries = [] + if filters.include_pos_transactions: + pos_entries = 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, + account.account_currency, 0 as credit + from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account + where + sip.account=%(account)s and si.docstatus=1 and sip.parent = si.name + and account.name = sip.account and si.posting_date <= %(report_date)s and + ifnull(sip.clearance_date, '4000-01-01') > %(report_date)s + order by + si.posting_date ASC, si.name DESC + """, filters, as_dict=1) + + return sorted(list(payment_entries)+list(journal_entries+list(pos_entries)), key=lambda k: k['posting_date'] or getdate(nowdate())) def get_amounts_not_reflected_in_system(filters): From 22e6f8d4c29829015cc5add1217b09cdd7724182 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Thu, 8 Mar 2018 16:23:59 +0530 Subject: [PATCH 07/21] Fixes for #13071 (#13234) --- erpnext/config/crm.py | 5 +++++ erpnext/config/selling.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/erpnext/config/crm.py b/erpnext/config/crm.py index e51275c260..dd67005ecf 100644 --- a/erpnext/config/crm.py +++ b/erpnext/config/crm.py @@ -126,6 +126,11 @@ def get_data(): "link": "Tree/Sales Person", "description": _("Manage Sales Person Tree."), }, + { + "type": "doctype", + "name": "Lead Source", + "description": _("Track Leads by Lead Source.") + }, ] }, { diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index fef902e32d..b48cafc99a 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -173,6 +173,11 @@ def get_data(): "name": "Industry Type", "description": _("Track Leads by Industry Type.") }, + { + "type": "doctype", + "name": "Lead Source", + "description": _("Track Leads by Lead Source.") + }, ] }, { From 3fd634783de51b3411b4b5817f7c0d6803634144 Mon Sep 17 00:00:00 2001 From: Zarrar Date: Fri, 9 Mar 2018 12:10:45 +0530 Subject: [PATCH 08/21] [Enhance] Fetch Customer's Item code based on Customer Name or Customer Group (#13198) * customer code can be assigned based on customer group * improvise customer group selection * requested changes made --- erpnext/stock/doctype/item/item.js | 29 + erpnext/stock/doctype/item/item.json | 509 +++++++++++------- .../item_customer_detail.json | 53 +- erpnext/stock/get_item_details.py | 10 +- 4 files changed, 414 insertions(+), 187 deletions(-) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index ff01a19be4..90921764c5 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -170,6 +170,35 @@ frappe.ui.form.on('Item Reorder', { } }) +frappe.ui.form.on('Item Customer Detail', { + customer_items_add: function(frm, cdt, cdn) { + frappe.model.set_value(cdt, cdn, 'customer_group', ""); + }, + customer_name: function(frm, cdt, cdn) { + set_customer_group(frm, cdt, cdn); + }, + customer_group: function(frm, cdt, cdn) { + if(set_customer_group(frm, cdt, cdn)){ + frappe.msgprint(__("Changing Customer Group for the selected Customer is not allowed.")); + } + } +}); + +var set_customer_group = function(frm, cdt, cdn) { + var row = frappe.get_doc(cdt, cdn); + + if (!row.customer_name) { + return false; + } + + frappe.model.with_doc("Customer", row.customer_name, function() { + var customer = frappe.model.get_doc("Customer", row.customer_name); + row.customer_group = customer.customer_group; + refresh_field("customer_group", cdn, "customer_items"); + }); + return true; +} + $.extend(erpnext.item, { setup_queries: function(frm) { frm.fields_dict['expense_account'].get_query = function(doc) { diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 689089c74e..0c834c5532 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -44,6 +44,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -74,6 +75,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 1, + "translatable": 0, "unique": 0 }, { @@ -106,6 +108,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -139,6 +142,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 1, + "translatable": 0, "unique": 0 }, { @@ -170,6 +174,7 @@ "reqd": 0, "search_index": 1, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -199,6 +204,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -232,6 +238,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -262,6 +269,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -295,6 +303,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -323,6 +332,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -353,6 +363,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -387,6 +398,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -418,6 +430,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -449,6 +462,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -480,6 +494,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -510,6 +525,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 1, + "translatable": 0, "unique": 0 }, { @@ -542,6 +558,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -575,6 +592,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -606,6 +624,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -636,6 +655,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -668,6 +688,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -699,69 +720,72 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "sb_barcodes", - "fieldtype": "Section 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, - "label": "Barcodes", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "sb_barcodes", + "fieldtype": "Section 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, + "label": "Barcodes", + "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 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "barcodes", - "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": "Barcodes", - "length": 0, - "no_copy": 0, - "options": "Item Barcode", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "barcodes", + "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": "Barcodes", + "length": 0, + "no_copy": 0, + "options": "Item Barcode", + "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 - }, + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -793,6 +817,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -827,6 +852,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -857,6 +883,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -890,6 +917,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -922,6 +950,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -952,6 +981,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "50%" }, @@ -984,6 +1014,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 1, + "translatable": 0, "unique": 0 }, { @@ -1016,6 +1047,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1047,6 +1079,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1078,6 +1111,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1110,6 +1144,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1142,6 +1177,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1173,6 +1209,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1207,6 +1244,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1239,6 +1277,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1273,6 +1312,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1305,6 +1345,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1336,6 +1377,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1367,6 +1409,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1399,6 +1442,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1428,6 +1472,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1463,6 +1508,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1494,6 +1540,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1526,6 +1573,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1560,6 +1608,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1593,6 +1642,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 1, + "translatable": 0, "unique": 0 }, { @@ -1625,6 +1675,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1656,6 +1707,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1687,6 +1739,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1718,6 +1771,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1752,6 +1806,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1782,6 +1837,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1812,6 +1868,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1845,6 +1902,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1879,6 +1937,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1913,6 +1972,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1945,6 +2005,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -1976,6 +2037,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2007,6 +2069,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2037,6 +2100,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2068,6 +2132,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2098,6 +2163,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2129,6 +2195,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "50%" }, @@ -2161,6 +2228,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2191,6 +2259,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2222,6 +2291,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2251,6 +2321,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2282,6 +2353,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2313,37 +2385,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "fieldname": "is_sales_item", - "fieldtype": "Check", - "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": "Is Sales Item", - "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 }, { @@ -2375,6 +2417,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2406,8 +2449,74 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "fieldname": "is_sales_item", + "fieldtype": "Check", + "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": "Is Sales Item", + "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 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "column_break3", + "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, + "label": "", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Column Break", + "permlevel": 0, + "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, + "width": "50%" + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2437,70 +2546,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "column_break3", - "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, - "label": "Customer Item Codes", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Column Break", - "permlevel": 0, - "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, - "width": "50%" - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "description": "", - "fieldname": "customer_items", - "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": "Customer Items", - "length": 0, - "no_copy": 0, - "options": "Item Customer Detail", - "permlevel": 0, - "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 }, { @@ -2533,6 +2579,71 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "customer_details", + "fieldtype": "Section 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, + "label": "Customer Details", + "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 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "description": "", + "fieldname": "customer_items", + "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": "Customer Items", + "length": 0, + "no_copy": 0, + "options": "Item Customer Detail", + "permlevel": 0, + "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 }, { @@ -2564,6 +2675,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2597,6 +2709,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2628,6 +2741,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2661,6 +2775,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2691,38 +2806,40 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)", - "fieldname": "quality_inspection_template", - "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": "Quality Inspection Template", - "length": 0, - "no_copy": 0, - "options": "Quality Inspection Template", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)", + "fieldname": "quality_inspection_template", + "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": "Quality Inspection Template", + "length": 0, + "no_copy": 0, + "options": "Quality Inspection Template", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "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 }, { @@ -2755,6 +2872,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2788,6 +2906,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2822,6 +2941,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2851,6 +2971,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2880,6 +3001,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2910,6 +3032,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2940,6 +3063,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -2971,6 +3095,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3002,6 +3127,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3033,6 +3159,7 @@ "reqd": 0, "search_index": 1, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3065,6 +3192,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3097,6 +3225,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3127,6 +3256,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3155,6 +3285,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3187,6 +3318,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3219,6 +3351,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3250,6 +3383,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3280,6 +3414,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3311,6 +3446,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3341,6 +3477,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3371,6 +3508,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3402,6 +3540,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3434,6 +3573,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3465,6 +3605,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3497,6 +3638,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -3528,6 +3670,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -3543,7 +3686,7 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2018-02-19 13:48:35.779089", + "modified": "2018-03-06 10:21:48.715529", "modified_by": "Administrator", "module": "Stock", "name": "Item", @@ -3715,7 +3858,7 @@ "read_only_onload": 0, "search_fields": "item_name,description,item_group,customer_code", "show_name_in_global_search": 1, - "sort_field": "idx desc, modified desc", + "sort_field": "idx desc,modified desc", "sort_order": "DESC", "title_field": "item_name", "track_changes": 1, diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json index 46d480e1aa..c0305a9d82 100644 --- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json +++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "autoname": "hash", @@ -12,16 +13,20 @@ "editable_grid": 1, "fields": [ { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 1, "collapsible": 0, + "columns": 0, "fieldname": "customer_name", "fieldtype": "Link", "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": "Customer Name", "length": 0, "no_copy": 0, @@ -33,24 +38,62 @@ "print_hide_if_no_value": 0, "print_width": "180px", "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 1, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "180px" }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 0, + "fieldname": "customer_group", + "fieldtype": "Link", + "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": "Customer Group", + "length": 0, + "no_copy": 0, + "options": "Customer Group", + "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 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "ref_code", "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": "Ref Code", "length": 0, "no_copy": 0, @@ -61,25 +104,27 @@ "print_hide_if_no_value": 0, "print_width": "120px", "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 1, "search_index": 1, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "120px" } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 1, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-07-11 03:28:00.992064", + "modified": "2018-03-08 14:22:38.019369", "modified_by": "Administrator", "module": "Stock", "name": "Item Customer Detail", @@ -88,5 +133,7 @@ "quick_entry": 0, "read_only": 0, "read_only_onload": 0, + "show_name_in_global_search": 0, + "track_changes": 0, "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 35d76a50e2..067acc79c4 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -396,8 +396,16 @@ def validate_conversion_rate(args, meta): def get_party_item_code(args, item_doc, out): if args.transaction_type=="selling" and args.customer: + out.customer_item_code = None customer_item_code = item_doc.get("customer_items", {"customer_name": args.customer}) - out.customer_item_code = customer_item_code[0].ref_code if customer_item_code else None + + if customer_item_code: + out.customer_item_code = customer_item_code[0].ref_code + else: + customer_group = frappe.db.get_value("Customer", args.customer, "customer_group") + customer_group_item_code = item_doc.get("customer_items", {"customer_group": customer_group}) + if customer_group_item_code and not customer_group_item_code[0].customer_name: + out.customer_item_code = customer_group_item_code[0].ref_code if args.transaction_type=="buying" and args.supplier: item_supplier = item_doc.get("supplier_items", {"supplier": args.supplier}) From aadd30d1947d768751d981335affa4393d4fc8bd Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Fri, 9 Mar 2018 12:19:35 +0530 Subject: [PATCH 09/21] fetch delivery date on add-row only if item_code exists (#13250) --- .../doctype/sales_order/sales_order.js | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index a9eb7dbac1..03e519aa4e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -48,6 +48,15 @@ frappe.ui.form.on("Sales Order", { }); frappe.ui.form.on("Sales Order Item", { + item_code: function(frm,cdt,cdn) { + var row = locals[cdt][cdn]; + if (frm.doc.delivery_date) { + row.delivery_date = frm.doc.delivery_date; + refresh_field("delivery_date", cdn, "items"); + } else { + this.frm.script_manager.copy_from_first_row("items", row, ["delivery_date"]); + } + }, delivery_date: function(frm, cdt, cdn) { if(!frm.doc.delivery_date) { erpnext.utils.copy_value_in_all_row(frm.doc, cdt, cdn, "items", "delivery_date"); @@ -433,17 +442,6 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( if(cint(frappe.boot.notification_settings.sales_order)) { this.frm.email_doc(frappe.boot.notification_settings.sales_order_message); } - }, - - items_add: function(doc, cdt, cdn) { - var row = frappe.get_doc(cdt, cdn); - if(doc.delivery_date) { - row.delivery_date = doc.delivery_date; - refresh_field("delivery_date", cdn, "items"); - } else { - this.frm.script_manager.copy_from_first_row("items", row, ["delivery_date"]); - } } }); - $.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm})); \ No newline at end of file From e69747ca6dd8c09491787e5b1ec2a698c2c1c41a Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Fri, 9 Mar 2018 07:53:53 +0100 Subject: [PATCH 10/21] [Feature Request] Add Payment Mode field on Payment Terms Template #13117 (#13243) * add mode of payment field to Payment Term * add mode of payment field to Payment Terms Template Detail * add mode of payment field to Payment Schedule * add mode of payment in `get_payment_term_details` --- .../payment_schedule/payment_schedule.json | 41 +++++++++++++++++- .../doctype/payment_term/payment_term.json | 42 ++++++++++++++++++- .../payment_terms_template_detail.json | 40 +++++++++++++++++- erpnext/controllers/accounts_controller.py | 1 + 4 files changed, 120 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_schedule/payment_schedule.json b/erpnext/accounts/doctype/payment_schedule/payment_schedule.json index 2fcd44f697..3ae7d62c17 100644 --- a/erpnext/accounts/doctype/payment_schedule/payment_schedule.json +++ b/erpnext/accounts/doctype/payment_schedule/payment_schedule.json @@ -42,6 +42,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -73,6 +74,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -104,6 +106,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -135,6 +138,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -166,6 +170,39 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 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": 0, + "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": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -179,8 +216,8 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-12-19 16:20:33.546984", - "modified_by": "nabinhait@gmail.com", + "modified": "2018-03-08 11:26:18.266987", + "modified_by": "Administrator", "module": "Accounts", "name": "Payment Schedule", "name_case": "", diff --git a/erpnext/accounts/doctype/payment_term/payment_term.json b/erpnext/accounts/doctype/payment_term/payment_term.json index 10cfcf2a32..723d3bd72c 100644 --- a/erpnext/accounts/doctype/payment_term/payment_term.json +++ b/erpnext/accounts/doctype/payment_term/payment_term.json @@ -41,6 +41,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -71,6 +72,39 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 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": 0, + "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": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -100,6 +134,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -131,6 +166,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -162,6 +198,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -193,6 +230,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -222,6 +260,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -252,6 +291,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -265,7 +305,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-01-24 11:13:42.800048", + "modified": "2018-03-08 10:47:32.830478", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Term", diff --git a/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.json b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.json index f808a0f863..ee2cfc00aa 100644 --- a/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.json +++ b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.json @@ -42,6 +42,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -73,6 +74,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -105,6 +107,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -136,6 +139,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -169,6 +173,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -201,6 +206,39 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 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": 0, + "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": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -214,7 +252,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-09-26 05:21:51.738319", + "modified": "2018-03-08 11:07:09.014151", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Terms Template Detail", diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index c6d911a26f..3884bef1a4 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -947,6 +947,7 @@ def get_payment_term_details(term, posting_date=None, grand_total=None, bill_dat if getdate(term_details.due_date) < getdate(posting_date): term_details.due_date = posting_date + term_details.mode_of_payment = term.mode_of_payment return term_details From f2d28ebd6a8bd7a6d94e36128378797a739c0fc9 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Fri, 9 Mar 2018 12:33:13 +0530 Subject: [PATCH 11/21] Data import Tool bug fix (#13165) * fixes #13064 * commonified naming series checks * test fixes replaced test employee names according to naming series --- erpnext/buying/doctype/supplier/supplier.py | 4 +-- .../doctype/instructor/instructor.py | 4 +-- .../doctype/instructor/test_records.json | 4 +-- erpnext/healthcare/doctype/patient/patient.py | 7 ++--- .../hr/doctype/attendance/test_records.json | 2 +- erpnext/hr/doctype/employee/employee.py | 4 +-- .../employee_advance/test_employee_advance.py | 4 +-- .../expense_claim/test_expense_claim.py | 2 +- .../leave_allocation/test_records.json | 4 +-- .../test_leave_application.py | 20 ++++++------- .../activity_cost/test_activity_cost.py | 2 +- .../doctype/timesheet/test_timesheet.py | 26 ++++++++--------- erpnext/selling/doctype/campaign/campaign.py | 4 +-- erpnext/selling/doctype/customer/customer.py | 7 ++--- .../doctype/sales_person/test_records.json | 28 +++++++++---------- erpnext/stock/doctype/item/item.py | 4 +-- 16 files changed, 60 insertions(+), 66 deletions(-) diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index c715fbd2a6..6aa3b019d5 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe import frappe.defaults from frappe import msgprint, _ -from frappe.model.naming import make_autoname +from frappe.model.naming import set_name_by_naming_series from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address from erpnext.utilities.transaction_base import TransactionBase from erpnext.accounts.party import validate_party_accounts, get_dashboard_info, get_timeline_data # keep this @@ -28,7 +28,7 @@ class Supplier(TransactionBase): if supp_master_name == 'Supplier Name': self.name = self.supplier_name else: - self.name = make_autoname(self.naming_series + '.#####') + set_name_by_naming_series(self) def on_update(self): if not self.naming_series: diff --git a/erpnext/education/doctype/instructor/instructor.py b/erpnext/education/doctype/instructor/instructor.py index 78e4261375..0756b5f01a 100644 --- a/erpnext/education/doctype/instructor/instructor.py +++ b/erpnext/education/doctype/instructor/instructor.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document -from frappe.model.naming import make_autoname +from frappe.model.naming import set_name_by_naming_series class Instructor(Document): def autoname(self): @@ -15,7 +15,7 @@ class Instructor(Document): frappe.throw(_("Please setup Instructor Naming System in Education > Education Settings")) else: if naming_method == 'Naming Series': - self.name = make_autoname(self.naming_series + '.####') + set_name_by_naming_series(self) elif naming_method == 'Employee Number': if not self.employee: frappe.throw(_("Please select Employee")) diff --git a/erpnext/education/doctype/instructor/test_records.json b/erpnext/education/doctype/instructor/test_records.json index 3747c0d21b..220d84eb96 100644 --- a/erpnext/education/doctype/instructor/test_records.json +++ b/erpnext/education/doctype/instructor/test_records.json @@ -1,12 +1,12 @@ [ { "naming_series": "_T-Instructor-", - "employee": "_T-Employee-0001", + "employee": "_T-Employee-00001", "instructor_name": "_Test Instructor" }, { "naming_series": "_T-Instructor-", - "employee": "_T-Employee-0002", + "employee": "_T-Employee-00002", "instructor_name": "_Test Instructor 2" } ] diff --git a/erpnext/healthcare/doctype/patient/patient.py b/erpnext/healthcare/doctype/patient/patient.py index b01f56ad6d..d0332d80d0 100644 --- a/erpnext/healthcare/doctype/patient/patient.py +++ b/erpnext/healthcare/doctype/patient/patient.py @@ -8,7 +8,7 @@ from frappe import _ from frappe.model.document import Document from frappe.utils import cint, cstr, getdate import dateutil -from frappe.model.naming import make_autoname +from frappe.model.naming import set_name_by_naming_series from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account,get_income_account,send_registration_sms class Patient(Document): @@ -42,10 +42,7 @@ class Patient(Document): if patient_master_name == 'Patient Name': self.name = self.get_patient_name() else: - if not self.naming_series: - frappe.throw(_("Series is mandatory"), frappe.MandatoryError) - - self.name = make_autoname(self.naming_series+'.#####') + set_name_by_naming_series(self) def get_patient_name(self): name = self.patient_name diff --git a/erpnext/hr/doctype/attendance/test_records.json b/erpnext/hr/doctype/attendance/test_records.json index 1c8f3b5633..096f95c6f7 100644 --- a/erpnext/hr/doctype/attendance/test_records.json +++ b/erpnext/hr/doctype/attendance/test_records.json @@ -2,7 +2,7 @@ { "doctype": "Attendance", "name": "_Test Attendance 1", - "employee": "_T-Employee-0001", + "employee": "_T-Employee-00001", "status": "Present", "attendance_date": "2014-02-01", "company": "_Test Company" diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 25d3ec4bc9..5446a6e4a8 100755 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import getdate, validate_email_add, today, add_years -from frappe.model.naming import make_autoname +from frappe.model.naming import set_name_by_naming_series from frappe import throw, _, scrub import frappe.permissions from frappe.model.document import Document @@ -24,7 +24,7 @@ class Employee(NestedSet): throw(_("Please setup Employee Naming System in Human Resource > HR Settings")) else: if naming_method == 'Naming Series': - self.name = make_autoname(self.naming_series + '.####') + set_name_by_naming_series(self) elif naming_method == 'Employee Number': self.name = self.employee_number elif naming_method == 'Full Name': diff --git a/erpnext/hr/doctype/employee_advance/test_employee_advance.py b/erpnext/hr/doctype/employee_advance/test_employee_advance.py index cacf90ef05..2097e711de 100644 --- a/erpnext/hr/doctype/employee_advance/test_employee_advance.py +++ b/erpnext/hr/doctype/employee_advance/test_employee_advance.py @@ -35,7 +35,7 @@ def make_payment_entry(advance): def make_employee_advance(): doc = frappe.new_doc("Employee Advance") - doc.employee = "_T-Employee-0001" + doc.employee = "_T-Employee-00001" doc.company = "_Test company" doc.purpose = "For site visit" doc.advance_amount = 1000 @@ -43,5 +43,5 @@ def make_employee_advance(): doc.advance_account = "_Test Employee Advance - _TC" doc.insert() doc.submit() - + return doc \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim/test_expense_claim.py b/erpnext/hr/doctype/expense_claim/test_expense_claim.py index e0ba088fed..f89beba2f6 100644 --- a/erpnext/hr/doctype/expense_claim/test_expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/test_expense_claim.py @@ -87,7 +87,7 @@ def get_payable_account(company): def make_expense_claim(payable_account,claim_amount, sanctioned_amount, company, account, project=None, task_name=None): expense_claim = frappe.get_doc({ "doctype": "Expense Claim", - "employee": "_T-Employee-0001", + "employee": "_T-Employee-00001", "payable_account": payable_account, "company": company, "expenses": diff --git a/erpnext/hr/doctype/leave_allocation/test_records.json b/erpnext/hr/doctype/leave_allocation/test_records.json index 106ed0e615..23acbb026e 100644 --- a/erpnext/hr/doctype/leave_allocation/test_records.json +++ b/erpnext/hr/doctype/leave_allocation/test_records.json @@ -2,7 +2,7 @@ { "docstatus": 1, "doctype": "Leave Allocation", - "employee": "_T-Employee-0001", + "employee": "_T-Employee-00001", "from_date": "2013-01-01", "to_date": "2013-12-31", "leave_type": "_Test Leave Type", @@ -11,7 +11,7 @@ { "docstatus": 1, "doctype": "Leave Allocation", - "employee": "_T-Employee-0002", + "employee": "_T-Employee-00002", "from_date": "2013-01-01", "to_date": "2013-12-31", "leave_type": "_Test Leave Type", diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 4a9a001339..38b10f7df1 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -14,7 +14,7 @@ _test_records = [ { "company": "_Test Company", "doctype": "Leave Application", - "employee": "_T-Employee-0001", + "employee": "_T-Employee-00001", "from_date": "2013-05-01", "leave_type": "_Test Leave Type", "posting_date": "2013-01-02", @@ -23,7 +23,7 @@ _test_records = [ { "company": "_Test Company", "doctype": "Leave Application", - "employee": "_T-Employee-0002", + "employee": "_T-Employee-00002", "from_date": "2013-05-01", "leave_type": "_Test Leave Type", "posting_date": "2013-01-02", @@ -32,7 +32,7 @@ _test_records = [ { "company": "_Test Company", "doctype": "Leave Application", - "employee": "_T-Employee-0001", + "employee": "_T-Employee-00001", "from_date": "2013-01-15", "leave_type": "_Test Leave Type LWP", "posting_date": "2013-01-02", @@ -188,7 +188,7 @@ class TestLeaveApplication(unittest.TestCase): application.half_day_date = application.from_date self.assertRaises(OverlapError, application.insert) - + def test_overlap_with_half_day_3(self): self._clear_roles() self._clear_applications() @@ -206,14 +206,14 @@ class TestLeaveApplication(unittest.TestCase): application.half_day = 1 application.half_day_date = "2013-01-05" application.insert() - + # Apply leave from 4-7, half day on 5th application = self.get_application(_test_records[0]) application.from_date = "2013-01-04" application.to_date = "2013-01-07" application.half_day = 1 application.half_day_date = "2013-01-05" - + self.assertRaises(OverlapError, application.insert) # Apply leave from 5-7, half day on 5th @@ -230,15 +230,15 @@ class TestLeaveApplication(unittest.TestCase): from frappe.utils.user import add_role add_role("test1@example.com", "Employee") add_role("test@example.com", "Leave Approver") - self._add_employee_leave_approver("_T-Employee-0002", "test@example.com") + self._add_employee_leave_approver("_T-Employee-00002", "test@example.com") - make_allocation_record(employee="_T-Employee-0002") + make_allocation_record(employee="_T-Employee-00002") application = self.get_application(_test_records[1]) frappe.db.set_value("Leave Block List", "_Test Leave Block List", "applies_to_all_departments", 1) - frappe.db.set_value("Employee", "_T-Employee-0002", "department", + frappe.db.set_value("Employee", "_T-Employee-00002", "department", "_Test Department") frappe.set_user("test1@example.com") @@ -255,7 +255,7 @@ def make_allocation_record(employee=None, leave_type=None): allocation = frappe.get_doc({ "doctype": "Leave Allocation", - "employee": employee or "_T-Employee-0001", + "employee": employee or "_T-Employee-00001", "leave_type": leave_type or "_Test Leave Type", "from_date": "2013-01-01", "to_date": "2015-12-31", diff --git a/erpnext/projects/doctype/activity_cost/test_activity_cost.py b/erpnext/projects/doctype/activity_cost/test_activity_cost.py index 58c3f21bef..67d76eb1ee 100644 --- a/erpnext/projects/doctype/activity_cost/test_activity_cost.py +++ b/erpnext/projects/doctype/activity_cost/test_activity_cost.py @@ -13,7 +13,7 @@ class TestActivityCost(unittest.TestCase): frappe.db.sql("delete from `tabActivity Cost`") activity_cost1 = frappe.new_doc('Activity Cost') activity_cost1.update({ - "employee": "_T-Employee-0001", + "employee": "_T-Employee-00001", "employee_name": "_Test Employee", "activity_type": "_Test Activity Type 1", "billing_rate": 100, diff --git a/erpnext/projects/doctype/timesheet/test_timesheet.py b/erpnext/projects/doctype/timesheet/test_timesheet.py index 793355e1fc..2458db0cba 100644 --- a/erpnext/projects/doctype/timesheet/test_timesheet.py +++ b/erpnext/projects/doctype/timesheet/test_timesheet.py @@ -14,8 +14,8 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal class TestTimesheet(unittest.TestCase): def test_timesheet_billing_amount(self): - make_salary_structure("_T-Employee-0001") - timesheet = make_timesheet("_T-Employee-0001", simulate=True, billable=1) + make_salary_structure("_T-Employee-00001") + timesheet = make_timesheet("_T-Employee-00001", simulate=True, billable=1) self.assertEqual(timesheet.total_hours, 2) self.assertEqual(timesheet.total_billable_hours, 2) @@ -24,8 +24,8 @@ class TestTimesheet(unittest.TestCase): self.assertEqual(timesheet.total_billable_amount, 100) def test_timesheet_billing_amount_not_billable(self): - make_salary_structure("_T-Employee-0001") - timesheet = make_timesheet("_T-Employee-0001", simulate=True, billable=0) + make_salary_structure("_T-Employee-00001") + timesheet = make_timesheet("_T-Employee-00001", simulate=True, billable=0) self.assertEqual(timesheet.total_hours, 2) self.assertEqual(timesheet.total_billable_hours, 0) @@ -34,8 +34,8 @@ class TestTimesheet(unittest.TestCase): self.assertEqual(timesheet.total_billable_amount, 0) def test_salary_slip_from_timesheet(self): - salary_structure = make_salary_structure("_T-Employee-0001") - timesheet = make_timesheet("_T-Employee-0001", simulate = True, billable=1) + salary_structure = make_salary_structure("_T-Employee-00001") + timesheet = make_timesheet("_T-Employee-00001", simulate = True, billable=1) salary_slip = make_salary_slip(timesheet.name) salary_slip.submit() @@ -44,7 +44,7 @@ class TestTimesheet(unittest.TestCase): self.assertEqual(salary_slip.net_pay, 150) self.assertEqual(salary_slip.timesheets[0].time_sheet, timesheet.name) self.assertEqual(salary_slip.timesheets[0].working_hours, 2) - + timesheet = frappe.get_doc('Timesheet', timesheet.name) self.assertEqual(timesheet.status, 'Payslip') salary_slip.cancel() @@ -53,7 +53,7 @@ class TestTimesheet(unittest.TestCase): self.assertEqual(timesheet.status, 'Submitted') def test_sales_invoice_from_timesheet(self): - timesheet = make_timesheet("_T-Employee-0001", simulate=True, billable=1) + timesheet = make_timesheet("_T-Employee-00001", simulate=True, billable=1) sales_invoice = make_sales_invoice(timesheet.name, '_Test Item', '_Test Customer') sales_invoice.due_date = nowdate() sales_invoice.submit() @@ -68,7 +68,7 @@ class TestTimesheet(unittest.TestCase): self.assertEqual(item.rate, 50.00) def test_timesheet_billing_based_on_project(self): - timesheet = make_timesheet("_T-Employee-0001", simulate=True, billable=1, project = '_Test Project', company='_Test Company') + timesheet = make_timesheet("_T-Employee-00001", simulate=True, billable=1, project = '_Test Project', company='_Test Company') sales_invoice = create_sales_invoice(do_not_save=True) sales_invoice.project = '_Test Project' sales_invoice.submit() @@ -85,7 +85,7 @@ class TestTimesheet(unittest.TestCase): update_activity_type("_Test Activity Type") timesheet = frappe.new_doc("Timesheet") - timesheet.employee = "_T-Employee-0001" + timesheet.employee = "_T-Employee-00001" timesheet.append( 'time_logs', { @@ -140,11 +140,11 @@ def make_salary_structure(employee): "base": 1200, "from_date": add_months(nowdate(),-1) }) - - + + es = salary_structure.append('earnings', { "salary_component": "_Test Allowance", - "amount": 100 + "amount": 100 }) ds = salary_structure.append('deductions', { diff --git a/erpnext/selling/doctype/campaign/campaign.py b/erpnext/selling/doctype/campaign/campaign.py index 6ce457d629..10945428ae 100644 --- a/erpnext/selling/doctype/campaign/campaign.py +++ b/erpnext/selling/doctype/campaign/campaign.py @@ -5,11 +5,11 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -from frappe.model.naming import make_autoname +from frappe.model.naming import set_name_by_naming_series class Campaign(Document): def autoname(self): if frappe.defaults.get_global_default('campaign_naming_by') != 'Naming Series': self.name = self.campaign_name else: - self.name = make_autoname(self.naming_series+'.#####') + set_name_by_naming_series(self) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index ccf4082a4b..78f892b990 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.model.naming import make_autoname +from frappe.model.naming import set_name_by_naming_series from frappe import _, msgprint, throw import frappe.defaults from frappe.utils import flt, cint, cstr @@ -31,10 +31,7 @@ class Customer(TransactionBase): if cust_master_name == 'Customer Name': self.name = self.get_customer_name() else: - if not self.naming_series: - frappe.throw(_("Series is mandatory"), frappe.MandatoryError) - - self.name = make_autoname(self.naming_series+'.#####') + set_name_by_naming_series(self) def get_customer_name(self): if frappe.db.get_value("Customer", self.customer_name): diff --git a/erpnext/setup/doctype/sales_person/test_records.json b/erpnext/setup/doctype/sales_person/test_records.json index 75d6cd3797..536552a0c3 100644 --- a/erpnext/setup/doctype/sales_person/test_records.json +++ b/erpnext/setup/doctype/sales_person/test_records.json @@ -1,23 +1,23 @@ [ { - "doctype": "Sales Person", - "employee": "_T-Employee-0001", - "is_group": 0, - "parent_sales_person": "Sales Team", + "doctype": "Sales Person", + "employee": "_T-Employee-00001", + "is_group": 0, + "parent_sales_person": "Sales Team", "sales_person_name": "_Test Sales Person" - }, + }, { - "doctype": "Sales Person", - "employee": "_T-Employee-0002", - "is_group": 0, - "parent_sales_person": "Sales Team", + "doctype": "Sales Person", + "employee": "_T-Employee-00002", + "is_group": 0, + "parent_sales_person": "Sales Team", "sales_person_name": "_Test Sales Person 1" - }, + }, { - "doctype": "Sales Person", - "employee": "_T-Employee-0003", - "is_group": 0, - "parent_sales_person": "Sales Team", + "doctype": "Sales Person", + "employee": "_T-Employee-00003", + "is_group": 0, + "parent_sales_person": "Sales Team", "sales_person_name": "_Test Sales Person 2" } ] \ No newline at end of file diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 1c85ecd4e2..42a63eef6e 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -53,8 +53,8 @@ class Item(WebsiteGenerator): template_item_name = frappe.db.get_value("Item", self.variant_of, "item_name") self.item_code = make_variant_item_code(self.variant_of, template_item_name, self) else: - from frappe.model.naming import make_autoname - self.item_code = make_autoname(self.naming_series + '.#####') + from frappe.model.naming import set_name_by_naming_series + set_name_by_naming_series(self) elif not self.item_code: msgprint(_("Item Code is mandatory because Item is not automatically numbered"), raise_exception=1) From b4de7e3d0744da469fadfe55702a1ef21d6cf121 Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Fri, 9 Mar 2018 12:35:47 +0530 Subject: [PATCH 12/21] removed has_key, used pythonic in (#13236) * removed has_key, used pythonic in * Update bom.py --- .../accounts/report/purchase_register/purchase_register.py | 2 +- erpnext/accounts/report/sales_register/sales_register.py | 2 +- erpnext/manufacturing/doctype/bom/bom.py | 4 ++-- erpnext/stock/doctype/material_request/material_request.py | 4 ++-- erpnext/stock/utils.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py index 610475acfc..73bb4dc22d 100644 --- a/erpnext/accounts/report/purchase_register/purchase_register.py +++ b/erpnext/accounts/report/purchase_register/purchase_register.py @@ -179,7 +179,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts): invoice_tax_map = {} for d in tax_details: if d.account_head in expense_accounts: - if invoice_expense_map[d.parent].has_key(d.account_head): + if d.account_head in invoice_expense_map[d.parent]: invoice_expense_map[d.parent][d.account_head] += flt(d.tax_amount) else: invoice_expense_map[d.parent][d.account_head] = flt(d.tax_amount) diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py index ace8d54916..4debbd6cb8 100644 --- a/erpnext/accounts/report/sales_register/sales_register.py +++ b/erpnext/accounts/report/sales_register/sales_register.py @@ -189,7 +189,7 @@ def get_invoice_tax_map(invoice_list, invoice_income_map, income_accounts): invoice_tax_map = {} for d in tax_details: if d.account_head in income_accounts: - if invoice_income_map[d.parent].has_key(d.account_head): + if d.account_head in invoice_income_map[d.parent]: invoice_income_map[d.parent][d.account_head] += flt(d.tax_amount) else: invoice_income_map[d.parent][d.account_head] = flt(d.tax_amount) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index c6463fa37d..ea33f4ed02 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -573,7 +573,7 @@ def get_bom_items_as_dict(bom, company, qty=1, fetch_exploded=1, fetch_scrap_ite items = frappe.db.sql(query, { "qty": qty, "bom": bom }, as_dict=True) for item in items: - if item_dict.has_key(item.item_code): + if item.item_code in item_dict: item_dict[item.item_code]["qty"] += flt(item.qty) else: item_dict[item.item_code] = item @@ -653,4 +653,4 @@ def get_boms_in_bottom_up_order(bom_no=None): bom_list.append(child_bom) count += 1 - return bom_list \ No newline at end of file + return bom_list diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 9834183d77..7ddea71505 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -32,10 +32,10 @@ class MaterialRequest(BuyingController): so_items = {} # Format --> {'SO/00001': {'Item/001': 120, 'Item/002': 24}} for d in self.get('items'): if d.sales_order: - if not so_items.has_key(d.sales_order): + if not d.sales_order in so_items: so_items[d.sales_order] = {d.item_code: flt(d.qty)} else: - if not so_items[d.sales_order].has_key(d.item_code): + if not d.item_code in so_items[d.sales_order]: so_items[d.sales_order][d.item_code] = flt(d.qty) else: so_items[d.sales_order][d.item_code] += flt(d.qty) diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 6f8b2c954c..0e9f500b94 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -43,7 +43,7 @@ def get_stock_value_on(warehouse=None, posting_date=None, item_code=None): sle_map = {} for sle in stock_ledger_entries: - if not sle_map.has_key((sle.item_code, sle.warehouse)): + if not (sle.item_code, sle.warehouse) in sle_map: sle_map[(sle.item_code, sle.warehouse)] = flt(sle.stock_value) return sum(sle_map.values()) From 38cbd71352372a809100d43adda6df490bf2a93a Mon Sep 17 00:00:00 2001 From: theopen-institute Date: Fri, 9 Mar 2018 07:42:05 +0700 Subject: [PATCH 13/21] prevent deletion of sales invoices if country is nepal --- erpnext/hooks.py | 4 ++-- erpnext/regional/nepal/__init__.py | 0 erpnext/regional/nepal/utils.py | 18 ++++++++++++++++++ erpnext/tests/test_regional.py | 5 ++++- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 erpnext/regional/nepal/__init__.py create mode 100644 erpnext/regional/nepal/utils.py diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 3935f22295..7ed9b88a40 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -201,7 +201,7 @@ doc_events = { "Sales Invoice": { 'validate': 'erpnext.regional.india.utils.set_place_of_supply', "on_submit": "erpnext.regional.france.utils.create_transaction_log", - "on_trash": "erpnext.regional.france.utils.check_deletion_permission" + "on_trash": ["erpnext.regional.france.utils.check_deletion_permission", "erpnext.regional.nepal.utils.check_deletion_permission"] }, "Payment Entry": { "on_submit": ["erpnext.regional.france.utils.create_transaction_log", "erpnext.accounts.doctype.payment_request.payment_request.make_status_as_paid"], @@ -277,4 +277,4 @@ regional_overrides = { 'Saudi Arabia': { 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data' } -} +} \ No newline at end of file diff --git a/erpnext/regional/nepal/__init__.py b/erpnext/regional/nepal/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/regional/nepal/utils.py b/erpnext/regional/nepal/utils.py new file mode 100644 index 0000000000..66536ee762 --- /dev/null +++ b/erpnext/regional/nepal/utils.py @@ -0,0 +1,18 @@ +# Copyright (c) 2018, Frappe Technologies and contributors +# For license information, please see license.txt + +import frappe +from frappe import _ +from erpnext import get_region + +def check_deletion_permission(doc, method): + region = get_region() + if region not in ["Nepal"]: + return + else: + frappe.throw(_("Deletion is not permitted for country {0}".format(region))) + +# don't remove this function it is used in tests +def test_method(): + '''test function''' + return 'overridden' diff --git a/erpnext/tests/test_regional.py b/erpnext/tests/test_regional.py index 7524ccca06..3f8ebaff49 100644 --- a/erpnext/tests/test_regional.py +++ b/erpnext/tests/test_regional.py @@ -10,7 +10,10 @@ class TestInit(unittest.TestCase): self.assertEqual(test_method(), 'overridden') frappe.flags.country = 'Nepal' - self.assertEqual(test_method(), 'original') + self.assertEqual(test_method(), 'overridden') frappe.flags.country = 'France' self.assertEqual(test_method(), 'overridden') + + frappe.flags.country = 'Maldives' + self.assertEqual(test_method(), 'original') \ No newline at end of file From 096c05ca6f20f95a57fba407cda391acd57fe5f0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Mar 2018 13:11:00 +0530 Subject: [PATCH 14/21] Fixes for regional feature of Nepal --- .../doctype/physician/physician.json | 2 +- .../remove_and_copy_fields_in_physician.py | 19 ++++++++++--------- erpnext/regional/nepal/utils.py | 7 +------ erpnext/tests/test_regional.py | 9 +++------ 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/erpnext/healthcare/doctype/physician/physician.json b/erpnext/healthcare/doctype/physician/physician.json index e29561e91e..300dc9707d 100644 --- a/erpnext/healthcare/doctype/physician/physician.json +++ b/erpnext/healthcare/doctype/physician/physician.json @@ -750,7 +750,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-01-19 15:25:43.166877", + "modified": "2018-03-09 15:25:43.166877", "modified_by": "Administrator", "module": "Healthcare", "name": "Physician", diff --git a/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py b/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py index bf286449c4..139751a684 100644 --- a/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py +++ b/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py @@ -1,12 +1,13 @@ import frappe def execute(): - if frappe.db.exists("DocType", "Physician"): - frappe.reload_doc("healthcare", "doctype", "physician") - frappe.reload_doc("healthcare", "doctype", "physician_service_unit_schedule") - if frappe.db.has_column('Physician', 'physician_schedule'): - for doc in frappe.get_all('Physician'): - _doc = frappe.get_doc('Physician', doc.name) - if _doc.physician_schedule: - _doc.append('physician_schedules', {'schedule': _doc.physician_schedule}) - _doc.save() + if frappe.db.exists("DocType", "Physician"): + frappe.reload_doc("healthcare", "doctype", "physician") + frappe.reload_doc("healthcare", "doctype", "physician_service_unit_schedule") + + if frappe.db.has_column('Physician', 'physician_schedule'): + for doc in frappe.get_all('Physician'): + _doc = frappe.get_doc('Physician', doc.name) + if _doc.physician_schedule: + _doc.append('physician_schedules', {'schedule': _doc.physician_schedule}) + _doc.save() diff --git a/erpnext/regional/nepal/utils.py b/erpnext/regional/nepal/utils.py index 66536ee762..76801b9d84 100644 --- a/erpnext/regional/nepal/utils.py +++ b/erpnext/regional/nepal/utils.py @@ -10,9 +10,4 @@ def check_deletion_permission(doc, method): if region not in ["Nepal"]: return else: - frappe.throw(_("Deletion is not permitted for country {0}".format(region))) - -# don't remove this function it is used in tests -def test_method(): - '''test function''' - return 'overridden' + frappe.throw(_("Deletion is not permitted for country {0}".format(region))) \ No newline at end of file diff --git a/erpnext/tests/test_regional.py b/erpnext/tests/test_regional.py index 3f8ebaff49..7bd6fa8238 100644 --- a/erpnext/tests/test_regional.py +++ b/erpnext/tests/test_regional.py @@ -9,11 +9,8 @@ class TestInit(unittest.TestCase): frappe.flags.country = 'India' self.assertEqual(test_method(), 'overridden') - frappe.flags.country = 'Nepal' - self.assertEqual(test_method(), 'overridden') + frappe.flags.country = 'Maldives' + self.assertEqual(test_method(), 'original') frappe.flags.country = 'France' - self.assertEqual(test_method(), 'overridden') - - frappe.flags.country = 'Maldives' - self.assertEqual(test_method(), 'original') \ No newline at end of file + self.assertEqual(test_method(), 'overridden') \ No newline at end of file From 0357fbc9c1e084771f3f2648fab02dd60c6d3ade Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Mar 2018 13:19:52 +0530 Subject: [PATCH 15/21] commonfied regional function for checking delete permission --- erpnext/hooks.py | 4 ++-- erpnext/regional/__init__.py | 11 +++++++++++ erpnext/regional/france/utils.py | 10 ---------- erpnext/regional/nepal/__init__.py | 0 erpnext/regional/nepal/utils.py | 13 ------------- 5 files changed, 13 insertions(+), 25 deletions(-) delete mode 100644 erpnext/regional/nepal/__init__.py delete mode 100644 erpnext/regional/nepal/utils.py diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 7ed9b88a40..a97f80fddc 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -201,11 +201,11 @@ doc_events = { "Sales Invoice": { 'validate': 'erpnext.regional.india.utils.set_place_of_supply', "on_submit": "erpnext.regional.france.utils.create_transaction_log", - "on_trash": ["erpnext.regional.france.utils.check_deletion_permission", "erpnext.regional.nepal.utils.check_deletion_permission"] + "on_trash": "erpnext.regional.check_deletion_permission" }, "Payment Entry": { "on_submit": ["erpnext.regional.france.utils.create_transaction_log", "erpnext.accounts.doctype.payment_request.payment_request.make_status_as_paid"], - "on_trash": "erpnext.regional.france.utils.check_deletion_permission" + "on_trash": "erpnext.regional.check_deletion_permission" }, 'Address': { 'validate': 'erpnext.regional.india.utils.validate_gstin_for_india' diff --git a/erpnext/regional/__init__.py b/erpnext/regional/__init__.py index e69de29bb2..510ed58766 100644 --- a/erpnext/regional/__init__.py +++ b/erpnext/regional/__init__.py @@ -0,0 +1,11 @@ +# Copyright (c) 2018, Frappe Technologies and contributors +# For license information, please see license.txt + +import frappe +from frappe import _ +from erpnext import get_region + +def check_deletion_permission(doc, method): + region = get_region() + if region in ["Nepal", "France"]: + frappe.throw(_("Deletion is not permitted for country {0}".format(region))) \ No newline at end of file diff --git a/erpnext/regional/france/utils.py b/erpnext/regional/france/utils.py index c963d7431f..9e9f0ad9be 100644 --- a/erpnext/regional/france/utils.py +++ b/erpnext/regional/france/utils.py @@ -9,9 +9,7 @@ def create_transaction_log(doc, method): region = get_region() if region not in ["France"]: return - else: - data = str(doc.as_dict()) frappe.get_doc({ @@ -21,14 +19,6 @@ def create_transaction_log(doc, method): "data": data }).insert(ignore_permissions=True) -def check_deletion_permission(doc, method): - region = get_region() - if region not in ["France"]: - return - - else: - frappe.throw(_("Deletion is not permitted for country {0}".format(region))) - # don't remove this function it is used in tests def test_method(): '''test function''' diff --git a/erpnext/regional/nepal/__init__.py b/erpnext/regional/nepal/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/erpnext/regional/nepal/utils.py b/erpnext/regional/nepal/utils.py deleted file mode 100644 index 76801b9d84..0000000000 --- a/erpnext/regional/nepal/utils.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2018, Frappe Technologies and contributors -# For license information, please see license.txt - -import frappe -from frappe import _ -from erpnext import get_region - -def check_deletion_permission(doc, method): - region = get_region() - if region not in ["Nepal"]: - return - else: - frappe.throw(_("Deletion is not permitted for country {0}".format(region))) \ No newline at end of file From 052333ea63fa43fd6e5c9323e1f072ab4602e1d4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Mar 2018 14:30:32 +0530 Subject: [PATCH 16/21] subctracting stock entry should also be considered as consumed qty --- .../itemwise_recommended_reorder_level.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py index e1249ea3cd..cc47ad924e 100644 --- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py @@ -51,7 +51,7 @@ def get_consumed_items(condition): sum(se_item.transfer_qty) as 'consume_qty' from `tabStock Entry` se, `tabStock Entry Detail` se_item where se.name = se_item.parent and se.docstatus = 1 - and ifnull(se_item.t_warehouse, '') = '' %s + and (ifnull(se_item.t_warehouse, '') = '' or se.purpose = 'Subcontract') %s group by se_item.item_code""" % (condition), as_dict=1) cn_items_map = {} From 1d7665fca10966df10f8c888d44ca24213346ccf Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Fri, 9 Mar 2018 15:22:20 +0530 Subject: [PATCH 17/21] sort by name accounts --- erpnext/accounts/report/trial_balance/trial_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 7142c69955..21f517547a 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -175,7 +175,7 @@ def accumulate_values_into_parents(accounts, accounts_by_name): def prepare_data(accounts, filters, total_row, parent_children_map, company_currency): data = [] - tmpaccnt = sorted(accounts) + tmpaccnt = sorted(accounts, key = account: account.name) if not (accounts[0].account_number is None): accounts = tmpaccnt From dc61c6b975036f1cd974c029199b3ec004bd69ed Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Fri, 9 Mar 2018 15:23:08 +0530 Subject: [PATCH 18/21] sort by name accounts --- erpnext/accounts/report/trial_balance/trial_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 21f517547a..8c55df5c4a 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -175,7 +175,7 @@ def accumulate_values_into_parents(accounts, accounts_by_name): def prepare_data(accounts, filters, total_row, parent_children_map, company_currency): data = [] - tmpaccnt = sorted(accounts, key = account: account.name) + tmpaccnt = sorted(accounts, key = lambda account: account.name) if not (accounts[0].account_number is None): accounts = tmpaccnt From c3889d85a10f2232029668672279eede37b2278c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Mar 2018 16:28:25 +0530 Subject: [PATCH 19/21] Update shopping_cart.js --- erpnext/public/js/shopping_cart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js index 0a3e0af29d..7755141da6 100644 --- a/erpnext/public/js/shopping_cart.js +++ b/erpnext/public/js/shopping_cart.js @@ -64,7 +64,7 @@ $.extend(shopping_cart, { }, set_cart_count: function() { - var cart_count = getCookie("cart_count"); + var cart_count = frappe.get_cookie("cart_count"); if(frappe.session.user==="Guest") { cart_count = 0; } From 096d1364609780dd96d1b164ca96f91330f8b738 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Mar 2018 17:08:50 +0600 Subject: [PATCH 20/21] bumped to version 10.1.7 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 99981bd713..a4647e3b0a 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.6' +__version__ = '10.1.7' def get_default_company(user=None): '''Get default company for user''' From fd75d554d20921c0c5b1a213f1f82d61a1bb4333 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 9 Mar 2018 18:52:01 +0530 Subject: [PATCH 21/21] Payment Terms Template added in test_ignore for Company --- erpnext/setup/doctype/company/test_company.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index a5afbdb450..83b2998535 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -2,13 +2,12 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -test_ignore = ["Account", "Cost Center"] - import frappe import unittest from frappe.utils import random_string from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import get_charts_for_country +test_ignore = ["Account", "Cost Center", "Payment Terms Template"] test_records = frappe.get_test_records('Company') class TestCompany(unittest.TestCase):