From 22ef1bc8dcd6eee517a7dc26c6d35575f82ce875 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Sat, 7 Mar 2015 17:18:09 +0100 Subject: [PATCH] [IMP] Include the fees in the total due --- .../__init__.py | 1 + .../wizard/__init__.py | 23 +++++++++++++ .../wizard/credit_control_communication.py | 32 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 account_credit_control_dunning_fees/wizard/__init__.py create mode 100644 account_credit_control_dunning_fees/wizard/credit_control_communication.py diff --git a/account_credit_control_dunning_fees/__init__.py b/account_credit_control_dunning_fees/__init__.py index 6ac610f01..a485290c7 100644 --- a/account_credit_control_dunning_fees/__init__.py +++ b/account_credit_control_dunning_fees/__init__.py @@ -19,3 +19,4 @@ # ############################################################################## from . import model +from . import wizard diff --git a/account_credit_control_dunning_fees/wizard/__init__.py b/account_credit_control_dunning_fees/wizard/__init__.py new file mode 100644 index 000000000..b400e6315 --- /dev/null +++ b/account_credit_control_dunning_fees/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Authors: Adrien Peiffer +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import credit_control_communication diff --git a/account_credit_control_dunning_fees/wizard/credit_control_communication.py b/account_credit_control_dunning_fees/wizard/credit_control_communication.py new file mode 100644 index 000000000..99669b612 --- /dev/null +++ b/account_credit_control_dunning_fees/wizard/credit_control_communication.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Authors: Adrien Peiffer +# Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp import models, api + + +class CreditCommunication(models.TransientModel): + _inherit = 'credit.control.communication' + + @api.model + def _get_total_due(self): + balance_field = 'credit_control_line_ids.balance_due_total' + return sum(self.mapped(balance_field))