mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
fetch price list rates when creating quotation from opportunity
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user