From a9afc254bc03d4cc0a3287733009e2b0449713a7 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 1 Mar 2013 10:41:41 +0530 Subject: [PATCH] fixes for conversion factor in old invoices --- controllers/buying_controller.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/buying_controller.py b/controllers/buying_controller.py index e5b8b07108..8b247ccd98 100644 --- a/controllers/buying_controller.py +++ b/controllers/buying_controller.py @@ -331,6 +331,9 @@ class BuyingController(AccountsController): # update valuation rate def update_valuation_rate(self, parentfield): for d in self.doclist.get({"parentfield": parentfield}): + d.conversion_factor = d.conversion_factor or webnotes.conn.get_value( + "UOM Conversion Detail", {"parent": d.item_code, "uom": d.uom}, + "conversion_factor") or 1 if d.item_code and d.qty: # if no item code, which is sometimes the case in purchase invoice, # then it is not possible to track valuation against it