@@ -328,7 +328,7 @@ def unlink(self, cr, uid, ids, context=None):
328
328
raise osv .except_osv (_ ('Invalid Action!' ), _ ('In order to delete a purchase order, you must cancel it first.' ))
329
329
330
330
# automatically sending subflow.delete upon deletion
331
- self .signal_purchase_cancel (cr , uid , unlink_ids )
331
+ self .signal_workflow (cr , uid , unlink_ids , 'purchase_cancel' )
332
332
333
333
return super (purchase_order , self ).unlink (cr , uid , unlink_ids , context = context )
334
334
@@ -519,7 +519,7 @@ def print_quotation(self, cr, uid, ids, context=None):
519
519
This function prints the request for quotation and mark it as sent, so that we can see more easily the next step of the workflow
520
520
'''
521
521
assert len (ids ) == 1 , 'This option should only be used for a single id at a time'
522
- self .signal_send_rfq (cr , uid , ids )
522
+ self .signal_workflow (cr , uid , ids , 'send_rfq' )
523
523
return self .pool ['report' ].get_action (cr , uid , ids , 'purchase.report_purchasequotation' , context = context )
524
524
525
525
def wkf_confirm_order (self , cr , uid , ids , context = None ):
@@ -680,19 +680,19 @@ def action_cancel(self, cr, uid, ids, context=None):
680
680
_ ('Unable to cancel the purchase order %s.' ) % (purchase .name ),
681
681
_ ('First cancel all receptions related to this purchase order.' ))
682
682
self .pool .get ('stock.picking' ) \
683
- .signal_button_cancel (cr , uid , map (attrgetter ('id' ), purchase .picking_ids ))
683
+ .signal_workflow (cr , uid , map (attrgetter ('id' ), purchase .picking_ids ), 'button_cancel' )
684
684
for inv in purchase .invoice_ids :
685
685
if inv and inv .state not in ('cancel' , 'draft' ):
686
686
raise osv .except_osv (
687
687
_ ('Unable to cancel this purchase order.' ),
688
688
_ ('You must first cancel all invoices related to this purchase order.' ))
689
689
self .pool .get ('account.invoice' ) \
690
- .signal_invoice_cancel (cr , uid , map (attrgetter ('id' ), purchase .invoice_ids ))
690
+ .signal_workflow (cr , uid , map (attrgetter ('id' ), purchase .invoice_ids ), 'invoice_cancel' )
691
691
self .pool ['purchase.order.line' ].write (cr , uid , [l .id for l in purchase .order_line ],
692
692
{'state' : 'cancel' })
693
693
self .write (cr , uid , ids , {'state' : 'cancel' })
694
694
self .set_order_line_status (cr , uid , ids , 'cancel' , context = context )
695
- self .signal_purchase_cancel (cr , uid , ids )
695
+ self .signal_workflow (cr , uid , ids , 'purchase_cancel' )
696
696
return True
697
697
698
698
def _prepare_order_line_move (self , cr , uid , order , order_line , picking_id , group_id , context = None ):
@@ -933,7 +933,7 @@ def make_key(br, fields):
933
933
# make triggers pointing to the old orders point to the new order
934
934
for old_id in old_ids :
935
935
self .redirect_workflow (cr , uid , [(old_id , neworder_id )])
936
- self .signal_purchase_cancel (cr , uid , [old_id ])
936
+ self .signal_workflow (cr , uid , [old_id ], 'purchase_cancel' )
937
937
938
938
return orders_info
939
939
@@ -1370,7 +1370,7 @@ def _postprocess_sent_message(self, cr, uid, mail, context=None, mail_sent=True)
1370
1370
if mail_sent and mail .model == 'purchase.order' :
1371
1371
obj = self .pool .get ('purchase.order' ).browse (cr , uid , mail .res_id , context = context )
1372
1372
if obj .state == 'draft' :
1373
- self .pool .get ('purchase.order' ).signal_send_rfq (cr , uid , [mail .res_id ])
1373
+ self .pool .get ('purchase.order' ).signal_workflow (cr , uid , [mail .res_id ], 'send_rfq' )
1374
1374
return super (mail_mail , self )._postprocess_sent_message (cr , uid , mail = mail , context = context , mail_sent = mail_sent )
1375
1375
1376
1376
@@ -1423,7 +1423,7 @@ def send_mail(self, cr, uid, ids, context=None):
1423
1423
context = context or {}
1424
1424
if context .get ('default_model' ) == 'purchase.order' and context .get ('default_res_id' ):
1425
1425
context = dict (context , mail_post_autofollow = True )
1426
- self .pool .get ('purchase.order' ).signal_send_rfq (cr , uid , [context ['default_res_id' ]])
1426
+ self .pool .get ('purchase.order' ).signal_workflow (cr , uid , [context ['default_res_id' ]], 'send_rfq' )
1427
1427
return super (mail_compose_message , self ).send_mail (cr , uid , ids , context = context )
1428
1428
1429
1429
0 commit comments