pass only valid columns to get_item_details

This commit is contained in:
Pratik Vyas 2014-04-10 17:53:30 +05:30
parent 233fbb08b2
commit f7daab7393

View File

@ -87,10 +87,14 @@ class AccountsController(TransactionBase):
"""set missing item values"""
from erpnext.stock.get_item_details import get_item_details
if hasattr(self, "fname"):
parent_dict = {}
for fieldname in self.meta.get_valid_columns():
parent_dict[fieldname] = self.get(fieldname)
for item in self.get(self.fname):
if item.get("item_code"):
args = self.as_dict()
args.update(item.as_dict())
args = item.as_dict()
args.update(parent_dict)
ret = get_item_details(args)
for fieldname, value in ret.items():
if item.meta.get_field(fieldname) and \