fix: allow to set rate manually for service item in BOM (#38880)

This commit is contained in:
rohitwaghchaure
2023-12-20 17:53:48 +05:30
committed by GitHub
parent d94b5a318d
commit c2f692a4e4
5 changed files with 63 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
import frappe
def execute():
if not frappe.db.exists("BOM", {"docstatus": 1}):
return
# Added is_stock_item to handle Read Only based on condition for the rate field
frappe.db.sql(
"""
UPDATE
`tabBOM Item` boi,
`tabItem` i
SET
boi.is_stock_item = i.is_stock_item
WHERE
boi.item_code = i.name
"""
)