Mayur Maheshwari(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-mrp-repair-without-line-mma into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-mrp-repair-without-line-mma/+merge/88356
Hello,
Reproduce the bug :
-------------
step:-
1] install mrp_repair
2] create a record of Repair order form without repair line and set invoice
after repair
now confirm ,start repair and end repair then make invoice
so it's give a UnboundLocalError: local variable 'move' referenced before
assignment
Fix
-----
I Have added a message on confirm state.
Thanks.
Mayur Mahehswari [ mma ]
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-mrp-repair-without-line-mma/+merge/88356
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-mrp-repair-without-line-mma.
=== modified file 'mrp_repair/mrp_repair.py'
--- mrp_repair/mrp_repair.py 2011-10-27 21:11:24 +0000
+++ mrp_repair/mrp_repair.py 2012-01-12 11:52:28 +0000
@@ -330,6 +330,8 @@
self.write(cr, uid, [o.id], {'state': '2binvoiced'})
else:
self.write(cr, uid, [o.id], {'state': 'confirmed'})
+ if not o.operations:
+ raise osv.except_osv(_('Error !'),_('You cannot confirm a repair order which has no line.'))
for line in o.operations:
if line.product_id.track_production and not line.prodlot_id:
raise osv.except_osv(_('Warning'), _("Production lot is required for opration line with product '%s'") % (line.product_id.name))
_______________________________________________
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