From 345581338fdc967ae640ec85d7bff15f08b6abd8 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Mon, 22 Dec 2014 11:58:05 +0100 Subject: [PATCH] Include the fees in the open amount Display the fees column before the open amount, it is more logical since it is invoice amount + fees amount. --- .../model/line.py | 9 ++++++++- .../report/report_credit_control_summary.xml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/account_credit_control_dunning_fees/model/line.py b/account_credit_control_dunning_fees/model/line.py index 699c38d45..23803ebac 100644 --- a/account_credit_control_dunning_fees/model/line.py +++ b/account_credit_control_dunning_fees/model/line.py @@ -18,7 +18,7 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, fields +from openerp import models, fields, api class CreditControlLine(models.Model): @@ -27,3 +27,10 @@ class CreditControlLine(models.Model): _inherit = "credit.control.line" dunning_fees_amount = fields.Float(string='Fees') + balance_due_total = fields.Float(string='Balance due with fees', + compute='compute_balance_due') + + @api.one + @api.depends('dunning_fees_amount', 'balance_due') + def compute_balance_due(self): + self.balance_due_total = self.balance_due + self.dunning_fees_amount diff --git a/account_credit_control_dunning_fees/report/report_credit_control_summary.xml b/account_credit_control_dunning_fees/report/report_credit_control_summary.xml index 7bee3c5cf..e58ad2d9b 100644 --- a/account_credit_control_dunning_fees/report/report_credit_control_summary.xml +++ b/account_credit_control_dunning_fees/report/report_credit_control_summary.xml @@ -3,19 +3,19 @@