fix: price list when invoice created from timesheet

(cherry picked from commit 882227a460)
This commit is contained in:
Nihantra C. Patel
2024-05-29 10:26:49 +05:30
committed by Mergify
parent 536dc47eb0
commit 2926915a06

View File

@@ -379,9 +379,9 @@ def make_sales_invoice(source_name, item_code=None, customer=None, currency=None
target.project = timesheet.parent_project
if customer:
target.customer = customer
customer_doc = frappe.get_doc("Customer", customer)
if customer_doc and customer_doc.default_price_list:
target.selling_price_list = customer_doc.default_price_list
default_price_list = frappe.get_value("Customer", customer, "default_price_list")
if default_price_list:
target.selling_price_list = default_price_list
if currency:
target.currency = currency