[IMP] procurement: history of procurement order improved by adding a log when a rule...
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Wed, 9 Oct 2013 10:22:45 +0000 (12:22 +0200)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Wed, 9 Oct 2013 10:22:45 +0000 (12:22 +0200)
bzr revid: qdp-launchpad@openerp.com-20131009102245-y6cwo3beh3pk4no8

addons/procurement/procurement.py

index 6279df4..3f4ad6e 100644 (file)
@@ -199,6 +199,8 @@ class procurement_order(osv.osv):
         if procurement.product_id.type != 'service':
             rule_id = self._find_suitable_rule(cr, uid, procurement, context=context)
             if rule_id:
+                rule = self.pool.get('procurement.rule').browse(cr, uid, rule_id, context=context)
+                self.message_post(cr, uid, [procurement.id], body=_('Following rule %s for the procurement resolution.') % (rule.name), context=context)
                 self.write(cr, uid, [procurement.id], {'rule_id': rule_id}, context=context)
                 return True
         return False