From bf87bcf2f8fd0140e3e69c2e43030e67cf18e658 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Wed, 7 Jan 2015 09:57:10 +0100 Subject: [PATCH] Remove post_install and at_install instructions on tests With that, the suite is run even when we update another module and that not what we expect. Remove the unused mako template 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. Update translation of account_credit_control_dunning_fees Update translations, translate words of the report in German --- .../account_credit_control_dunning_fees.pot | 53 ++-- .../i18n/de.po | 5 +- .../i18n/fr.po | 50 ++-- .../model/line.py | 9 +- .../report/credit_control_summary.html.mako | 246 ------------------ .../report/report_credit_control_summary.xml | 16 +- .../tests/test_fees_generation.py | 2 - 7 files changed, 84 insertions(+), 297 deletions(-) delete mode 100644 account_credit_control_dunning_fees/report/credit_control_summary.html.mako diff --git a/account_credit_control_dunning_fees/i18n/account_credit_control_dunning_fees.pot b/account_credit_control_dunning_fees/i18n/account_credit_control_dunning_fees.pot index 6282315c6..a33c86d1e 100644 --- a/account_credit_control_dunning_fees/i18n/account_credit_control_dunning_fees.pot +++ b/account_credit_control_dunning_fees/i18n/account_credit_control_dunning_fees.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_credit_control_dunning_fees # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-05-07 11:44+0000\n" -"PO-Revision-Date: 2014-05-07 11:44+0000\n" +"POT-Creation-Date: 2014-12-22 11:00+0000\n" +"PO-Revision-Date: 2014-12-22 11:00+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,29 +16,34 @@ msgstr "" "Plural-Forms: \n" #. module: account_credit_control_dunning_fees -#: code:_description:0 #: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_line -#, python-format msgid "A credit control line" msgstr "" #. module: account_credit_control_dunning_fees -#: code:_description:0 #: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_policy_level -#, python-format msgid "A credit control policy level" msgstr "" #. module: account_credit_control_dunning_fees -#: code:_description:0 +#: field:credit.control.dunning.fees.computer,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: field:credit.control.dunning.fees.computer,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_credit_control_dunning_fees #: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_run -#, python-format msgid "Credit control line generator" msgstr "" #. module: account_credit_control_dunning_fees #: field:credit.control.line,dunning_fees_amount:0 -#: view:credit.control.policy:0 +#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy +#: view:website:account_credit_control.report_credit_control_summary_document msgid "Fees" msgstr "" @@ -63,19 +68,27 @@ msgid "Fixed" msgstr "" #. module: account_credit_control_dunning_fees -#: view:credit.control.policy:0 +#: field:credit.control.dunning.fees.computer,id:0 +msgid "ID" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: field:credit.control.dunning.fees.computer,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: field:credit.control.dunning.fees.computer,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy msgid "Mail and reporting" msgstr "" -#. module: account_credit_control_dunning_fees -#: code:_description:0 -#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_dunning_fees_computer -#, python-format -msgid "credit.control.dunning.fees.computer" -msgstr "" - #. module: account_credit_control_dunning_fees #: field:credit.control.policy.level,dunning_fees_type:0 -msgid "unknown" +msgid "Type" msgstr "" diff --git a/account_credit_control_dunning_fees/i18n/de.po b/account_credit_control_dunning_fees/i18n/de.po index f4fe9f0c3..bfc20cf23 100644 --- a/account_credit_control_dunning_fees/i18n/de.po +++ b/account_credit_control_dunning_fees/i18n/de.po @@ -77,5 +77,6 @@ msgstr "credit.control.dunning.fees.computer" #. module: account_credit_control_dunning_fees #: field:credit.control.policy.level,dunning_fees_type:0 -msgid "unknown" -msgstr "unbekannt" +msgid "Type" +msgstr "" + diff --git a/account_credit_control_dunning_fees/i18n/fr.po b/account_credit_control_dunning_fees/i18n/fr.po index df2e9e0ba..d8399fa54 100644 --- a/account_credit_control_dunning_fees/i18n/fr.po +++ b/account_credit_control_dunning_fees/i18n/fr.po @@ -6,39 +6,45 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-16 07:11+0000\n" +"POT-Creation-Date: 2014-12-22 11:00+0000\n" "PO-Revision-Date: 2014-04-16 07:11+0000\n" "Last-Translator: <>\n" "Language-Team: \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" #. module: account_credit_control_dunning_fees -#: code:_description:0 #: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_line -#, python-format msgid "A credit control line" msgstr "Ligne de relance" #. module: account_credit_control_dunning_fees -#: code:_description:0 #: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_policy_level -#, python-format msgid "A credit control policy level" msgstr "Une politique de relance" #. module: account_credit_control_dunning_fees -#: code:_description:0 +#: field:credit.control.dunning.fees.computer,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: field:credit.control.dunning.fees.computer,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_credit_control_dunning_fees #: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_run -#, python-format msgid "Credit control line generator" msgstr "Générateur de relance" #. module: account_credit_control_dunning_fees #: field:credit.control.line,dunning_fees_amount:0 -#: view:credit.control.policy:0 +#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy +#: view:website:account_credit_control.report_credit_control_summary_document msgid "Fees" msgstr "Frais de relance" @@ -63,18 +69,26 @@ msgid "Fixed" msgstr "Fixe" #. module: account_credit_control_dunning_fees -#: view:credit.control.policy:0 +#: field:credit.control.dunning.fees.computer,id:0 +msgid "ID" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: field:credit.control.dunning.fees.computer,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: field:credit.control.dunning.fees.computer,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_credit_control_dunning_fees +#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy msgid "Mail and reporting" msgstr "Lettres et e-mails" -#. module: account_credit_control_dunning_fees -#: code:_description:0 -#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_dunning_fees_computer -#, python-format -msgid "credit.control.dunning.fees.computer" -msgstr "credit.control.dunning.fees.computer" - #. module: account_credit_control_dunning_fees #: field:credit.control.policy.level,dunning_fees_type:0 -msgid "unknown" -msgstr "inconnu" +msgid "Type" +msgstr "Type" 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/credit_control_summary.html.mako b/account_credit_control_dunning_fees/report/credit_control_summary.html.mako deleted file mode 100644 index 985a93403..000000000 --- a/account_credit_control_dunning_fees/report/credit_control_summary.html.mako +++ /dev/null @@ -1,246 +0,0 @@ -## -*- coding: utf-8 -*- - - - - - - - %for comm in objects : - <% setLang(comm.get_contact_address().lang) %> -
- - <% - add = comm.get_contact_address() - %> - %if comm.partner_id.id == add.id: - - <% address_lines = comm.partner_id.contact_address.split("\n") %> - - %else: - - - <% address_lines = add.contact_address.split("\n")[1:] %> - %endif - %for part in address_lines: - %if part: - - %endif - %endfor -
${comm.partner_id.title and comm.partner_id.title.name or ''} ${comm.partner_id.name }
${comm.partner_id.name or ''}
${add.title and add.title.name or ''} ${add.name}
${part}
-
-
-
-
- -
-
-
-
-
- -

