Skip to content

Commit

Permalink
fix: add item price to default price list
Browse files Browse the repository at this point in the history
  • Loading branch information
rtdany10 authored Sep 3, 2021
1 parent 798b464 commit 0848d43
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def on_update(self):
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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0848d43

Please sign in to comment.