[FIX] purchase: avoid getting trigger loop (again), apply same fix on procurement to be consistent

bzr revid: mat@openerp.com-20131004153915-2urkq50bp8rnddnt
This commit is contained in:
Martin Trigaux 2013-10-04 17:39:15 +02:00
parent e827454d1d
commit 4c0c18b803
2 changed files with 3 additions and 1 deletions

View File

@ -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):

View File

@ -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