From daf46a3cbec9e81f88b7a5b8d57da799aaffb556 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 18 Mar 2014 23:51:10 +0100 Subject: [PATCH] Add a hook, which is designed to be inherited. For example, it can be used to wake-up the workflow of purchase order (usefull in combination with the module 'purchase_payment_order') --- account_banking_payment/model/account_payment.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/account_banking_payment/model/account_payment.py b/account_banking_payment/model/account_payment.py index 8c7374047..1e2e31277 100644 --- a/account_banking_payment/model/account_payment.py +++ b/account_banking_payment/model/account_payment.py @@ -275,6 +275,10 @@ class payment_order(orm.Model): }) return vals + def action_sent_no_move_line_hook(self, cr, uid, pay_line, context=None): + """This function is designed to be inherited""" + return + def action_sent(self, cr, uid, ids, context=None): """ Create the moves that pay off the move lines from @@ -328,6 +332,9 @@ class payment_order(orm.Model): if line.move_line_id: payment_line_obj.debit_reconcile( cr, uid, line.id, context=context) + else: + self.action_sent_no_move_line_hook( + cr, uid, line, context=context) account_move_obj.post(cr, uid, [move_id], context=context) # State field is written by act_sent_wait