diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index 245ed77fe77ba3b4f3e351fb3d6f96150025b4d2..bb93fddafd2e5f5b91f6144e23b697421f520c60 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -62,24 +62,8 @@ $.extend(erpnext, { return cint(frappe.boot.sysdefaults.allow_stale); }, - setup_serial_or_batch_no: function() { - let grid_row = cur_frm.open_grid_row(); - if (!grid_row || !grid_row.grid_form.fields_dict.serial_no || - grid_row.grid_form.fields_dict.serial_no.get_status() !== "Write") return; - - frappe.model.get_value('Item', {'name': grid_row.doc.item_code}, - ['has_serial_no', 'has_batch_no'], ({has_serial_no, has_batch_no}) => { - Object.assign(grid_row.doc, {has_serial_no, has_batch_no}); - - if (has_serial_no) { - attach_selector_button(__("Add Serial No"), - grid_row.grid_form.fields_dict.serial_no.$wrapper, this, grid_row); - } else if (has_batch_no) { - attach_selector_button(__("Pick Batch No"), - grid_row.grid_form.fields_dict.batch_no.$wrapper, this, grid_row); - } - } - ); + setup_serial_or_batch_no: function () { + // Deprecated in v15 }, route_to_adjustment_jv: (args) => { diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index a5d90d527868fc66a7e88cd025c5299fe2db6b3c..e9a74c82de04149838306ccceb5c030de85d7f4e 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -197,6 +197,7 @@ class StockEntry(StockController): if self.work_order: self.pro_doc = frappe.get_doc("Work Order", self.work_order) + self.validate_duplicate_serial_and_batch_bundle("items") self.validate_posting_time() self.validate_purpose() self.validate_item() diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 49c20fda4f117ca94c2e56f5c1d7f1981263d7fe..539d93c8c2a7a27b7936021b01f9a78f8e5663d8 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -43,6 +43,7 @@ class StockReconciliation(StockController): self.validate_posting_time() self.set_current_serial_and_batch_bundle() self.set_new_serial_and_batch_bundle() + self.validate_duplicate_serial_and_batch_bundle("items") self.remove_items_with_no_change() self.validate_data() self.validate_expense_account()