From ae205f878adf25329fccd8414ac18d91a404c066 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sun, 12 Mar 2017 16:43:44 +0530 Subject: [PATCH] Set default taxes and charges while creating quotation from opportunity --- erpnext/crm/doctype/opportunity/opportunity.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 786a36cf6d1..913d2e4ae62 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -178,6 +178,7 @@ def get_item_details(item_code): @frappe.whitelist() def make_quotation(source_name, target_doc=None): def set_missing_values(source, target): + from erpnext.controllers.accounts_controller import get_default_taxes_and_charges quotation = frappe.get_doc(target) company_currency = frappe.db.get_value("Company", quotation.company, "default_currency") @@ -193,7 +194,11 @@ def make_quotation(source_name, target_doc=None): quotation.transaction_date) quotation.conversion_rate = exchange_rate - + + # get default taxes + taxes = get_default_taxes_and_charges("Sales Taxes and Charges Template") + quotation.extend("taxes", taxes) + quotation.run_method("set_missing_values") quotation.run_method("calculate_taxes_and_totals")