[sales invoice] [fix] bug fix in setting pos values on save

This commit is contained in:
Anand Doshi 2013-05-10 13:38:23 +05:30
parent 2186e83670
commit 1252729e1c

View File

@ -191,11 +191,11 @@ class DocType(SellingController):
self.doc.fields[fieldname] = pos.get(fieldname) self.doc.fields[fieldname] = pos.get(fieldname)
# set pos values in items # set pos values in items
for doc in self.doclist.get({"parentfield": "entries"}): for item in self.doclist.get({"parentfield": "entries"}):
if doc.fields.get('item_code'): if item.fields.get('item_code'):
for fieldname, val in self.apply_pos_settings(doc.fields).items(): for fieldname, val in self.apply_pos_settings(item.fields).items():
if (not for_validate) or (for_validate and not self.doc.fields.get(fieldname)): if (not for_validate) or (for_validate and not item.fields.get(fieldname)):
doc.fields[fieldname] = val item.fields[fieldname] = val
# fetch terms # fetch terms
if self.doc.tc_name and not self.doc.terms: if self.doc.tc_name and not self.doc.terms: