Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-production_lot_more_qty-mma into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-production_lot_more_qty-mma/+merge/88166

Hello,

Reproduce the bug :
-------------
step :-
1] create a manufacturing order 
2] In Product to consume tab click split in production lot
3] now In lot give a more quantity then available like if 5 quantity is there 
so give a 10 quantity in lot
4] then click ok so it's give TypeError: 'bool' object is not iterable

Fix
-----
I Have added a message when a lot quantity is more than available quantity

Thanks.
Mayur Mahehswari [ mma ]


-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-production_lot_more_qty-mma/+merge/88166
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-production_lot_more_qty-mma.
=== modified file 'stock/wizard/stock_move.py'
--- stock/wizard/stock_move.py	2011-12-22 10:54:11 +0000
+++ stock/wizard/stock_move.py	2012-01-11 10:08:40 +0000
@@ -205,8 +205,13 @@
                     lines = [l for l in data.line_exist_ids if l]
                 else:
                     lines = [l for l in data.line_ids if l]
+                total_move_qty = 0.0
                 for line in lines:
                     quantity = line.quantity
+                    total_move_qty += quantity
+                    if total_move_qty > move_qty:
+                        raise osv.except_osv(_('Processing Error'), _('Processing quantity %d for %s is larger than the available quantity %d!')\
+                                     %(total_move_qty, move.product_id.name, move_qty))
                     if quantity <= 0 or move_qty == 0:
                         continue
                     quantity_rest -= quantity

_______________________________________________
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

Reply via email to