diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index dc547e3767..68b5d4683f 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -343,12 +343,12 @@ cur_frm.cscript.hide_fields = function(doc) { } } - /* + var item_fields_stock = ['batch_no', 'actual_batch_qty', 'actual_qty', 'expense_account', 'warehouse', 'expense_account', 'quality_inspection'] cur_frm.fields_dict['items'].grid.set_column_disp(item_fields_stock, (cint(doc.update_stock)==1 || cint(doc.is_return)==1 ? true : false)); - */ + // India related fields if (frappe.boot.sysdefaults.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']); diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index c545ee1d5d..282425daa6 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -132,8 +132,7 @@ class SalesInvoice(SellingController): self.update_billing_status_for_zero_amount_refdoc("Sales Order") self.check_credit_limit() - if self.update_stock: - self.update_serial_no() + self.update_serial_no() if not cint(self.is_pos) == 1 and not self.is_return: self.update_against_document_in_jv() diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index 59af618525..5810c69cd1 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -11,6 +11,7 @@ "doctype": "DocType", "document_type": "Document", "editable_grid": 1, + "engine": "InnoDB", "fields": [ { "allow_bulk_edit": 0, @@ -1423,7 +1424,7 @@ "collapsible": 1, "collapsible_depends_on": "eval:doc.serial_no || doc.batch_no", "columns": 0, - "depends_on": "", + "depends_on": "eval: parent.update_stock", "fieldname": "warehouse_and_reference", "fieldtype": "Section Break", "hidden": 0, @@ -2165,7 +2166,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-07-03 19:34:14.820285", + "modified": "2017-07-06 17:54:03.347700", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 13b7299f36..0cf0f7beff 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -413,3 +413,4 @@ execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code') erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account erpnext.patches.v8_1.gst_fixes #2017-07-06 erpnext.patches.v8_0.update_production_orders +erpnext.patches.v8_1.remove_sales_invoice_from_returned_serial_no \ No newline at end of file diff --git a/erpnext/patches/v8_1/remove_sales_invoice_from_returned_serial_no.py b/erpnext/patches/v8_1/remove_sales_invoice_from_returned_serial_no.py new file mode 100644 index 0000000000..3962f8f1f2 --- /dev/null +++ b/erpnext/patches/v8_1/remove_sales_invoice_from_returned_serial_no.py @@ -0,0 +1,18 @@ +# Copyright (c) 2017, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.reload_doctype("Serial No") + + frappe.db.sql(""" + update + `tabSerial No` + set + sales_invoice = NULL + where + sales_invoice in (select return_against from + `tabSales Invoice` where docstatus =1 and is_return=1) + and sales_invoice is not null and sales_invoice !='' """) \ No newline at end of file diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 19d3f4772c..b168631970 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1138,7 +1138,7 @@ "in_standard_filter": 0, "label": "Has Batch No", "length": 0, - "no_copy": 0, + "no_copy": 1, "oldfieldname": "has_batch_no", "oldfieldtype": "Select", "options": "", @@ -1234,7 +1234,7 @@ "in_standard_filter": 0, "label": "Has Serial No", "length": 0, - "no_copy": 0, + "no_copy": 1, "oldfieldname": "has_serial_no", "oldfieldtype": "Select", "options": "", @@ -3143,7 +3143,7 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2017-06-13 14:29:03.003680", + "modified": "2017-07-06 18:28:36.645217", "modified_by": "Administrator", "module": "Stock", "name": "Item", @@ -3320,4 +3320,4 @@ "title_field": "item_name", "track_changes": 1, "track_seen": 0 -} +} \ No newline at end of file