Merge lp:~openerp-dev/openobject-addons/6.1-opw-579984-WrongUnitPrice-skh into lp:openobject-addons/6.1

Proposed by Somesh Khare
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579984-WrongUnitPrice-skh
Merge into: lp:openobject-addons/6.1
Diff against target: 16 lines (+4/-3)
1 file modified
account/ (+4/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579984-WrongUnitPrice-skh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email:

Description of the change

Hello Sir,

[FIX]account_invoice: Unit price of the product will be wrong in invoice line when the default UOM will be of type bigger.

Note: Check this issue in Web client.
1. Create a product and set the default UOM as "tonne" and with sale price 100.
2. Create a Invoice and select the product and see the Unit price of the product it will be 100000.
It should be 100 because the UOM of the product is tonne.

This branch fixes this issue, Kindly review the branch and please share your views in it.

Somesh Khare

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


This bug was qualified as not reproducible on Trunk . If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Naresh Soni

Unmerged revisions

7015. By Somesh Khare

[FIX]account_invoice: Unit price of the product will be wrong in invoice line when the default UOM will be of type bigger (Case: ref 579984)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/'
2--- account/ 2012-08-20 15:52:57 +0000
3+++ account/ 2012-10-05 12:42:24 +0000
4@@ -1404,9 +1404,10 @@
5 res_final['value']['price_unit'] = new_price
7 if uom:
8- uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context)
9- if ==
10- new_price = res_final['value']['price_unit'] * uom.factor_inv
11+ uom_obj = self.pool.get('product.uom')
12+ uom = uom_obj.browse(cr, uid, uom, context=context)
13+ if == and !=
14+ new_price = uom_obj._compute_price(cr, uid,, res_final['value']['price_unit'],
15 res_final['value']['price_unit'] = new_price
16 return res_final