Merge lp:~openerp-dev/openobject-addons/6.0-opw-57629-ado into lp:openobject-addons/6.0

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-57629-ado
Merge into: lp:openobject-addons/6.0
Diff against target: 64 lines (+10/-5)
2 files modified
mrp_repair/mrp_repair.py (+8/-3)
mrp_repair/mrp_repair_view.xml (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-57629-ado
Reviewer Review Type Date Requested Status
Amit Dodiya (OpenERP) (community) Needs Resubmitting
Naresh(OpenERP) (community) Needs Fixing
Review via email: mp+87919@code.launchpad.net

Description of the change

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

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello Amit,

There is a scope to improve here...

 + if not uom:
 + uom = product_obj.uom_id and product_obj.uom_id.id or False

        - result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False
        + result['product_uom'] = uom

then no need of this change too
- result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})
19 -
20 + result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty, 'product_uom': uom})

Thanks,

review: Needs Fixing
Revision history for this message
Amit Dodiya (OpenERP) (ado-openerp) wrote :

Hello,

I have changed the code.

Regards,
Amit Dodiya

review: Needs Resubmitting

Unmerged revisions

5289. By Amit Dodiya<email address hidden>

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mrp_repair/mrp_repair.py'
--- mrp_repair/mrp_repair.py 2012-03-16 09:44:09 +0000
+++ mrp_repair/mrp_repair.py 2012-07-11 12:03:20 +0000
@@ -593,6 +593,9 @@
593 """593 """
594 result = {}594 result = {}
595 warning = {}595 warning = {}
596
597 if not product:
598 return {'value': {'product_uom': False, 'tax_id':[], 'name': False, 'price_unit': False}}
596599
597 if not product_uom_qty:600 if not product_uom_qty:
598 product_uom_qty = 1601 product_uom_qty = 1
@@ -605,7 +608,10 @@
605 result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id)608 result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id)
606609
607 result['name'] = product_obj.partner_ref610 result['name'] = product_obj.partner_ref
608 result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False611 if not uom:
612 uom = product_obj.uom_id and product_obj.uom_id.id or False
613 result['product_uom'] = uom
614
609 if not pricelist:615 if not pricelist:
610 warning = {616 warning = {
611 'title':'No Pricelist !',617 'title':'No Pricelist !',
@@ -626,7 +632,7 @@
626 }632 }
627 else:633 else:
628 result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})634 result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})
629635
630 return {'value': result, 'warning': warning}636 return {'value': result, 'warning': warning}
631637
632638
@@ -655,7 +661,6 @@
655 line.repair_id.partner_invoice_id.id, line.product_id, line.repair_id.partner_id)661 line.repair_id.partner_invoice_id.id, line.product_id, line.repair_id.partner_id)
656 cur = line.repair_id.pricelist_id.currency_id662 cur = line.repair_id.pricelist_id.currency_id
657 res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])663 res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])
658 print "RES", res
659 return res664 return res
660665
661 _columns = {666 _columns = {
662667
=== 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-07-11 12:03:20 +0000
@@ -52,7 +52,7 @@
52 <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>52 <field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)"/>
53 <field name='prodlot_id'/>53 <field name='prodlot_id'/>
54 <field name="product_uom_qty" string="Qty" />54 <field name="product_uom_qty" string="Qty" />
55 <field name="product_uom" string="UoM"/>55 <field name="product_uom" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" string="UoM"/>
56 <field name="price_unit"/>56 <field name="price_unit"/>
57 <field name="price_subtotal"/>57 <field name="price_subtotal"/>
58 <field name="location_id"/>58 <field name="location_id"/>
@@ -82,7 +82,7 @@
82 <field name="location_id"/>82 <field name="location_id"/>
83 <field name="location_dest_id"/>83 <field name="location_dest_id"/>
84 <field name="product_uom_qty" string="Qty"/>84 <field name="product_uom_qty" string="Qty"/>
85 <field name="product_uom" string="UoM"/>85 <field name="product_uom" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_uom_qty, parent.partner_id)" string="UoM"/>
86 <field name="price_unit"/>86 <field name="price_unit"/>
87 <field name="tax_id"/>87 <field name="tax_id"/>
88 <field name="to_invoice"/>88 <field name="to_invoice"/>