From 37d3686372519b9d0b4a3693391b9dffccb48159 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Mon, 8 Oct 2018 14:17:16 +0530 Subject: [PATCH 1/7] fix(setup_taxes): Pop if frappe.message_log (#15615) --- erpnext/setup/setup_wizard/operations/taxes_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/setup/setup_wizard/operations/taxes_setup.py b/erpnext/setup/setup_wizard/operations/taxes_setup.py index dd5c0372e4..50bea41301 100644 --- a/erpnext/setup/setup_wizard/operations/taxes_setup.py +++ b/erpnext/setup/setup_wizard/operations/taxes_setup.py @@ -50,7 +50,7 @@ def make_tax_account(company, account_name, tax_rate): "tax_rate": flt(tax_rate) if tax_rate else None }).insert(ignore_permissions=True, ignore_mandatory=True) except frappe.NameError: - frappe.message_log.pop() + if frappe.message_log: frappe.message_log.pop() abbr = frappe.db.get_value('Company', company, 'abbr') account = '{0} - {1}'.format(account_name, abbr) return frappe.get_doc('Account', account) From 95d93913ce7444a108a6292688d55ca841efd2bf Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Mon, 8 Oct 2018 14:17:37 +0530 Subject: [PATCH 2/7] fix(link_to_mr): Add missing method to buying.js (#15616) --- erpnext/public/js/controllers/buying.js | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js index 55fcaab3e7..cefdbe7a32 100644 --- a/erpnext/public/js/controllers/buying.js +++ b/erpnext/public/js/controllers/buying.js @@ -235,6 +235,69 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ this.get_terms(); }, + link_to_mrs: function() { + var my_items = []; + for (var i in cur_frm.doc.items) { + if(!cur_frm.doc.items[i].material_request){ + my_items.push(cur_frm.doc.items[i].item_code); + } + } + frappe.call({ + method: "erpnext.buying.utils.get_linked_material_requests", + args:{ + items: my_items + }, + callback: function(r) { + if(!r.message) { + frappe.throw(__("No pending Material Requests found to link for the given items.")) + } + else { + var i = 0; + var item_length = cur_frm.doc.items.length; + while (i < item_length) { + var qty = cur_frm.doc.items[i].qty; + (r.message[0] || []).forEach(function(d) { + if (d.qty > 0 && qty > 0 && cur_frm.doc.items[i].item_code == d.item_code && !cur_frm.doc.items[i].material_request_item) + { + cur_frm.doc.items[i].material_request = d.mr_name; + cur_frm.doc.items[i].material_request_item = d.mr_item; + var my_qty = Math.min(qty, d.qty); + qty = qty - my_qty; + d.qty = d.qty - my_qty; + cur_frm.doc.items[i].stock_qty = my_qty*cur_frm.doc.items[i].conversion_factor; + cur_frm.doc.items[i].qty = my_qty; + + frappe.msgprint("Assigning " + d.mr_name + " to " + d.item_code + " (row " + cur_frm.doc.items[i].idx + ")"); + if (qty > 0) + { + frappe.msgprint("Splitting " + qty + " units of " + d.item_code); + var newrow = frappe.model.add_child(cur_frm.doc, cur_frm.doc.items[i].doctype, "items"); + item_length++; + + for (var key in cur_frm.doc.items[i]) + { + newrow[key] = cur_frm.doc.items[i][key]; + } + + newrow.idx = item_length; + newrow["stock_qty"] = newrow.conversion_factor*qty; + newrow["qty"] = qty; + + newrow["material_request"] = ""; + newrow["material_request_item"] = ""; + + } + } + }); + i++; + } + refresh_field("items"); + //cur_frm.save(); + } + } + }); + }, + update_auto_repeat_reference: function(doc) { if (doc.auto_repeat) { frappe.call({ From 4fb9230d16b339be3c026dd8aaf34e4359966de0 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Mon, 8 Oct 2018 14:18:03 +0530 Subject: [PATCH 3/7] Add missing method link_to_mrs to buying.js (#15613) --- erpnext/public/js/controllers/buying.js | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js index 11655e9218..7065794369 100644 --- a/erpnext/public/js/controllers/buying.js +++ b/erpnext/public/js/controllers/buying.js @@ -227,6 +227,69 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ tc_name: function() { this.get_terms(); + }, + + link_to_mrs: function() { + var my_items = []; + for (var i in cur_frm.doc.items) { + if(!cur_frm.doc.items[i].material_request){ + my_items.push(cur_frm.doc.items[i].item_code); + } + } + frappe.call({ + method: "erpnext.buying.utils.get_linked_material_requests", + args:{ + items: my_items + }, + callback: function(r) { + if(!r.message) { + frappe.throw(__("No pending Material Requests found to link for the given items.")) + } + else { + var i = 0; + var item_length = cur_frm.doc.items.length; + while (i < item_length) { + var qty = cur_frm.doc.items[i].qty; + (r.message[0] || []).forEach(function(d) { + if (d.qty > 0 && qty > 0 && cur_frm.doc.items[i].item_code == d.item_code && !cur_frm.doc.items[i].material_request_item) + { + cur_frm.doc.items[i].material_request = d.mr_name; + cur_frm.doc.items[i].material_request_item = d.mr_item; + var my_qty = Math.min(qty, d.qty); + qty = qty - my_qty; + d.qty = d.qty - my_qty; + cur_frm.doc.items[i].stock_qty = my_qty*cur_frm.doc.items[i].conversion_factor; + cur_frm.doc.items[i].qty = my_qty; + + frappe.msgprint("Assigning " + d.mr_name + " to " + d.item_code + " (row " + cur_frm.doc.items[i].idx + ")"); + if (qty > 0) + { + frappe.msgprint("Splitting " + qty + " units of " + d.item_code); + var newrow = frappe.model.add_child(cur_frm.doc, cur_frm.doc.items[i].doctype, "items"); + item_length++; + + for (var key in cur_frm.doc.items[i]) + { + newrow[key] = cur_frm.doc.items[i][key]; + } + + newrow.idx = item_length; + newrow["stock_qty"] = newrow.conversion_factor*qty; + newrow["qty"] = qty; + + newrow["material_request"] = ""; + newrow["material_request_item"] = ""; + + } + } + }); + i++; + } + refresh_field("items"); + //cur_frm.save(); + } + } + }); } }); From 5fcccda883059e68b5ef83f25f1b4819769ac80c Mon Sep 17 00:00:00 2001 From: Zarrar Date: Mon, 8 Oct 2018 14:30:53 +0530 Subject: [PATCH 4/7] [Minor] Supplier Quotation (#15578) * throw meaningful error if RFQ does not have selected supplier * Update supplier_quotation.py * codacy fix --- .../doctype/supplier_quotation/supplier_quotation.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index b221a08959..5b4356a747 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -60,7 +60,12 @@ class SupplierQuotation(BuyingController): for rfq in rfq_list: doc = frappe.get_doc('Request for Quotation', rfq) doc_sup = frappe.get_all('Request for Quotation Supplier', filters= - {'parent': doc.name, 'supplier': self.supplier}, fields=['name', 'quote_status'])[0] + {'parent': doc.name, 'supplier': self.supplier}, fields=['name', 'quote_status']) + + doc_sup = doc_sup[0] if doc_sup else None + if not doc_sup: + frappe.throw(_("Supplier {0} not found in {1}").format(self.supplier, + " Request for Quotation {0} ".format(doc.name))) quote_status = _('Received') for item in doc.items: @@ -152,4 +157,4 @@ def make_quotation(source_name, target_doc=None): } }, target_doc) - return doclist \ No newline at end of file + return doclist From 87441bf62e30294d73bd7ebfe380cd53c53b2815 Mon Sep 17 00:00:00 2001 From: Zarrar Date: Mon, 8 Oct 2018 14:34:34 +0530 Subject: [PATCH 5/7] columns without fieldname's data not shown (#15618) --- .../gst_itemised_purchase_register.py | 18 +++++++++--------- .../gst_itemised_sales_register.py | 18 +++++++++--------- .../gst_purchase_register.py | 12 ++++++------ .../gst_sales_register/gst_sales_register.py | 16 ++++++++-------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py b/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py index b0dfdcbfea..34ebb72a9f 100644 --- a/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py +++ b/erpnext/regional/report/gst_itemised_purchase_register/gst_itemised_purchase_register.py @@ -7,15 +7,15 @@ from erpnext.accounts.report.item_wise_purchase_register.item_wise_purchase_regi def execute(filters=None): return _execute(filters, additional_table_columns=[ - dict(fieldtype='Data', label='Supplier GSTIN', width=120), - dict(fieldtype='Data', label='Company GSTIN', width=120), - dict(fieldtype='Data', label='Reverse Charge', width=120), - dict(fieldtype='Data', label='Invoice Type', width=120), - dict(fieldtype='Data', label='Export Type', width=120), - dict(fieldtype='Data', label='E-Commerce GSTIN', width=130), - dict(fieldtype='Data', label='HSN Code', width=120), - dict(fieldtype='Data', label='Supplier Invoice No', width=120), - dict(fieldtype='Date', label='Supplier Invoice Date', width=100) + dict(fieldtype='Data', label='Supplier GSTIN', fieldname="supplier_gstin", width=120), + dict(fieldtype='Data', label='Company GSTIN', fieldname="company_gstin", width=120), + dict(fieldtype='Data', label='Reverse Charge', fieldname="reverse_charge", width=120), + dict(fieldtype='Data', label='Invoice Type', fieldname="invoice_type", width=120), + dict(fieldtype='Data', label='Export Type', fieldname="export_type", width=120), + dict(fieldtype='Data', label='E-Commerce GSTIN', fieldname="ecommerce_gstin", width=130), + dict(fieldtype='Data', label='HSN Code', fieldname="hsn_code", width=120), + dict(fieldtype='Data', label='Supplier Invoice No', fieldname="supplier_invoice_no", width=120), + dict(fieldtype='Date', label='Supplier Invoice Date', fieldname="supplier_invoice_date", width=100) ], additional_query_columns=[ 'supplier_gstin', 'company_gstin', diff --git a/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py b/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py index 4e57a52665..d0b1163547 100644 --- a/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py +++ b/erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py @@ -7,15 +7,15 @@ from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register i def execute(filters=None): return _execute(filters, additional_table_columns=[ - dict(fieldtype='Data', label='Customer GSTIN', width=120), - dict(fieldtype='Data', label='Billing Address GSTIN', width=140), - dict(fieldtype='Data', label='Company GSTIN', width=120), - dict(fieldtype='Data', label='Place of Supply', width=120), - dict(fieldtype='Data', label='Reverse Charge', width=120), - dict(fieldtype='Data', label='Invoice Type', width=120), - dict(fieldtype='Data', label='Export Type', width=120), - dict(fieldtype='Data', label='E-Commerce GSTIN', width=130), - dict(fieldtype='Data', label='HSN Code', width=120) + dict(fieldtype='Data', label='Customer GSTIN', fieldname="customer_gstin", width=120), + dict(fieldtype='Data', label='Billing Address GSTIN', fieldname="billing_address_gstin", width=140), + dict(fieldtype='Data', label='Company GSTIN', fieldname="company_gstin", width=120), + dict(fieldtype='Data', label='Place of Supply', fieldname="place_of_supply", width=120), + dict(fieldtype='Data', label='Reverse Charge', fieldname="reverse_charge", width=120), + dict(fieldtype='Data', label='Invoice Type', fieldname="invoice_type", width=120), + dict(fieldtype='Data', label='Export Type', fieldname="export_type", width=120), + dict(fieldtype='Data', label='E-Commerce GSTIN', fieldname="ecommerce_gstin", width=130), + dict(fieldtype='Data', label='HSN Code', fieldname="hsn_code", width=120) ], additional_query_columns=[ 'customer_gstin', 'billing_address_gstin', diff --git a/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py b/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py index 8d479a96cd..59df553e5a 100644 --- a/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py +++ b/erpnext/regional/report/gst_purchase_register/gst_purchase_register.py @@ -7,12 +7,12 @@ from erpnext.accounts.report.purchase_register.purchase_register import _execute def execute(filters=None): return _execute(filters, additional_table_columns=[ - dict(fieldtype='Data', label='Supplier GSTIN', width=120), - dict(fieldtype='Data', label='Company GSTIN', width=120), - dict(fieldtype='Data', label='Reverse Charge', width=120), - dict(fieldtype='Data', label='Invoice Type', width=120), - dict(fieldtype='Data', label='Export Type', width=120), - dict(fieldtype='Data', label='E-Commerce GSTIN', width=130) + dict(fieldtype='Data', label='Supplier GSTIN', fieldname="supplier_gstin", width=120), + dict(fieldtype='Data', label='Company GSTIN', fieldname="company_gstin", width=120), + dict(fieldtype='Data', label='Reverse Charge', fieldname="reverse_charge", width=120), + dict(fieldtype='Data', label='Invoice Type', fieldname="invoice_type", width=120), + dict(fieldtype='Data', label='Export Type', fieldname="export_type", width=120), + dict(fieldtype='Data', label='E-Commerce GSTIN', fieldname="ecommerce_gstin", width=130) ], additional_query_columns=[ 'supplier_gstin', 'company_gstin', diff --git a/erpnext/regional/report/gst_sales_register/gst_sales_register.py b/erpnext/regional/report/gst_sales_register/gst_sales_register.py index e79d722b9f..4b320817e0 100644 --- a/erpnext/regional/report/gst_sales_register/gst_sales_register.py +++ b/erpnext/regional/report/gst_sales_register/gst_sales_register.py @@ -7,14 +7,14 @@ from erpnext.accounts.report.sales_register.sales_register import _execute def execute(filters=None): return _execute(filters, additional_table_columns=[ - dict(fieldtype='Data', label='Customer GSTIN', width=120), - dict(fieldtype='Data', label='Billing Address GSTIN', width=140), - dict(fieldtype='Data', label='Company GSTIN', width=120), - dict(fieldtype='Data', label='Place of Supply', width=120), - dict(fieldtype='Data', label='Reverse Charge', width=120), - dict(fieldtype='Data', label='Invoice Type', width=120), - dict(fieldtype='Data', label='Export Type', width=120), - dict(fieldtype='Data', label='E-Commerce GSTIN', width=130) + dict(fieldtype='Data', label='Customer GSTIN', fieldname="customer_gstin", width=120), + dict(fieldtype='Data', label='Billing Address GSTIN', fieldname="billing_address_gstin", width=140), + dict(fieldtype='Data', label='Company GSTIN', fieldname="company_gstin", width=120), + dict(fieldtype='Data', label='Place of Supply', fieldname="place_of_supply", width=120), + dict(fieldtype='Data', label='Reverse Charge', fieldname="reverse_charge", width=120), + dict(fieldtype='Data', label='Invoice Type', fieldname="invoice_type", width=120), + dict(fieldtype='Data', label='Export Type', fieldname="export_type", width=120), + dict(fieldtype='Data', label='E-Commerce GSTIN', fieldname="ecommerce_gstin", width=130) ], additional_query_columns=[ 'customer_gstin', 'billing_address_gstin', From b509b06edf0d0b3b4467e39c0f531a497ddd20d1 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Mon, 8 Oct 2018 09:37:37 +0000 Subject: [PATCH 6/7] bumped to version 10.1.57 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index ca6d6bef8b..0457b7e477 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.56' +__version__ = '10.1.57' def get_default_company(user=None): '''Get default company for user''' From 563b1d153b2e4ba00a98b2cdb419fc8b7641bc7a Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Mon, 8 Oct 2018 09:43:48 +0000 Subject: [PATCH 7/7] bumped to version 11.0.3-beta.9 --- erpnext/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index d1e2347e0e..3d79c50400 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" develop_version = '11.x.x-develop' -staging_version = '11.0.3-beta.8' +staging_version = '11.0.3-beta.9' error_report_email = "support@erpnext.com"