diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 4f1b97cf28b..ea7460dae21 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -364,7 +364,7 @@ class pos_session(osv.osv): ids = [ids] this_record = self.browse(cr, uid, ids[0], context=context) - this_record._workflow_signal('open') + this_record.signal_workflow('open') context.update(active_id=this_record.id) diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index dba68e79bf4..edf01290398 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -373,14 +373,13 @@ class procurement_order(osv.osv): self.message_post(cr, uid, [procurement.id], body=message, context=context) return ok - def _workflow_trigger(self, cr, uid, ids, trigger, context=None): - """ Don't trigger workflow for the element specified in trigger - """ - wkf_op_key = 'workflow.%s.%s' % (trigger, self._name) + def step_workflow(self, cr, uid, ids, context=None): + """ Don't trigger workflow for the element specified in trigger """ + wkf_op_key = 'workflow.trg_write.%s' % self._name if context and not context.get(wkf_op_key, True): # make sure we don't have a trigger loop while processing triggers return - return super(procurement_order,self)._workflow_trigger(cr, uid, ids, trigger, context=context) + return super(procurement_order, self).step_workflow(cr, uid, ids, context=context) def action_produce_assign_service(self, cr, uid, ids, context=None): """ Changes procurement state to Running. diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 2d351d9302e..8e4611dc5d0 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2947,15 +2947,25 @@ class stock_picking_in(osv.osv): #override in order to redirect the check of acces rules on the stock.picking object return self.pool.get('stock.picking').check_access_rule(cr, uid, ids, operation, context=context) - def _workflow_trigger(self, cr, uid, ids, trigger, context=None): - #override in order to trigger the workflow of stock.picking at the end of create, write and unlink operation - #instead of it's own workflow (which is not existing) - return self.pool.get('stock.picking')._workflow_trigger(cr, uid, ids, trigger, context=context) + def create_workflow(self, cr, uid, ids, context=None): + # overridden in order to trigger the workflow of stock.picking at the end of create, + # write and unlink operation instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').create_workflow(cr, uid, ids, context=context) - def _workflow_signal(self, cr, uid, ids, signal, context=None): - #override in order to fire the workflow signal on given stock.picking workflow instance - #instead of it's own workflow (which is not existing) - return self.pool.get('stock.picking')._workflow_signal(cr, uid, ids, signal, context=context) + def delete_workflow(self, cr, uid, ids, context=None): + # overridden in order to trigger the workflow of stock.picking at the end of create, + # write and unlink operation instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').delete_workflow(cr, uid, ids, context=context) + + def step_workflow(self, cr, uid, ids, context=None): + # overridden in order to trigger the workflow of stock.picking at the end of create, + # write and unlink operation instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').step_workflow(cr, uid, ids, context=context) + + def signal_workflow(self, cr, uid, ids, signal, context=None): + # overridden in order to fire the workflow signal on given stock.picking workflow instance + # instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').signal_workflow(cr, uid, ids, signal, context=context) _columns = { 'backorder_id': fields.many2one('stock.picking.in', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), @@ -2992,15 +3002,25 @@ class stock_picking_out(osv.osv): #override in order to redirect the check of acces rules on the stock.picking object return self.pool.get('stock.picking').check_access_rule(cr, uid, ids, operation, context=context) - def _workflow_trigger(self, cr, uid, ids, trigger, context=None): - #override in order to trigger the workflow of stock.picking at the end of create, write and unlink operation - #instead of it's own workflow (which is not existing) - return self.pool.get('stock.picking')._workflow_trigger(cr, uid, ids, trigger, context=context) + def create_workflow(self, cr, uid, ids, context=None): + # overridden in order to trigger the workflow of stock.picking at the end of create, + # write and unlink operation instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').create_workflow(cr, uid, ids, context=context) - def _workflow_signal(self, cr, uid, ids, signal, context=None): - #override in order to fire the workflow signal on given stock.picking workflow instance - #instead of it's own workflow (which is not existing) - return self.pool.get('stock.picking')._workflow_signal(cr, uid, ids, signal, context=context) + def delete_workflow(self, cr, uid, ids, context=None): + # overridden in order to trigger the workflow of stock.picking at the end of create, + # write and unlink operation instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').delete_workflow(cr, uid, ids, context=context) + + def step_workflow(self, cr, uid, ids, context=None): + # overridden in order to trigger the workflow of stock.picking at the end of create, + # write and unlink operation instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').step_workflow(cr, uid, ids, context=context) + + def signal_workflow(self, cr, uid, ids, signal, context=None): + # overridden in order to fire the workflow signal on given stock.picking workflow instance + # instead of its own workflow (which is not existing) + return self.pool.get('stock.picking').signal_workflow(cr, uid, ids, signal, context=context) _columns = { 'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),