Skip to content
Permalink
Browse files

[IMP] account: allow to override _get_reason

Do not pass the function reference instead call it
on self in order to be able to override it.

task_id: 1909413

closes #30993

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
  • Loading branch information...
amoyaux committed Mar 21, 2019
1 parent 277e32d commit eff31f53366054dea000509568a4754761d048bd
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/account/wizard/account_invoice_refund.py
@@ -22,7 +22,7 @@ def _get_reason(self):

date_invoice = fields.Date(string='Credit Note Date', default=fields.Date.context_today, required=True)
date = fields.Date(string='Accounting Date')
description = fields.Char(string='Reason', required=True, default=_get_reason)
description = fields.Char(string='Reason', required=True, default=lambda self: self._get_reason())
refund_only = fields.Boolean(string='Technical field to hide filter_refund in case invoice is partially paid', compute='_get_refund_only')
filter_refund = fields.Selection([('refund', 'Create a draft credit note'), ('cancel', 'Cancel: create credit note and reconcile'), ('modify', 'Modify: create credit note, reconcile and create a new draft invoice')],
default='refund', string='Credit Method', required=True, help='Choose how you want to credit this invoice. You cannot Modify and Cancel if the invoice is already reconciled')

0 comments on commit eff31f5

Please sign in to comment.
You can’t perform that action at this time.