From c28f84298ffb9a94f1f6f71d2f0fc30aad563d23 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 5 Sep 2013 13:31:20 +0530 Subject: [PATCH] [fix] [minor] opportunity to quotation - load price list values --- selling/doctype/opportunity/opportunity.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/selling/doctype/opportunity/opportunity.py b/selling/doctype/opportunity/opportunity.py index a3ef1976d95..b265356a4d5 100644 --- a/selling/doctype/opportunity/opportunity.py +++ b/selling/doctype/opportunity/opportunity.py @@ -160,6 +160,11 @@ class DocType(TransactionBase): def make_quotation(source_name, target_doclist=None): from webnotes.model.mapper import get_mapped_doclist + def set_missing_values(source, target): + quotation = webnotes.bean(target) + quotation.run_method("onload_post_render") + quotation.run_method("calculate_taxes_and_totals") + doclist = get_mapped_doclist("Opportunity", source_name, { "Opportunity": { "doctype": "Quotation", @@ -181,6 +186,6 @@ def make_quotation(source_name, target_doclist=None): }, "add_if_empty": True } - }, target_doclist) + }, target_doclist, set_missing_values) return [d.fields for d in doclist] \ No newline at end of file