mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
@@ -181,15 +181,12 @@ class BOM(Document):
|
|||||||
if item.default_bom != self.name:
|
if item.default_bom != self.name:
|
||||||
item.default_bom = self.name
|
item.default_bom = self.name
|
||||||
item.save()
|
item.save()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not self.is_active:
|
frappe.db.set(self, "is_default", 0)
|
||||||
frappe.db.set(self, "is_default", 0)
|
item = frappe.get_doc("Item", self.item)
|
||||||
|
if item.default_bom == self.name:
|
||||||
item = frappe.get_doc("Item", self.item)
|
item.default_bom = None
|
||||||
if item.default_bom == self.name:
|
item.save()
|
||||||
item.default_bom = None
|
|
||||||
item.save()
|
|
||||||
|
|
||||||
def clear_operations(self):
|
def clear_operations(self):
|
||||||
if not self.with_operations:
|
if not self.with_operations:
|
||||||
|
|||||||
@@ -176,3 +176,4 @@ erpnext.patches.v5_1.fix_credit_days_based_on
|
|||||||
erpnext.patches.v5_1.track_operations
|
erpnext.patches.v5_1.track_operations
|
||||||
execute:frappe.rename_doc("DocType", "Salary Manager", "Process Payroll", force=True)
|
execute:frappe.rename_doc("DocType", "Salary Manager", "Process Payroll", force=True)
|
||||||
erpnext.patches.v5_1.rename_roles
|
erpnext.patches.v5_1.rename_roles
|
||||||
|
erpnext.patches.v5_1.default_bom
|
||||||
|
|||||||
7
erpnext/patches/v5_1/default_bom.py
Normal file
7
erpnext/patches/v5_1/default_bom.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.db.sql("""Update `tabItem` as item set default_bom = NULL where
|
||||||
|
not exists(select name from `tabBOM` as bom where item.default_bom = bom.name and bom.docstatus =1 )""")
|
||||||
Reference in New Issue
Block a user