Chris Biersbach (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-583796-cbi into 
lp:openobject-addons/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-583796-cbi/+merge/144072

The issue: When creating lines using the return picking wizard, a traceback is 
caused.

The reason: There is no corresponding stock move for the newly created lines.

The fix: Logically, we would need to make the field read-only, which is not 
possible because the quantity in the pre-created lines needs to be editable. I 
thus added a test to see if there are any newly created lines. If so, I show a 
warning to tell the user to delete the new lines again, because he is not 
supposed to create any lines.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-583796-cbi/+merge/144072
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-583796-cbi.
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py	2012-06-12 16:15:51 +0000
+++ stock/wizard/stock_return_picking.py	2013-01-21 09:17:22 +0000
@@ -174,6 +174,8 @@
         for v in val_id:
             data_get = data_obj.browse(cr, uid, v, context=context)
             mov_id = data_get.move_id.id
+            if not mov_id:
+                raise osv.except_osv(_('Warning !'), _("The creation of lines in the return picking wizard is not allowed. Please delete any lines you created."))
             new_qty = data_get.quantity
             move = move_obj.browse(cr, uid, mov_id, context=context)
             new_location = move.location_dest_id.id

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to