fix: price list when invoice created from timesheet

This commit is contained in:
Nihantra C. Patel
2024-05-29 10:26:49 +05:30
committed by GitHub
parent 39d6df7c7d
commit 882227a460

View File

@@ -389,9 +389,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