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 2012-03-16 09:44:09 +0000
+++ mrp_repair/mrp_repair.py 2012-07-11 12:03:20 +0000
@@ -593,6 +593,9 @@
"""
result = {}
warning = {}
+
+ if not product:
+ return {'value': {'product_uom': False, 'tax_id':[], 'name': False, 'price_unit': False}}
if not product_uom_qty:
product_uom_qty = 1
@@ -605,7 +608,10 @@
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id)
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
+ result['product_uom'] = uom
+
if not pricelist:
warning = {
'title':'No Pricelist !',
@@ -626,7 +632,7 @@
}
else:
result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})
-
+
return {'value': result, 'warning': warning}
@@ -655,7 +661,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-07-11 12:03:20 +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