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')

This commit is contained in:
Alexis de Lattre
2014-03-18 23:51:10 +01:00
parent 58393f8b0f
commit daf46a3cbe

View File

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