From cf7f72e586674401282c308ab0d3fe11c55f9033 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Fri, 7 Jul 2017 15:09:57 +0530 Subject: [PATCH 1/4] frappe call only when there is item --- .../production_order/production_order.js | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index b2f32126aa..a988112bed 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -151,26 +151,28 @@ frappe.ui.form.on("Production Order", { }, production_item: function(frm) { - frappe.call({ - method: "erpnext.manufacturing.doctype.production_order.production_order.get_item_details", - args: { - item: frm.doc.production_item, - project: frm.doc.project - }, - callback: function(r) { - if(r.message) { - erpnext.in_production_item_onchange = true; - $.each(["description", "stock_uom", "project", "bom_no"], function(i, field) { - frm.set_value(field, r.message[field]); - }); + if (frm.doc.production_item) { + frappe.call({ + method: "erpnext.manufacturing.doctype.production_order.production_order.get_item_details", + args: { + item: frm.doc.production_item, + project: frm.doc.project + }, + callback: function(r) { + if(r.message) { + erpnext.in_production_item_onchange = true; + $.each(["description", "stock_uom", "project", "bom_no"], function(i, field) { + frm.set_value(field, r.message[field]); + }); - if(r.message["set_scrap_wh_mandatory"]){ - frm.toggle_reqd("scrap_warehouse", true); + if(r.message["set_scrap_wh_mandatory"]){ + frm.toggle_reqd("scrap_warehouse", true); + } + erpnext.in_production_item_onchange = false; } - erpnext.in_production_item_onchange = false; } - } - }); + }); + } }, project: function(frm) { From 3f6a5b25390b369683c7c0e97e74a68f19e4e7b5 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Fri, 7 Jul 2017 15:24:01 +0530 Subject: [PATCH 2/4] [hotfix] fixed the customer address set filter on Installation Note --- .../doctype/installation_note/installation_note.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js index ab35574e31..9f0c050c4e 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.js +++ b/erpnext/selling/doctype/installation_note/installation_note.js @@ -30,12 +30,8 @@ erpnext.selling.InstallationNote = frappe.ui.form.Controller.extend({ setup_queries: function() { var me = this; - this.frm.set_query("customer_address", function() { - return { - filters: {'customer': me.frm.doc.customer } - } - }); - + frappe.dynamic_link = {doc: this.frm.doc, fieldname: 'customer', doctype: 'Customer'} + frm.set_query('customer_address', erpnext.queries.address_query); this.frm.set_query('contact_person', erpnext.queries.contact_query); this.frm.set_query("customer", function() { From 95895277849a15d55120af5826a67441e1fa7eac Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 7 Jul 2017 15:34:28 +0530 Subject: [PATCH 3/4] Fixed the issue Serial No serial no not found --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 282425daa6..2dd4e7a733 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -803,9 +803,10 @@ class SalesInvoice(SellingController): continue for serial_no in item.serial_no.split("\n"): - sno = frappe.get_doc('Serial No', serial_no) - sno.sales_invoice = invoice - sno.db_update() + if serial_no and frappe.db.exists('Serial No', serial_no): + sno = frappe.get_doc('Serial No', serial_no) + sno.sales_invoice = invoice + sno.db_update() def validate_serial_numbers(self): """ From 7b5ca3e494c8e4dece0b67d71160ea5618f01da6 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Fri, 7 Jul 2017 17:42:36 +0600 Subject: [PATCH 4/4] bumped to version 8.3.4 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 5ba4160497..7a36695a47 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.3.3' +__version__ = '8.3.4' def get_default_company(user=None): '''Get default company for user'''