fetch price list rates when creating quotation from opportunity

This commit is contained in:
Anand Doshi
2012-06-21 11:20:37 +05:30
parent 05cbf96e84
commit 2939a0ea65
2 changed files with 14 additions and 8 deletions

View File

@@ -50,7 +50,6 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
} }
} }
cur_frm.cscript.make_communication_body(); cur_frm.cscript.make_communication_body();
} }
cur_frm.cscript.onload_post_render = function(doc, dt, dn) { cur_frm.cscript.onload_post_render = function(doc, dt, dn) {

View File

@@ -81,12 +81,19 @@ class DocType(TransactionBase):
obj = get_obj('Sales Common') obj = get_obj('Sales Common')
for doc in self.doclist: for doc in self.doclist:
if doc.fields.get('item_code'): if doc.fields.get('item_code'):
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'), arg = {
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')}; 'item_code': doc.fields.get('item_code'),
ret = obj.get_item_defaults(arg) 'income_account': doc.fields.get('income_account'),
for r in ret: 'cost_center': doc.fields.get('cost_center'),
if not doc.fields.get(r): 'warehouse': doc.fields.get('warehouse')
doc.fields[r] = ret[r] }
fields_dict = obj.get_item_details(arg, self)
if fields_dict:
doc.fields.update(fields_dict)
#ret = obj.get_item_defaults(arg)
#for r in ret:
# if not doc.fields.get(r):
# doc.fields[r] = ret[r]
# Re-calculates Basic Rate & amount based on Price List Selected # Re-calculates Basic Rate & amount based on Price List Selected