From d94bb35ff779ba730d7e9b5c457a871427ea9490 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Wed, 7 Mar 2012 18:37:13 +0530 Subject: [PATCH] [FIX] UOM is added in change quantity notification in product and UI of threadview is modified. bzr revid: bth@tinyerp.com-20120307130713-d9qp1ms3oajj40zk --- addons/mrp/mrp_view.xml | 4 ++-- addons/mrp_operations/mrp_operations_view.xml | 2 +- addons/product/product_view.xml | 2 +- addons/stock/wizard/stock_change_product_qty.py | 9 +++++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index ad90b7dadae..32cb2910cb2 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -410,7 +410,7 @@ - + @@ -782,7 +782,7 @@ - + diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index 3e1d17d18e9..f75179574a8 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -118,7 +118,7 @@ - + diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 4d0dea47f2b..a2a77dd37ad 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -192,7 +192,7 @@ - + diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py index fcfb9515354..426a235e64e 100644 --- a/addons/stock/wizard/stock_change_product_qty.py +++ b/addons/stock/wizard/stock_change_product_qty.py @@ -105,12 +105,17 @@ class stock_change_product_qty(osv.osv_memory): def quantity_change_notification (self, cr, uid, ids, context=None): prod_obj = self.pool.get('product.product') location_obj = self.pool.get('stock.location') + prod_temp_obj = self.pool.get('product.template') + uom_obj = self.pool.get('product.uom') + for data in self.browse(cr, uid, ids, context=context): for location in location_obj.browse(cr, uid, [data.location_id.id], context=context): location_name = location.name for prod in prod_obj.browse(cr, uid, [data.product_id.id], context=context): - message = _("Quantity is changed to %s for %s location.") % (data.new_quantity,location_name) - prod_obj.message_append_note(cr, uid, [prod.id], '', message) + for prod_temp in prod_temp_obj.browse(cr, uid, [prod.product_tmpl_id.id], context=context): + for uom in uom_obj.browse(cr, uid, [prod_temp.uom_id.id], context=context): + message = _("Quantity is changed to %s %s for %s location.") % (data.new_quantity,uom.name,location_name) + prod_obj.message_append_note(cr, uid, [prod.id], '', message) stock_change_product_qty()