From dfd409fa3ee72b49e928d5668f5089c5c3680447 Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Mon, 18 Mar 2019 17:31:56 +0100 Subject: [PATCH] Proxy fields defaults with lambda to allow inheritance --- rma_account/README.rst | 1 + rma_account/models/rma_order_line.py | 2 +- rma_account/wizards/rma_refund.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rma_account/README.rst b/rma_account/README.rst index c8003352..8dfed892 100644 --- a/rma_account/README.rst +++ b/rma_account/README.rst @@ -44,6 +44,7 @@ Contributors * Aaron Henriquez * Lois Rilo * Bhavesh Odedra +* Akim Juillerat Maintainer ---------- diff --git a/rma_account/models/rma_order_line.py b/rma_account/models/rma_order_line.py index 95904737..bfe24b6c 100644 --- a/rma_account/models/rma_order_line.py +++ b/rma_account/models/rma_order_line.py @@ -43,7 +43,7 @@ class RmaOrderLine(models.Model): invoice_address_id = fields.Many2one( 'res.partner', string='Partner invoice address', - default=_default_invoice_address, + default=lambda self: self._default_invoice_address(), readonly=True, states={'draft': [('readonly', False)]}, help="Invoice address for current rma order.", ) diff --git a/rma_account/wizards/rma_refund.py b/rma_account/wizards/rma_refund.py index 48c72eeb..a77e0e1e 100644 --- a/rma_account/wizards/rma_refund.py +++ b/rma_account/wizards/rma_refund.py @@ -63,7 +63,8 @@ class RmaRefund(models.TransientModel): ) date = fields.Date(string='Accounting Date') description = fields.Char( - string='Reason', required=True, default=_get_reason, + string='Reason', required=True, + default=lambda self: self._get_reason(), ) item_ids = fields.One2many( comodel_name='rma.refund.item',