From 05e06e845588108c6ec110dd2f4dddd80d1a8f39 Mon Sep 17 00:00:00 2001 From: Chillar Anand Date: Mon, 6 Sep 2021 13:27:28 +0530 Subject: [PATCH] fix(healthcare): Added item price to default price list (#27353) Co-authored-by: Dany Robert --- .../healthcare/doctype/lab_test_template/lab_test_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py index c052693d044..a75c533f947 100644 --- a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py +++ b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py @@ -31,7 +31,7 @@ class LabTestTemplate(Document): item_price = self.item_price_exists() if not item_price: if self.lab_test_rate and self.lab_test_rate > 0.0: - price_list_name = frappe.db.get_value('Price List', {'selling': 1}) + price_list_name = frappe.db.get_value('Selling Settings', None, 'selling_price_list') or frappe.db.get_value('Price List', {'selling': 1}) make_item_price(self.lab_test_code, price_list_name, self.lab_test_rate) else: frappe.db.set_value('Item Price', item_price, 'price_list_rate', self.lab_test_rate) @@ -114,7 +114,7 @@ def create_item_from_template(doc): # Insert item price if doc.is_billable and doc.lab_test_rate != 0.0: - price_list_name = frappe.db.get_value('Price List', {'selling': 1}) + price_list_name = frappe.db.get_value('Selling Settings', None, 'selling_price_list') or frappe.db.get_value('Price List', {'selling': 1}) if doc.lab_test_rate: make_item_price(item.name, price_list_name, doc.lab_test_rate) else: