Merge lp:~openerp-dev/openobject-addons/6.1-opw-582836-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-582836-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 17 lines (+2/-2)
1 file modified
stock/stock.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-582836-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+138717@code.launchpad.net

Description of the change

Hello,

Steps to reproduce:
- Create a db and install sale module,
- Create a stockable product and update it's quantity(say, 15 in stock/shelf 1 and 10 in stock/shelf 2)
- Create a Sale Order with 25 qty for this product and set invoice policy to "Invoice based on deliveries" and confirm it,
- Open it's delivery order and process "Check availibility", stock moves should be splitted in 10, 15 qty,
- Process the delivery order and create invoice from that delivery order.

You will have invoice with 2 invoice lines with 25 qty for each line where it should be 10, 15 qty.

This MP contains fix for this issue. Kindly review the fix.

Thanks.

To post a comment you must log in.
7096. By Ravi Gohil (OpenERP)

[FIX] stock: wrong product quantity in invoice lines if created from delivery orders : (Maintenance Case : 582836)

Unmerged revisions

7096. By Ravi Gohil (OpenERP)

[FIX] stock: wrong product quantity in invoice lines if created from delivery orders : (Maintenance Case : 582836)

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 2012-10-05 07:47:57 +0000
3+++ stock/stock.py 2012-12-07 13:03:22 +0000
4@@ -2037,11 +2037,11 @@
5 done.append(move.id)
6 pickings[move.picking_id.id] = 1
7 r = res.pop(0)
8- cr.execute('update stock_move set location_id=%s, product_qty=%s where id=%s', (r[1], r[0], move.id))
9+ 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))
10
11 while res:
12 r = res.pop(0)
13- move_id = self.copy(cr, uid, move.id, {'product_qty': r[0], 'location_id': r[1]})
14+ 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]})
15 done.append(move_id)
16 if done:
17 count += len(done)