fix: Lab Test Template data import failing in Lab Test Item creation
This commit is contained in:
parent
ac4199f2d7
commit
e8bbdd5e84
@ -99,13 +99,10 @@ def create_item_from_template(doc):
|
|||||||
# get item price list to insert item price
|
# get item price list to insert item price
|
||||||
if doc.lab_test_rate != 0.0:
|
if doc.lab_test_rate != 0.0:
|
||||||
price_list_name = frappe.db.get_value("Price List", {"selling": 1})
|
price_list_name = frappe.db.get_value("Price List", {"selling": 1})
|
||||||
if(doc.lab_test_rate):
|
if doc.lab_test_rate:
|
||||||
make_item_price(item.name, price_list_name, doc.lab_test_rate)
|
make_item_price(item.name, price_list_name, doc.lab_test_rate)
|
||||||
item.standard_rate = doc.lab_test_rate
|
|
||||||
else:
|
else:
|
||||||
make_item_price(item.name, price_list_name, 0.0)
|
make_item_price(item.name, price_list_name, 0.0)
|
||||||
item.standard_rate = 0.0
|
|
||||||
item.save(ignore_permissions = True)
|
|
||||||
# Set item in the template
|
# Set item in the template
|
||||||
frappe.db.set_value("Lab Test Template", doc.name, "item", item.name)
|
frappe.db.set_value("Lab Test Template", doc.name, "item", item.name)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user