diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 8a5b5107319..2bc095a9661 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -372,7 +372,6 @@ class procurement_order(osv.osv): ctx_wkf = dict(context or {}) ctx_wkf['workflow.trg_write.%s' % self._name] = False self.write(cr, uid, [procurement.id], {'message': message},context=ctx_wkf) - self.message_post(cr, uid, [procurement.id], body=message, context=context) return ok def _workflow_trigger(self, cr, uid, ids, trigger, context=None): diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index adaaf6d55e2..073fbc27514 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1046,6 +1046,9 @@ class procurement_order(osv.osv): message = _('No address defined for the supplier') if message and procurement.message != message: + #temporary context passed in write to prevent an infinite loop + ctx_wkf = dict(context or {}) + ctx_wkf['workflow.trg_write.%s' % self._name] = False self.write(cr, uid, [procurement.id], {'message':message}, context=context) return False