Amit Dodiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-57629-ado into 
lp:openobject-addons/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-57629-ado/+merge/87919

Hello,

[FIX] UOM is not taken into consideration neighter for  subtotal nor for total 
while creating a repair order"

1). Create a mrp repair order 
2). Add 3 order line, 1 for centimer, 1 for meter and 1 for kilometer of wood 
product.
3). Change the UOM of meter to cm / meter to km.

Uom change is not affecting to total & Subtotal.

Thanks,
Amit
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-57629-ado/+merge/87919
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-57629-ado.
=== modified file 'mrp_repair/mrp_repair.py'
--- mrp_repair/mrp_repair.py	2011-08-05 13:37:54 +0000
+++ mrp_repair/mrp_repair.py	2012-01-09 11:30:32 +0000
@@ -606,6 +606,9 @@
 
             result['name'] = product_obj.partner_ref
             result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False
+            if not uom:
+                uom = product_obj.uom_id and product_obj.uom_id.id or False
+            
             if not pricelist:
                 warning = {
                     'title':'No Pricelist !',
@@ -625,8 +628,7 @@
                             "You have to change either the product, the quantity or the pricelist."
                      }
                 else:
-                    result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})
-
+                    result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty, 'product_uom': uom})
         return {'value': result, 'warning': warning}
 
 
@@ -655,7 +657,6 @@
                 line.repair_id.partner_invoice_id.id, line.product_id, line.repair_id.partner_id)
             cur = line.repair_id.pricelist_id.currency_id
             res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])
-        print "RES", res
         return res
 
     _columns = {

=== modified file 'mrp_repair/mrp_repair_view.xml'
--- mrp_repair/mrp_repair_view.xml	2011-04-26 09:31:37 +0000
+++ mrp_repair/mrp_repair_view.xml	2012-01-09 11:30:32 +0000
@@ -52,7 +52,7 @@
                                         <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
                                         <field name='prodlot_id'/>
                                         <field name="product_uom_qty" string="Qty" />
-                                        <field name="product_uom" string="UoM"/>
+                                        <field name="product_uom" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" string="UoM"/>
                                         <field name="price_unit"/>
                                         <field name="price_subtotal"/>
                                         <field name="location_id"/>
@@ -82,7 +82,7 @@
                                 <field name="location_id"/>
                                 <field name="location_dest_id"/>
                                 <field name="product_uom_qty" string="Qty"/>
-                                <field name="product_uom" string="UoM"/>
+                                <field name="product_uom" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" string="UoM"/>
                                 <field name="price_unit"/>
                                 <field name="tax_id"/>
                                 <field name="to_invoice"/>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to