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,10 +50,9 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
}
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) {
var callback = function(doc, dt, dn) {
// defined in sales_common.js
cur_frm.cscript.update_item_details(doc, dt, dn);

View File

@ -81,12 +81,19 @@ class DocType(TransactionBase):
obj = get_obj('Sales Common')
for doc in self.doclist:
if doc.fields.get('item_code'):
arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'),
'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')};
ret = obj.get_item_defaults(arg)
for r in ret:
if not doc.fields.get(r):
doc.fields[r] = ret[r]
arg = {
'item_code': doc.fields.get('item_code'),
'income_account': doc.fields.get('income_account'),
'cost_center': doc.fields.get('cost_center'),
'warehouse': doc.fields.get('warehouse')
}
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