- ${_('Reminder')}: ${comm.current_policy_level.name or '' } -

- -

${_('Dear')},

-

${comm.current_policy_level.custom_text.replace('\n', '
')}

- -
-
-

${_('Summary')}

- - - - - - - - - - - -%for line in comm.credit_control_line_ids: - - %if line.invoice_id: - - %else: - - %endif - - - - - - - -%endfor -
${_('Invoice number')}${_('Invoice date')}${_('Date due')}${_('Invoiced amount')}${_('Open amount')}${_('Fees')}${_('Currency')}
${line.invoice_id.number} - %if line.invoice_id.name: -
- ${line.invoice_id.name} - %endif -
${line.move_line_id.name}${line.date_entry}${line.date_due}${line.amount_due}${line.balance_due}${line.dunning_fees_amount}${line.currency_id.name or comm.company_id.currency_id.name}
-
-
-<%doc> - -

${_('If you have any question, do not hesitate to contact us.')}

- -

${comm.user_id.name} ${comm.user_id.email and '<%s>'%(comm.user_id.email) or ''}
- ${comm.company_id.name}
- % if comm.company_id.street: - ${comm.company_id.street or ''}
- - % endif - - % if comm.company_id.street2: - ${comm.company_id.street2}
- % endif - % if comm.company_id.city or comm.company_id.zip: - ${comm.company_id.zip or ''} ${comm.company_id.city or ''}
- % endif - % if comm.company_id.country_id: - ${comm.company_id.state_id and ('%s, ' % comm.company_id.state_id.name) or ''} ${comm.company_id.country_id.name or ''}
- % endif - % if comm.company_id.phone: - Phone: ${comm.company_id.phone}
- % endif - % if comm.company_id.website: - ${comm.company_id.website or ''}
- % endif - - -

- %endfor - - - 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 @@ diff --git a/account_credit_control_dunning_fees/tests/test_fees_generation.py b/account_credit_control_dunning_fees/tests/test_fees_generation.py index a00fae867..924451409 100644 --- a/account_credit_control_dunning_fees/tests/test_fees_generation.py +++ b/account_credit_control_dunning_fees/tests/test_fees_generation.py @@ -21,8 +21,6 @@ from openerp.tests import common -@common.at_install(True) -@common.post_install(True) class FixedFeesTester(common.TransactionCase): def setUp(self):