[IMP]: procument: Improve the exception message
authorsbh (Open ERP) <sbh@tinyerp.com>
Mon, 12 Jul 2010 07:09:53 +0000 (12:39 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Mon, 12 Jul 2010 07:09:53 +0000 (12:39 +0530)
bzr revid: sbh@tinyerp.com-20100712070953-gqlcznvqht5up82x

addons/procurement/procurement.py

index 34a5c02..e7a5f1c 100644 (file)
@@ -372,6 +372,9 @@ class procurement_order(osv.osv):
                     cr.execute('update procurement_order set message=%s where id=%s', (_('Not enough stock and no minimum orderpoint rule defined.'), procurement.id))
                     message = _('Procurement ') + " '" + procurement.name + "' "+ _("has an exception.") + _('Not enough stock and no minimum orderpoint rule defined.')
                     self.log(cr, uid, procurement.id, message)
+            if procurement.state=='exception' and procurement.message=='':
+                cr.execute('update procurement_order set message=%s where id=%s', (_('Not enough stock '), procurement.id))                
+                        
         return ok
 
     def action_produce_assign_service(self, cr, uid, ids, context={}):