Merge lp:~openerp-dev/openobject-addons/6.0-opw-16347-skh into lp:openobject-addons/6.0

Proposed by Somesh Khare
Status: Merged
Approved by: Jay Vora (Serpent Consulting Services)
Approved revision: no longer in the source branch.
Merged at revision: 4729
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-16347-skh
Merge into: lp:openobject-addons/6.0
Diff against target: 33 lines (+2/-4)
1 file modified
stock/stock.py (+2/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-16347-skh
Reviewer Review Type Date Requested Status
Priyesh (OpenERP) Pending
Jay Vora (Serpent Consulting Services) Pending
Review via email: mp+68831@code.launchpad.net

Description of the change

Hello Sir,

[Fix] : Wrong product quantities in Invoice lines Reference with the OPW case: 16347.

Thanks,
SKH

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2011-07-20 05:43:46 +0000
3+++ stock/stock.py 2011-07-22 12:46:37 +0000
4@@ -437,7 +437,6 @@
5 """,
6 (id, id, product_id))
7 results += cr.dictfetchall()
8-
9 total = 0.0
10 results2 = 0.0
11
12@@ -1067,7 +1066,6 @@
13 uos_id = move_line.product_uos and move_line.product_uos.id or False
14 if not uos_id and inv_type in ('out_invoice', 'out_refund'):
15 uos_id = move_line.product_uom.id
16-
17 account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner.property_account_position, account_id)
18 invoice_line_id = invoice_line_obj.create(cr, uid, {
19 'name': name,
20@@ -1925,11 +1923,11 @@
21 done.append(move.id)
22 pickings[move.picking_id.id] = 1
23 r = res.pop(0)
24- cr.execute('update stock_move set location_id=%s, product_qty=%s where id=%s', (r[1], r[0], move.id))
25+ cr.execute('update stock_move set location_id=%s, product_qty=%s , product_uos_qty=%s where id=%s', (r[1], r[0], r[0] * move.product_id.uos_coeff, move.id))
26
27 while res:
28 r = res.pop(0)
29- move_id = self.copy(cr, uid, move.id, {'product_qty': r[0], 'location_id': r[1]})
30+ move_id = self.copy(cr, uid, move.id, {'product_qty': r[0],'product_uos_qty': r[0] * move.product_id.uos_coeff,'location_id': r[1]})
31 done.append(move_id)
32 if done:
33 count += len(done)