Skip to content

Commit

Permalink
use signal_workflow in the requisition, too
Browse files Browse the repository at this point in the history
  • Loading branch information
lepistone committed Oct 31, 2014
1 parent 894ff81 commit 7bf14b5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions framework_agreement_requisition/model/purchase_requisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#
##############################################################################
from itertools import chain
from openerp import workflow
from openerp.osv import orm, fields
from openerp.tools.translate import _
from openerp import models, api
Expand Down Expand Up @@ -84,8 +83,8 @@ def select_agreement(self, cr, uid, agr_id, context=None):
if isinstance(agr_id, (list, tuple)):
assert len(agr_id) == 1
agr_id = agr_id[0]
return workflow.trg_validate(uid, 'purchase.requisition',
agr_id, 'select_agreement', cr)
return self.signal_workflow(cr, uid, [agr_id], 'select_agreement',
context=context)

def _agreement_selected(self, cr, uid, ids, context=None):
"""Tells tender that an agreement has been selected"""
Expand Down Expand Up @@ -126,8 +125,8 @@ def _agreement_selected(self, cr, uid, ids, context=None):
'Purchase order %s does not pass to %s' %
(p_order.name, PO_AGR_SELECT))
for p_order in set(po_to_cancel):
workflow.trg_validate(uid, 'purchase.order', p_order.id,
'purchase_cancel', cr)
self.signal_workflow(cr, uid, [p_order.id], 'purchase_cancel',
context=context)
return generated

def agreement_selected(self, cr, uid, ids, context=None):
Expand Down

0 comments on commit 7bf14b5

Please sign in to comment.