[minor] calculate price list rate based on items uom

This commit is contained in:
mbauskar
2017-04-10 19:15:57 +05:30
committed by Nabin Hait
parent 24053478a1
commit 287fe81329
7 changed files with 33 additions and 18 deletions

View File

@@ -186,7 +186,6 @@ class AccountsController(TransactionBase):
ret = get_item_details(args)
for fieldname, value in ret.items():
if item.meta.get_field(fieldname) and value is not None:
if (item.get(fieldname) is None or fieldname in force_item_fields):
@@ -200,6 +199,10 @@ class AccountsController(TransactionBase):
if stock_qty != len(item.get('serial_no').split('\n')):
item.set(fieldname, value)
elif fieldname in ["conversion_factor", "price_list_rate"]:
if for_validate and not item.get(fieldname):
item.set(fieldname, value)
if ret.get("pricing_rule"):
# if user changed the discount percentage then set user's discount percentage ?
item.set("discount_percentage", ret.get("discount_percentage"))