diff options
| author | Raphael Collet <rco@openerp.com> | 2012-01-30 16:04:34 +0100 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2012-01-30 16:04:34 +0100 |
| commit | c8ee5fb0c85dba5e495fcbea94f17c7de5abf4ca (patch) | |
| tree | 9d4e83963663ddc614de43e6f65e3e1c86650280 /addons | |
| parent | 9fc00eed5cd13e33e4513d9375e481ad714b2147 (diff) | |
| parent | 656105ccbf261b2c32adae164b58817c1ee50ca5 (diff) | |
[MERGE] mrp_repair: add check to prevent confirmation of repair order without line
bzr revid: rco@openerp.com-20120130150434-qwc16oe1edjh1y13
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mrp_repair/mrp_repair.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index e1216332ae4..2edaba9431a 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -330,6 +330,8 @@ class mrp_repair(osv.osv): 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)) |
