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
=== modified file 'stock/stock.py'
--- stock/stock.py 2012-10-05 07:47:57 +0000
+++ stock/stock.py 2012-12-07 13:03:22 +0000
@@ -2037,11 +2037,11 @@
2037 done.append(move.id)2037 done.append(move.id)
2038 pickings[move.picking_id.id] = 12038 pickings[move.picking_id.id] = 1
2039 r = res.pop(0)2039 r = res.pop(0)
2040 cr.execute('update stock_move set location_id=%s, product_qty=%s where id=%s', (r[1], r[0], move.id))2040 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))
20412041
2042 while res:2042 while res:
2043 r = res.pop(0)2043 r = res.pop(0)
2044 move_id = self.copy(cr, uid, move.id, {'product_qty': r[0], 'location_id': r[1]})2044 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]})
2045 done.append(move_id)2045 done.append(move_id)
2046 if done:2046 if done:
2047 count += len(done)2047 count += len(done)