From 815f27fedf5da0b1772f231cd565982da5df836c Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Thu, 12 Jan 2012 17:14:57 +0530 Subject: [PATCH 1/2] [IMP]mrp_repair: added a message when repair order without repair line bzr revid: mma@tinyerp.com-20120112114457-yheegsrhr8tikbuy --- addons/mrp_repair/mrp_repair.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index e1216332ae4..e420ebdbf68 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)) From 18fcfecb9a956ac28f611c17cf20c14da63a964e Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 25 Jan 2012 10:46:03 +0530 Subject: [PATCH 2/2] [IMP]mrp:set proper indentation for if statement bzr revid: mma@tinyerp.com-20120125051603-qbpnvzg1et68nftf --- addons/mrp_repair/mrp_repair.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index e420ebdbf68..2edaba9431a 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -330,8 +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.')) + 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))