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/account_invoice.py (+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: mp+128239@code.launchpad.net

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.
Steps:
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.

Thanks,
Somesh Khare

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

Hello,

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.

Thanks,
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/account_invoice.py'
2--- account/account_invoice.py 2012-08-20 15:52:57 +0000
3+++ account/account_invoice.py 2012-10-05 12:42:24 +0000
4@@ -1404,9 +1404,10 @@
5 res_final['value']['price_unit'] = new_price
6
7 if uom:
8- uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context)
9- if res.uom_id.category_id.id == uom.category_id.id:
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 res.uom_id.category_id.id == uom.category_id.id and res.uom_id.id != uom.id:
14+ new_price = uom_obj._compute_price(cr, uid, res.uom_id.id, res_final['value']['price_unit'], uom.id)
15 res_final['value']['price_unit'] = new_price
16 return res_final
17