[FIX] Purchase : Product_uom_change should respect fiscal position related to product...
authorGPA(OpenERP) <>
Wed, 14 Apr 2010 10:29:58 +0000 (15:59 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Wed, 14 Apr 2010 10:29:58 +0000 (15:59 +0530)
lp bug: https://launchpad.net/bugs/559347 fixed

bzr revid: jvo@tinyerp.com-20100414102958-be3h1nl9sodxw15b

addons/purchase/purchase.py
addons/purchase/purchase_view.xml

index e6198b8..9bc1d8c 100644 (file)
@@ -533,9 +533,9 @@ class purchase_order_line(osv.osv):
         return res
 
     def product_uom_change(self, cr, uid, ids, pricelist, product, qty, uom,
-            partner_id, date_order=False):
+            partner_id, date_order=False, fiscal_position=False):
         res = self.product_id_change(cr, uid, ids, pricelist, product, qty, uom,
-                partner_id, date_order=date_order)
+                partner_id, date_order=date_order, fiscal_position=fiscal_position)
         if 'product_uom' in res['value']:
             del res['value']['product_uom']
         if not uom:
index fe2c22c..390224f 100644 (file)
                         <page string="Order Line">
                             <field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order, parent.fiscal_position)"/>
                             <field context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_qty" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order, parent.fiscal_position)"/>
-                            <field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
+                            <field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order, parent.fiscal_position)"/>
                             <field colspan="4" name="name"/>
                             <field name="date_planned"/>
                             <field name="price_unit"/>