[fix] [minor] opportunity to quotation - load price list values

This commit is contained in:
Anand Doshi 2013-09-05 13:31:20 +05:30
parent ea55734df5
commit c28f84298f

View File

@ -160,6 +160,11 @@ class DocType(TransactionBase):
def make_quotation(source_name, target_doclist=None): def make_quotation(source_name, target_doclist=None):
from webnotes.model.mapper import get_mapped_doclist 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, { doclist = get_mapped_doclist("Opportunity", source_name, {
"Opportunity": { "Opportunity": {
"doctype": "Quotation", "doctype": "Quotation",
@ -181,6 +186,6 @@ def make_quotation(source_name, target_doclist=None):
}, },
"add_if_empty": True "add_if_empty": True
} }
}, target_doclist) }, target_doclist, set_missing_values)
return [d.fields for d in doclist] return [d.fields for d in doclist]