Amit Parik (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-1015697-amp into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #1015697 in OpenERP Addons: "Incorrect invoicing from delivery order"
https://bugs.launchpad.net/openobject-addons/+bug/1015697
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1015697-amp/+merge/111363
Hello,
This fix will solve the wrong quantity on invoice problem when invoice policy
"on delivery".
Test case.
Create a product assign a 5 qty on stock location and 5 qty on shelf1 location.
Create SO for 10 qty with same product select invoice policy "on delivery
order".
Go to delivery order check availability. Two moves will created one for Stock
another for Shelf1 with 5 qty.
Now try to create invoice form delivery, You have seen two invoice line for
10-10 qty. It should be two invoice line for 5-5 qty.
This fix will solved this issue.
Thank you!
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1015697-amp/+merge/111363
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-1015697-amp.
=== modified file 'stock/stock.py'
--- stock/stock.py 2012-05-25 10:26:43 +0000
+++ stock/stock.py 2012-06-21 09:23:20 +0000
@@ -2082,11 +2082,13 @@
done.append(move.id)
pickings[move.picking_id.id] = 1
r = res.pop(0)
- cr.execute('update stock_move set location_id=%s, product_qty=%s where id=%s', (r[1], r[0], move.id))
+ product_uos_qty = self.pool.get('stock.move').onchange_quantity(cr, uid, ids, move.product_id.id, r[0], move.product_id.uom_id.id, move.product_id.uos_id.id)['value']['product_uos_qty']
+ 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.id))
while res:
r = res.pop(0)
- move_id = self.copy(cr, uid, move.id, {'product_qty': r[0], 'location_id': r[1]})
+ product_uos_qty = self.pool.get('stock.move').onchange_quantity(cr, uid, ids, move.product_id.id, r[0], move.product_id.uom_id.id, move.product_id.uos_id.id)['value']['product_uos_qty']
+ move_id = self.copy(cr, uid, move.id, {'product_uos_qty': product_uos_qty, 'product_qty': r[0], 'location_id': r[1]})
done.append(move_id)
if done:
count += len(done)
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp