From e090638869e3a935456984993f42e0f0babb2885 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:46:03 +0200 Subject: [PATCH 1/5] Rename manifest files --- account_credit_control/README.rst | 65 +- account_credit_control/__init__.py | 30 +- account_credit_control/account.py | 32 - account_credit_control/account_view.xml | 45 - account_credit_control/company.py | 37 - account_credit_control/company_view.xml | 15 - .../credit_control_demo.xml | 30 - account_credit_control/data.xml | 230 ----- account_credit_control/data/data.xml | 224 +++++ account_credit_control/i18n/fr.po | 890 ++++++++++-------- account_credit_control/line_view.xml | 171 ---- account_credit_control/mail.py | 29 - .../migrations/0.3/post-migration.py | 26 - account_credit_control/models/__init__.py | 11 + .../models/account_account.py | 16 + .../{invoice.py => models/account_invoice.py} | 27 +- .../credit_control_line.py} | 44 +- .../credit_control_policy.py} | 83 +- .../{run.py => models/credit_control_run.py} | 55 +- account_credit_control/models/mail_mail.py | 13 + account_credit_control/models/res_company.py | 21 + .../{partner.py => models/res_partner.py} | 36 +- account_credit_control/partner_view.xml | 24 - account_credit_control/policy_view.xml | 131 --- account_credit_control/report/report.xml | 25 +- .../report/report_credit_control_summary.xml | 185 ++-- account_credit_control/run_view.xml | 75 -- .../security/ir.model.access.csv | 40 +- .../security/res_groups.xml | 25 + account_credit_control/tests/__init__.py | 7 + .../tests/test_account_invoice.py | 111 +++ .../tests/test_credit_control_policy.py | 89 ++ .../tests/test_credit_control_run.py | 155 +++ .../tests/test_res_partner.py | 37 + .../views/account_invoice.xml | 44 + .../views/credit_control_line.xml | 171 ++++ .../views/credit_control_policy.xml | 133 +++ .../views/credit_control_run.xml | 74 ++ account_credit_control/views/res_company.xml | 14 + account_credit_control/views/res_partner.xml | 23 + account_credit_control/wizard/__init__.py | 20 - .../wizard/credit_control_communication.py | 56 +- .../wizard/credit_control_emailer.py | 27 +- .../wizard/credit_control_emailer_view.xml | 84 +- .../wizard/credit_control_marker.py | 31 +- .../wizard/credit_control_marker_view.xml | 91 +- .../wizard/credit_control_policy_changer.py | 43 +- .../credit_control_policy_changer_view.xml | 93 +- .../wizard/credit_control_printer.py | 27 +- .../wizard/credit_control_printer_view.xml | 70 +- 50 files changed, 2165 insertions(+), 1870 deletions(-) delete mode 100644 account_credit_control/account.py delete mode 100644 account_credit_control/account_view.xml delete mode 100644 account_credit_control/company.py delete mode 100644 account_credit_control/company_view.xml delete mode 100644 account_credit_control/credit_control_demo.xml delete mode 100644 account_credit_control/data.xml create mode 100644 account_credit_control/data/data.xml delete mode 100644 account_credit_control/line_view.xml delete mode 100644 account_credit_control/mail.py delete mode 100644 account_credit_control/migrations/0.3/post-migration.py create mode 100644 account_credit_control/models/__init__.py create mode 100644 account_credit_control/models/account_account.py rename account_credit_control/{invoice.py => models/account_invoice.py} (66%) rename account_credit_control/{line.py => models/credit_control_line.py} (86%) rename account_credit_control/{policy.py => models/credit_control_policy.py} (85%) rename account_credit_control/{run.py => models/credit_control_run.py} (71%) create mode 100644 account_credit_control/models/mail_mail.py create mode 100644 account_credit_control/models/res_company.py rename account_credit_control/{partner.py => models/res_partner.py} (53%) delete mode 100644 account_credit_control/partner_view.xml delete mode 100644 account_credit_control/policy_view.xml delete mode 100644 account_credit_control/run_view.xml create mode 100644 account_credit_control/security/res_groups.xml create mode 100644 account_credit_control/tests/__init__.py create mode 100644 account_credit_control/tests/test_account_invoice.py create mode 100644 account_credit_control/tests/test_credit_control_policy.py create mode 100644 account_credit_control/tests/test_credit_control_run.py create mode 100644 account_credit_control/tests/test_res_partner.py create mode 100644 account_credit_control/views/account_invoice.xml create mode 100644 account_credit_control/views/credit_control_line.xml create mode 100644 account_credit_control/views/credit_control_policy.xml create mode 100644 account_credit_control/views/credit_control_run.xml create mode 100644 account_credit_control/views/res_company.xml create mode 100644 account_credit_control/views/res_partner.xml diff --git a/account_credit_control/README.rst b/account_credit_control/README.rst index 4294fdb56..6b3b93c80 100644 --- a/account_credit_control/README.rst +++ b/account_credit_control/README.rst @@ -1,11 +1,21 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============== Credit Control ============== +Installation +============ + +Just install it + Configuration -------------- +============= Configure the policies and policy levels in ``Accounting > Configuration > -Credit Control > Credit Policies``. +Credit Control > Credit Control Policies``. You can define as many policy levels as you need. Configure a tolerance for the Credit control and a default policy @@ -14,16 +24,59 @@ applied on all partners in each company, under the Accounting tab. You are able to specify a particular policy for one partner or one invoice. Usage ------ +===== -Menu entries are located in ``Accounting > Periodical Processing > Credit -Control``. +Menu entries are located in ``Accounting > Adviser > Credit Control``. Create a new "run" in the ``Credit Control Run`` menu with the controlling date. -Then, use the ``Compute credit lines`` button. All the credit control lines will +Then, use the ``Compute Credit Lines`` button. All the credit control lines will be generated. You can find them in the ``Credit Control Lines`` menu. On each generated line, you have many choices: * Send a email * Print a letter * Change the state (so you can ignore or reopen lines) + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/92/10.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Nicolas Bessi (Camptocamp) +* Guewen Baconnier (Camptocamp) +* Sylvain Van Hoof (Okia SPRL) +* Akim Juillerat (Camptocamp + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/account_credit_control/__init__.py b/account_credit_control/__init__.py index 531c9f6d3..7b23af6a9 100644 --- a/account_credit_control/__init__.py +++ b/account_credit_control/__init__.py @@ -1,29 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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 mail -from . import run -from . import line -from . import account -from . import partner -from . import policy -from . import company +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import models from . import wizard -from . import invoice diff --git a/account_credit_control/account.py b/account_credit_control/account.py deleted file mode 100644 index de4758c5f..000000000 --- a/account_credit_control/account.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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, fields - - -class AccountAccount(models.Model): - """ Add a link to a credit control policy on account.account """ - - _inherit = "account.account" - - credit_control_line_ids = fields.One2many('credit.control.line', - 'account_id', - string='Credit Lines', - readonly=True) diff --git a/account_credit_control/account_view.xml b/account_credit_control/account_view.xml deleted file mode 100644 index 5873e8ce3..000000000 --- a/account_credit_control/account_view.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - invoice.followup.form.view - account.invoice - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/account_credit_control/company.py b/account_credit_control/company.py deleted file mode 100644 index 8deb708fa..000000000 --- a/account_credit_control/company.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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, fields - - -class ResCompany(models.Model): - """ Add credit control parameters """ - _inherit = 'res.company' - - credit_control_tolerance = fields.Float(string='Credit Control Tolerance', - default=0.1) - # This is not a property on the partner because we cannot search - # on fields.property (subclass fields.function). - credit_policy_id = fields.Many2one('credit.control.policy', - string='Credit Control Policy', - help="The Credit Control Policy used " - "on partners by default. " - "This setting can be overridden" - " on partners or invoices.") diff --git a/account_credit_control/company_view.xml b/account_credit_control/company_view.xml deleted file mode 100644 index feb50c0d5..000000000 --- a/account_credit_control/company_view.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - credit.control.company.form - res.company - - - - - - - - - - diff --git a/account_credit_control/credit_control_demo.xml b/account_credit_control/credit_control_demo.xml deleted file mode 100644 index 107e26628..000000000 --- a/account_credit_control/credit_control_demo.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - X11002-a - B2B Debtors - (test) - - receivable - - - - - - X11002-b - B2C Debtors - (test) - - receivable - - - - - - X11002-c - New Debtors - (test) - - receivable - - - - - diff --git a/account_credit_control/data.xml b/account_credit_control/data.xml deleted file mode 100644 index 95ca87372..000000000 --- a/account_credit_control/data.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Credit Control Email - noreply@localhost - Credit Control: (${object.current_policy_level.name or 'n/a'}) - ${object.get_email() or ''} - - - ${object.get_contact_address().lang or 'en_US'} - - -
- ${object.current_policy_level.custom_mail_text | safe} - ]]>
-
- - - - No follow - - - - - - No follow - - net_days - - - - email - Manual no follow - - Manual no follow - - - - - 3 time policy - - - - 10 days net - - net_days - - - - email - Our records indicate that we have not received the payment of the above mentioned invoice. -If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days. - -Thank you in advance for your anticipated cooperation in this matter. - -Best regards - - - -
- If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
-
- Thank you in advance for your anticipated cooperation in this matter.
-
- Best regards - ]]>
-
- - - 30 days end of month - - end_of_month - - - - email - Our records indicate that we have not yet received the payment of the above mentioned invoice despite our first reminder. - If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days. - -Thank you in advance for your anticipated cooperation in this matter. - -Best regards - - - If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.
-
- Thank you in advance for your anticipated cooperation in this matter.
-
- Best regards - ]]>
-
- - - 10 days last reminder - - previous_date - - - - letter - - Our records indicate that we still have not received the payment of the above mentioned invoice despite our two reminders. - If payment have already been sent, please disregard this notice. If not, please proceed with payment. - If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency. - - Should you need us to arrange a payment plan for you, please advise. - A customer account statement is enclosed for you convenience. - - Thank you in advance for your anticipated cooperation in this matter. - - Best regards - - - - If payment have already been sent, please disregard this notice. If not, please proceed with payment.
- If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.
-
- Should you need us to arrange a payment plan for you, please advise.
- A customer account statement is enclosed for you convenience.
-
- Thank you in advance for your anticipated cooperation in this matter.
-
- Best regards - ]]>
-
- - - - 2 time policy - - - - 30 days end of month - - end_of_month - - - - email - Our records indicate that we have not received the payment of the above mentioned invoice. - If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days. - - Thank you in advance for your anticipated cooperation in this matter. - - Best regards - - - If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
-
- Thank you in advance for your anticipated cooperation in this matter.
-
- Best regards - ]]>
-
- - - 60 days last reminder - - previous_date - - - - letter - Our records indicate that we still have not received the payment of the above mentioned invoice despite our reminder. - - If payment have already been sent, please disregard this notice. If not, please proceed with payment. - If your payment has not been received in the next 5 days, your file will be transfered to our debt - collection agency. - - Should you need us to arrange a payment plan for you, please advise. - A customer account statement is enclosed for you convenience. - - Thank you in advance for your anticipated cooperation in this matter. - - Best regards - - -
- If payment have already been sent, please disregard this notice. If not, please proceed with payment.
- If your payment has not been received in the next 5 days, your file will be transfered to our debt
- collection agency.
-
- Should you need us to arrange a payment plan for you, please advise.
- A customer account statement is enclosed for you convenience.
-
- Thank you in advance for your anticipated cooperation in this matter.
-
- Best regards - ]]>
-
- - - Credit Control Manager - - - - - Credit Control User - - - - - Credit Control Info - - - - - - - -
-
diff --git a/account_credit_control/data/data.xml b/account_credit_control/data/data.xml new file mode 100644 index 000000000..79a44ce25 --- /dev/null +++ b/account_credit_control/data/data.xml @@ -0,0 +1,224 @@ + + + + + Credit Control Email + ${object.partner_id.company_id.email or ''} + Credit Control: + (${object.current_policy_level.name or 'n/a'}) + + ${object.get_email() or ''} + + + + ${object.get_contact_address().lang or 'en_US'} + + + +
+ ${object.current_policy_level.custom_mail_text | safe} + ]]>
+
+ + + + No follow + + + + + + No follow + + net_days + + + + email + Manual no follow + + Manual no follow + + + + + 3 time policy + + + + 10 days net + + net_days + + + + email + Our records indicate that we have not received the payment of the invoice mentioned below. + If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days. + + Thank you in advance for your anticipated cooperation in this matter. + + Best regards + + + +
+ If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
+
+ Thank you in advance for your anticipated cooperation in this matter.
+
+ Best regards + ]]>
+
+ + + 30 days end of month + + end_of_month + + + + email + Our records indicate that we have not yet received the payment of the invoice mentioned below despite our first reminder. + If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days. + + Thank you in advance for your anticipated cooperation in this matter. + + Best regards + + + If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.
+
+ Thank you in advance for your anticipated cooperation in this matter.
+
+ Best regards + ]]>
+
+ + + 10 days last reminder + + previous_date + + + + letter + + Our records indicate that we still have not received the payment of the invoice mentioned below despite our two reminders. + If payment have already been sent, please disregard this notice. If not, please proceed with payment. + If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency. + + Should you need us to arrange a payment plan for you, please advise. + A customer account statement is enclosed for you convenience. + + Thank you in advance for your anticipated cooperation in this matter. + + Best regards + + + + If payment have already been sent, please disregard this notice. If not, please proceed with payment.
+ If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.
+
+ Should you need us to arrange a payment plan for you, please advise.
+ A customer account statement is enclosed for you convenience.
+
+ Thank you in advance for your anticipated cooperation in this matter.
+
+ Best regards + ]]>
+
+ + + + 2 time policy + + + + 30 days end of month + + end_of_month + + + + email + Our records indicate that we have not received the payment of the invoice mentioned below. + If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days. + + Thank you in advance for your anticipated cooperation in this matter. + + Best regards + + + If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
+
+ Thank you in advance for your anticipated cooperation in this matter.
+
+ Best regards + ]]>
+
+ + + 60 days last reminder + + previous_date + + + + letter + Our records indicate that we still have not received the payment of the mentioned below invoice despite our reminder. + + If payment have already been sent, please disregard this notice. If not, please proceed with payment. + If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency. + + Should you need us to arrange a payment plan for you, please advise. + A customer account statement is enclosed for you convenience. + + Thank you in advance for your anticipated cooperation in this matter. + + Best regards + + +
+ If payment have already been sent, please disregard this notice. If not, please proceed with payment.
+ If your payment has not been received in the next 5 days, your file will be transfered to our debt
+ collection agency.
+
+ Should you need us to arrange a payment plan for you, please advise.
+ A customer account statement is enclosed for you convenience.
+
+ Thank you in advance for your anticipated cooperation in this matter.
+
+ Best regards + ]]>
+
+ + + + + + +
diff --git a/account_credit_control/i18n/fr.po b/account_credit_control/i18n/fr.po index bda51621f..19512d8a3 100644 --- a/account_credit_control/i18n/fr.po +++ b/account_credit_control/i18n/fr.po @@ -1,42 +1,57 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_credit_control -# -# Translators: -# Christophe kryskool , 2015 +# * account_credit_control +# msgid "" msgstr "" -"Project-Id-Version: account-financial-tools (8.0)\n" +"Project-Id-Version: Odoo Server 10.0+e\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-03 22:27+0000\n" -"PO-Revision-Date: 2015-09-29 08:56+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/fr/)\n" +"POT-Creation-Date: 2017-03-16 12:32+0000\n" +"PO-Revision-Date: 2017-03-16 13:46+0100\n" +"Last-Translator: <>\n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: fr\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"Language: fr_BE\n" +"X-Generator: Poedit 1.8.8\n" #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.3_time_3 msgid "" "\n" -" Our records indicate that we still have not received the payment of the above mentioned invoice despite our two reminders.\n" -" If payment have already been sent, please disregard this notice. If not, please proceed with payment.\n" -" If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.\n" +" Our records indicate that we still have not received the\n" +" payment of the above mentioned invoice despite our two\n" +" reminders.\n" +" If payment have already been sent, please disregard this\n" +" notice. If not, please proceed with payment.\n" +" If your payment has not been received in the next 5 days, your\n" +" file will be transfered to our debt collection agency.\n" "\n" -" Should you need us to arrange a payment plan for you, please advise.\n" -" A customer account statement is enclosed for you convenience.\n" +" Should you need us to arrange a payment plan for you, please\n" +" advise.\n" +" A customer account statement is enclosed for you convenience.\n" "\n" -" Thank you in advance for your anticipated cooperation in this matter.\n" +" Thank you in advance for your anticipated cooperation in this\n" +" matter.\n" "\n" -" Best regards\n" +" Best regards\n" +" " +msgstr "" +"\n" +"Notre comptabilité nous indique que vous avez encore des factures ouvertes malgré nos précédents rappels.\n" +" Si ce courrier à croisé votre paiement veuillez le considérer comme nul et non avenu.\n" +" Si le paiement n'est pas effectué dans les 5 jours votre dossier sera transféré à une société de recouvrement.\n" +"\n" +" Si vous désirez un accord de payment n'hésitez pas à nous contacter advise.\n" +" Un décompte est disponible ci-joint.\n" +"\n" +" En vous remerciant de votre coopération \n" " " -msgstr "\nNotre comptabilité nous indique que vous avez encore des factures ouvertes malgré nos précédents rappels.\n Si ce courrier à croisé votre paiement veuillez le considérer comme nul et non avenu.\n Si le paiement n'est pas effectué dans les 5 jours votre dossier sera transféré à une société de recouvrement.\n\n Si vous désirez un accord de payment n'hésitez pas à nous contacter advise.\n Un décompte est disponible ci-joint.\n\n En vous remerciant de votre coopération \n " #. module: account_credit_control -#: model:email.template,body_html:account_credit_control.email_template_credit_control_base +#: model:mail.template,body_html:account_credit_control.email_template_credit_control_base msgid "" "\n" " Dear ${object.contact_address.name or ''}\n" @@ -45,6 +60,12 @@ msgid "" " ${object.current_policy_level.custom_mail_text | safe}\n" " " msgstr "" +"\n" +" Dear ${object.contact_address.name or ''}\n" +"
\n" +"
\n" +" ${object.current_policy_level.custom_mail_text | safe}\n" +" " #. module: account_credit_control #: model:credit.control.policy.level,name:account_credit_control.3_time_3 @@ -68,67 +89,14 @@ msgid "60 days last reminder" msgstr "Dernier rappel à 60 jours" #. module: account_credit_control -#: model:credit.control.policy.level,custom_mail_text:account_credit_control.no_follow_1 -msgid "

Manual no follow

" -msgstr "" +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document +msgid "Total Due" +msgstr "Total dû" #. module: account_credit_control -#: model:credit.control.policy.level,custom_mail_text:account_credit_control.2_time_1 -msgid "" -"

Our records indicate that we have not received the payment of the invoices mentioned in the attached document.
\n" -" If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.

\n" -" Thank you in advance for your anticipated cooperation in this matter.

\n" -" Best regards\n" -"

" -msgstr "" - -#. module: account_credit_control -#: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_1 -msgid "" -"

Our records indicate that we have not received the payment of the invoices mentioned in the attached document.

\n" -" If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.

\n" -" Thank you in advance for your anticipated cooperation in this matter.

\n" -" Best regards\n" -"

" -msgstr "" - -#. module: account_credit_control -#: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_2 -msgid "" -"

Our records indicate that we have not yet received the payment of the invoices mentioned in the attached document despite our first reminder.
\n" -" If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.

\n" -" Thank you in advance for your anticipated cooperation in this matter.

\n" -" Best regards\n" -"

" -msgstr "" - -#. module: account_credit_control -#: model:credit.control.policy.level,custom_mail_text:account_credit_control.2_time_2 -msgid "" -"

Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our reminder.\n" -"

\n" -" If payment have already been sent, please disregard this notice. If not, please proceed with payment.
\n" -" If your payment has not been received in the next 5 days, your file will be transfered to our debt
\n" -" collection agency.

\n" -" Should you need us to arrange a payment plan for you, please advise.
\n" -" A customer account statement is enclosed for you convenience.

\n" -" Thank you in advance for your anticipated cooperation in this matter.

\n" -" Best regards\n" -"

" -msgstr "" - -#. module: account_credit_control -#: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_3 -msgid "" -"

Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our two reminders.
\n" -" If payment have already been sent, please disregard this notice. If not, please proceed with payment.
\n" -" If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.

\n" -" Should you need us to arrange a payment plan for you, please advise.
\n" -" A customer account statement is enclosed for you convenience.

\n" -" Thank you in advance for your anticipated cooperation in this matter.

\n" -" Best regards\n" -"

" -msgstr "" +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document +msgid "Total Invoiced" +msgstr "Total facturé" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_credit_control_line @@ -136,7 +104,7 @@ msgid "A credit control line" msgstr "Ligne de relance" #. module: account_credit_control -#: code:addons/account_credit_control/run.py:93 +#: code:addons/account_credit_control/models/credit_control_run.py:94 #, python-format msgid "A credit control line more recent than %s exists at %s" msgstr "Une ligne plus récente que %s existe au %s" @@ -147,33 +115,32 @@ msgid "A credit control policy level" msgstr "Une politique de relance" #. module: account_credit_control -#: code:addons/account_credit_control/run.py:161 +#: code:addons/account_credit_control/models/credit_control_run.py:160 #, python-format -msgid "" -"A credit control run is already running in background, please try later." +msgid "A credit control run is already running in background, please try later." msgstr "Un contrôle de relance est déjà en train de tourner en arrière-plan, merci d'essayer à nouveau plus tard." #. module: account_credit_control -#: code:addons/account_credit_control/run.py:86 +#: code:addons/account_credit_control/models/credit_control_run.py:87 #, python-format msgid "A run has already been executed more recently than %s" msgstr "Un contrôle a déjà été exécuté plus récemment que le %s " #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: field:credit.control.line,account_id:0 #: model:ir.model,name:account_credit_control.model_account_account +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_account_id +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Account" msgstr "Compte" #. module: account_credit_control -#: view:credit.control.policy:account_credit_control.credit_control_policy_form -#: field:credit.control.policy,account_ids:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_account_ids +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form msgid "Accounts" msgstr "Comptes" #. module: account_credit_control -#: field:credit.control.policy,active:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_active msgid "Active" msgstr "Actif" @@ -183,28 +150,28 @@ msgid "Allows to manually change credit level" msgstr "Permet de changer manuellement le niveau de relance" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "An error has occured during the sending of the email." msgstr "Erreur lors de la génération des mails." #. module: account_credit_control -#: code:addons/account_credit_control/policy.py:308 +#: code:addons/account_credit_control/models/credit_control_policy.py:306 #, python-format msgid "Can not get function for computation mode: %s is not implemented" msgstr "Impossible de trouver une fonction pour le mode de calcul: %s n'est pas implémentée" #. module: account_credit_control -#: view:credit.control.emailer:account_credit_control.credit_line_emailer_form -#: view:credit.control.marker:account_credit_control.credit_line_marker_form -#: view:credit.control.policy.changer:account_credit_control.credit_control_policy_changer_form -#: view:credit.control.printer:account_credit_control.credit_line_printer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Cancel" msgstr "Annuler" #. module: account_credit_control -#: view:credit.control.marker:account_credit_control.credit_line_marker_form #: model:ir.actions.act_window,name:account_credit_control.open_credit_line_marker_wizard #: model:ir.actions.act_window,name:account_credit_control.open_credit_line_marker_wizard_menu_action +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Change Lines' State" msgstr "Modifier le statut des lignes" @@ -215,12 +182,12 @@ msgid "Change current credit policy" msgstr "Changer la politique de relance courante" #. module: account_credit_control -#: view:credit.control.policy.changer:account_credit_control.credit_control_policy_changer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form msgid "Change the overdue level of current invoice" msgstr "Changer le niveau de relance de la facture courante" #. module: account_credit_control -#: view:credit.control.marker:account_credit_control.credit_line_marker_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Change the state of the selected lines" msgstr "Modifier l'état des lignes sélectionnées." @@ -230,110 +197,101 @@ msgid "Change the state of the selected lines." msgstr "Modifier l'état des lignes sélectionnées." #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: field:credit.control.line,channel:0 -#: field:credit.control.policy.level,channel:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_channel +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_channel +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Channel" msgstr "Canal" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_res_company msgid "Companies" -msgstr "Société" +msgstr "Sociétés" #. module: account_credit_control -#: field:credit.control.communication,company_id:0 -#: field:credit.control.line,company_id:0 -#: field:credit.control.policy,company_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_company_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_company_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_company_id msgid "Company" msgstr "Société" #. module: account_credit_control -#: view:credit.control.run:account_credit_control.credit_control_run_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Compute Credit Control Lines" msgstr "Calculer les relances" #. module: account_credit_control -#: field:credit.control.policy.level,computation_mode:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_computation_mode msgid "Compute Mode" msgstr "Mode de calcul" #. module: account_credit_control -#: field:credit.control.communication,contact_address:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_contact_address msgid "Contact Address" msgstr "Adresse de contact" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_form -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: view:credit.control.line:account_credit_control.credit_control_line_tree +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_tree msgid "Control Credit Lines" msgstr "Lignes de relance" #. module: account_credit_control -#: field:credit.control.run,date:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_date msgid "Controlling Date" msgstr "Date de contrôle" #. module: account_credit_control -#: field:credit.control.line,date:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date msgid "Controlling date" msgstr "Date de relance" #. module: account_credit_control -#: field:credit.control.communication,create_uid:0 -#: field:credit.control.emailer,create_uid:0 -#: field:credit.control.line,create_uid:0 -#: field:credit.control.marker,create_uid:0 -#: field:credit.control.policy,create_uid:0 -#: field:credit.control.policy.changer,create_uid:0 -#: field:credit.control.policy.level,create_uid:0 -#: field:credit.control.printer,create_uid:0 -#: field:credit.control.run,create_uid:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_create_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_create_uid msgid "Created by" msgstr "Créé par" #. module: account_credit_control -#: field:credit.control.communication,create_date:0 -#: field:credit.control.emailer,create_date:0 -#: field:credit.control.line,create_date:0 -#: field:credit.control.marker,create_date:0 -#: field:credit.control.policy,create_date:0 -#: field:credit.control.policy.changer,create_date:0 -#: field:credit.control.policy.level,create_date:0 -#: field:credit.control.printer,create_date:0 -#: field:credit.control.run,create_date:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_create_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_create_date msgid "Created on" msgstr "Créé le" #. module: account_credit_control -#: view:account.invoice:account_credit_control.invoice_followup_form_view +#: model:ir.module.category,name:account_credit_control.category_credit_control #: model:ir.ui.menu,name:account_credit_control.base_credit_control_configuration_menu #: model:ir.ui.menu,name:account_credit_control.base_credit_control_menu +#: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Credit Control" msgstr "Relances Clients" #. module: account_credit_control -#: model:res.groups,name:account_credit_control.group_account_credit_control_info -msgid "Credit Control Info" -msgstr "Informations de rappel" - -#. module: account_credit_control -#: view:account.invoice:account_credit_control.invoice_followup_form_view -#: field:credit.control.emailer,line_ids:0 -#: field:credit.control.marker,line_ids:0 -#: field:credit.control.printer,line_ids:0 #: model:ir.actions.act_window,name:account_credit_control.credit_control_line_action +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_line_ids +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_line_ids +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_line_ids +#: model:ir.model.fields,field_description:account_credit_control.field_res_partner_credit_control_line_ids #: model:ir.ui.menu,name:account_credit_control.credit_control_line_action_menu -#: field:res.partner,credit_control_line_ids:0 +#: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Credit Control Lines" msgstr "Lignes de relance" -#. module: account_credit_control -#: model:res.groups,name:account_credit_control.group_account_credit_control_manager -msgid "Credit Control Manager" -msgstr "Responsable Relance client" - #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.credit_policy_configuration_action #: model:ir.ui.menu,name:account_credit_control.credit_policy_configuration_action_menu @@ -341,8 +299,9 @@ msgid "Credit Control Policies" msgstr "Politique de relance" #. module: account_credit_control -#: field:account.invoice,credit_policy_id:0 -#: field:res.company,credit_policy_id:0 field:res.partner,credit_policy_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_account_invoice_credit_policy_id +#: model:ir.model.fields,field_description:account_credit_control.field_res_company_credit_policy_id +#: model:ir.model.fields,field_description:account_credit_control.field_res_partner_credit_policy_id msgid "Credit Control Policy" msgstr "Politique de relance" @@ -358,26 +317,24 @@ msgid "Credit Control Summary" msgstr "Résumé des relances" #. module: account_credit_control -#: field:res.company,credit_control_tolerance:0 +#: model:ir.model.fields,field_description:account_credit_control.field_res_company_credit_control_tolerance msgid "Credit Control Tolerance" msgstr "Pas de relance inférieure à : " #. module: account_credit_control -#: model:res.groups,name:account_credit_control.group_account_credit_control_user -msgid "Credit Control User" -msgstr "Utilisateur du module de relance" - -#. module: account_credit_control -#: model:email.template,subject:account_credit_control.email_template_credit_control_base -msgid "Credit Control: (${object.current_policy_level.name or 'n/a'})" +#: model:mail.template,subject:account_credit_control.email_template_credit_control_base +msgid "" +"Credit Control:\n" +" (${object.current_policy_level.name or 'n/a'})\n" +" " msgstr "Rappel: (${object.current_policy_level.name or 'n/a'})" #. module: account_credit_control -#: field:account.account,credit_control_line_ids:0 -#: field:account.invoice,credit_control_line_ids:0 -#: field:credit.control.communication,credit_control_line_ids:0 #: model:ir.actions.act_window,name:account_credit_control.act_account_credit_relation_relation #: model:ir.actions.act_window,name:account_credit_control.act_partner_credit_relation_relation +#: model:ir.model.fields,field_description:account_credit_control.field_account_account_credit_control_line_ids +#: model:ir.model.fields,field_description:account_credit_control.field_account_invoice_credit_control_line_ids +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_credit_control_line_ids msgid "Credit Lines" msgstr "Lignes de relance" @@ -387,55 +344,55 @@ msgid "Credit control line generator" msgstr "Générateur de relance" #. module: account_credit_control -#: view:credit.control.policy:account_credit_control.credit_control_policy_form -#: view:credit.control.policy:account_credit_control.credit_control_policy_tree +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_tree msgid "Credit control policy" msgstr "Niveau de relance" #. module: account_credit_control -#: view:credit.control.policy:account_credit_control.credit_control_policy_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form msgid "Credit control policy Level" msgstr "Niveau de relance" #. module: account_credit_control -#: view:credit.control.policy.level:account_credit_control.credit_control_policy_level_tree +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_level_tree msgid "Credit control policy level" msgstr "Niveau de relance" #. module: account_credit_control -#: view:credit.control.run:account_credit_control.credit_control_run_form -#: view:credit.control.run:account_credit_control.credit_control_run_tree +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_tree msgid "Credit control run" msgstr "Passe de contrôle de relance" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Credit policy" msgstr "Politique de relance" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Credit policy level" msgstr "Niveau de relance" #. module: account_credit_control -#: field:credit.control.communication,currency_id:0 -#: field:credit.control.line,currency_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_currency_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_currency_id msgid "Currency" msgstr "Devise" #. module: account_credit_control -#: field:credit.control.policy.level,custom_mail_text:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_custom_mail_text msgid "Custom Mail Message" msgstr "Email personnalisé" #. module: account_credit_control -#: field:credit.control.policy.level,custom_text:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_custom_text msgid "Custom Message" msgstr "Message personnalisable" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Date due" msgstr "Date d'échéance" @@ -445,48 +402,64 @@ msgid "Define a reminder policy" msgstr "Définir une politique de relance" #. module: account_credit_control -#: field:credit.control.policy.level,delay_days:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_delay_days msgid "Delay (in days)" msgstr "Retard (en jours)" #. module: account_credit_control -#: view:credit.control.policy:account_credit_control.credit_control_policy_form -#: view:credit.control.policy.level:account_credit_control.credit_mangement_policy_level_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_mangement_policy_level_form msgid "Delay Setting" msgstr "Paramétrages jours de retard" #. module: account_credit_control -#: field:credit.control.policy,do_nothing:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_display_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_display_name +msgid "Display Name" +msgstr "Afficher le nom" + +#. module: account_credit_control +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_do_nothing msgid "Do nothing" msgstr "Ignorer" #. module: account_credit_control -#: selection:credit.control.line,state:0 -#: selection:credit.control.marker,name:0 selection:credit.control.run,state:0 +#: selection:credit.control.line,state:0 selection:credit.control.marker,name:0 +#: selection:credit.control.run,state:0 msgid "Done" msgstr "Fait" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search #: selection:credit.control.line,state:0 selection:credit.control.run,state:0 +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Draft" msgstr "Brouillon" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Draft lines have to be triaged." msgstr "Les lignes brouillon doivent être triées" #. module: account_credit_control -#: help:credit.control.line,state:0 +#: model:ir.model.fields,help:account_credit_control.field_credit_control_line_state msgid "" "Draft lines need to be triaged.\n" "Ignored lines are lines for which we do not want to send something.\n" "Draft and ignored lines will be generated again on the next run." -msgstr "Lignes brouillons à traiter.\nLes lignes ignorées ne seront pas traitées.\nLes lignes brouillons ou ignorées seront régénérées lors du prochain contrôle." +msgstr "" +"Lignes brouillons à traiter.\n" +"Les lignes ignorées ne seront pas traitées.\n" +"Les lignes brouillons ou ignorées seront régénérées lors du prochain contrôle." #. module: account_credit_control -#: field:credit.control.line,amount_due:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_amount_due msgid "Due Amount Tax incl." msgstr "Montant dû TTC." @@ -501,12 +474,12 @@ msgid "Due Date, End Of Month" msgstr "Date d'échéance, fin de mois" #. module: account_credit_control -#: field:credit.control.line,balance_due:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_balance_due msgid "Due balance" -msgstr "Montant total" +msgstr "Date d'échéance" #. module: account_credit_control -#: field:credit.control.line,date_due:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date_due msgid "Due date" msgstr "Date d'échéance" @@ -517,9 +490,9 @@ msgid "Email" msgstr "E-mail" #. module: account_credit_control -#: field:credit.control.policy.level,email_template_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_email_template_id msgid "Email Template" -msgstr "Modèle d'e-mail" +msgstr "Modèle de courriel" #. module: account_credit_control #: selection:credit.control.line,state:0 @@ -527,111 +500,130 @@ msgid "Emailing Error" msgstr "Erreur sur E-mail" #. module: account_credit_control -#: field:credit.control.line,date_entry:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date_entry msgid "Entry date" msgstr "Date de l'écriture" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search #: selection:credit.control.line,state:0 +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Error" msgstr "Erreur" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Filters" msgstr "Filtres" #. module: account_credit_control -#: help:credit.control.policy,do_nothing:0 +#: model:ir.model.fields,help:account_credit_control.field_credit_control_policy_do_nothing msgid "For policies which should not generate lines or are obsolete" msgstr "Pour les politiques qui ne doivent pas générer de lignes ou sont obsolètes" #. module: account_credit_control -#: field:credit.control.run,line_ids:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_line_ids msgid "Generated lines" -msgstr "Lignes générées" - -#. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search -msgid "Group By..." msgstr "Grouper Par..." #. module: account_credit_control -#: field:credit.control.communication,id:0 field:credit.control.emailer,id:0 -#: field:credit.control.line,id:0 field:credit.control.marker,id:0 -#: field:credit.control.policy,id:0 field:credit.control.policy.changer,id:0 -#: field:credit.control.policy.level,id:0 field:credit.control.printer,id:0 -#: field:credit.control.run,id:0 +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search +msgid "Group By..." +msgstr "Regrouper par..." + +#. module: account_credit_control +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_id msgid "ID" msgstr "ID" #. module: account_credit_control -#: help:credit.control.run,manual_ids:0 -msgid "" -"If a credit control line has been generatedon a policy and the policy has " -"been changed in the meantime, it has to be handled manually" +#: model:ir.model.fields,help:account_credit_control.field_credit_control_run_manual_ids +msgid "If a credit control line has been generatedon a policy and the policy has been changed in the meantime, it has to be handled manually" msgstr "Si la ligne a été générée avec une politique de relance différente elle doit être traitée manuellement" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: selection:credit.control.line,state:0 -#: selection:credit.control.marker,name:0 +#: selection:credit.control.line,state:0 selection:credit.control.marker,name:0 +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Ignored" msgstr "Ignorée" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: field:credit.control.line,invoice_id:0 +#: model:res.groups,name:account_credit_control.group_account_credit_control_info +msgid "Info" +msgstr "Info" + +#. module: account_credit_control #: model:ir.model,name:account_credit_control.model_account_invoice +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_invoice_id +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Invoice" msgstr "Facture" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Invoice date" msgstr "Date de facture" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Invoice number" msgstr "Numéro de facture" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Invoiced amount" msgstr "Total de la facture" #. module: account_credit_control -#: view:account.invoice:account_credit_control.invoice_followup_form_view +#: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Issued Lines" msgstr "Lignes de relance" #. module: account_credit_control -#: field:credit.control.communication,write_uid:0 -#: field:credit.control.emailer,write_uid:0 -#: field:credit.control.line,write_uid:0 -#: field:credit.control.marker,write_uid:0 -#: field:credit.control.policy,write_uid:0 -#: field:credit.control.policy.changer,write_uid:0 -#: field:credit.control.policy.level,write_uid:0 -#: field:credit.control.printer,write_uid:0 -#: field:credit.control.run,write_uid:0 -msgid "Last Updated by" -msgstr "Mis à jour par" +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer___last_update +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run___last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" #. module: account_credit_control -#: field:credit.control.communication,write_date:0 -#: field:credit.control.emailer,write_date:0 -#: field:credit.control.line,write_date:0 -#: field:credit.control.marker,write_date:0 -#: field:credit.control.policy,write_date:0 -#: field:credit.control.policy.changer,write_date:0 -#: field:credit.control.policy.level,write_date:0 -#: field:credit.control.printer,write_date:0 -#: field:credit.control.run,write_date:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_write_uid +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: account_credit_control +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_write_date +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_write_date msgid "Last Updated on" -msgstr "Mis à jour le" +msgstr "Dernière mise à jour le" #. module: account_credit_control #: selection:credit.control.line,channel:0 @@ -640,87 +632,93 @@ msgid "Letter" msgstr "Lettre" #. module: account_credit_control -#: field:credit.control.communication,current_policy_level:0 -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: field:credit.control.policy.level,level:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_current_policy_level +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_level +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Level" msgstr "Niveau" #. module: account_credit_control -#: view:credit.control.emailer:account_credit_control.credit_line_emailer_form -#: view:credit.control.marker:account_credit_control.credit_line_marker_form -#: view:credit.control.printer:account_credit_control.credit_line_printer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Lines" msgstr "Lignes" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Lines already sent." msgstr "Lignes déjà traitées." #. module: account_credit_control -#: view:credit.control.marker:account_credit_control.credit_line_marker_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Lines marker" msgstr "Traiter les lignes" #. module: account_credit_control -#: view:credit.control.printer:account_credit_control.credit_line_printer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Lines report" msgstr "Lignes de relance" #. module: account_credit_control -#: field:credit.control.run,manual_ids:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_manual_ids msgid "Lines to handle manually" msgstr "A traiter manuellement" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Lines which have been ignored from previous runs." msgstr "Lignes ignorées lors des relances précédentes." #. module: account_credit_control -#: view:credit.control.policy:account_credit_control.credit_control_policy_form -#: view:credit.control.policy.level:account_credit_control.credit_mangement_policy_level_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_mangement_policy_level_form msgid "Mail and reporting" msgstr "Lettres et e-mails" #. module: account_credit_control -#: view:credit.control.emailer:account_credit_control.credit_line_emailer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form msgid "Mailer" msgstr "Mailer" #. module: account_credit_control -#: view:account.invoice:account_credit_control.invoice_followup_form_view +#: model:res.groups,name:account_credit_control.group_account_credit_control_manager +msgid "Manager" +msgstr "Gestionnaire" + +#. module: account_credit_control +#: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Manual Credit Control Policy" msgstr "Politique de relance manuelle" #. module: account_credit_control -#: view:credit.control.run:account_credit_control.credit_control_run_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Manual Lines" msgstr "Lignes manuelles" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Manual change" msgstr "Changement manuel" #. module: account_credit_control +#: model:credit.control.policy.level,custom_mail_text:account_credit_control.no_follow_1 #: model:credit.control.policy.level,custom_text:account_credit_control.no_follow_1 msgid "Manual no follow" msgstr "Ne pas suivre (Manuel)" #. module: account_credit_control -#: field:credit.control.line,manually_overridden:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_manually_overridden msgid "Manually overridden" msgstr "Mise à jour manuelle" #. module: account_credit_control -#: field:credit.control.marker,name:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_name msgid "Mark as" msgstr "Marquer comme" #. module: account_credit_control -#: field:credit.control.printer,mark_as_sent:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_mark_as_sent msgid "Mark letter lines as sent" msgstr "Marquer comme traitées" @@ -740,37 +738,38 @@ msgid "Mass printer" msgstr "Imprimer en masse" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "More..." msgstr "Plus..." #. module: account_credit_control -#: field:credit.control.line,move_line_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_move_line_id msgid "Move line" msgstr "Écriture comptable" #. module: account_credit_control -#: field:credit.control.policy.changer,move_line_ids:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_move_line_ids msgid "Move line to change" msgstr "Écriture comptable à changer" #. module: account_credit_control -#: view:credit.control.policy.changer:account_credit_control.credit_control_policy_changer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form msgid "Move lines to affect" msgstr "Écriture comptable à traiter" #. module: account_credit_control -#: field:credit.control.policy,name:0 field:credit.control.policy.level,name:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_name +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_name msgid "Name" msgstr "Nom" #. module: account_credit_control -#: field:credit.control.policy.changer,new_policy_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_new_policy_id msgid "New Policy to Apply" msgstr "Nouvelle politique" #. module: account_credit_control -#: field:credit.control.policy.changer,new_policy_level_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_new_policy_level_id msgid "New level to apply" msgstr "Nouveau niveau de relance" @@ -788,7 +787,7 @@ msgid "No follow" msgstr "Pas de suivi" #. module: account_credit_control -#: field:credit.control.policy.changer,do_nothing:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_do_nothing msgid "No follow policy" msgstr "Politique sans suivi" @@ -799,135 +798,266 @@ msgid "No lines will be changed. All the selected lines are already done." msgstr "Aucune ligne ne sera modifiée. Toutes les lignes sélectionnées sont déjà terminées." #. module: account_credit_control -#: help:credit.control.printer,mark_as_sent:0 +#: model:ir.model.fields,help:account_credit_control.field_credit_control_printer_mark_as_sent msgid "Only letter lines will be marked." msgstr "Seules les relances par courrier seront traitées." #. module: account_credit_control -#: view:credit.control.run:account_credit_control.credit_control_run_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Open Credit Control Lines" msgstr "Ouvrir les lignes de relance" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Open amount" msgstr "Restant dû" #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.2_time_1 -msgid "" -"Our records indicate that we have not received the payment of the above mentioned invoice.\n" -" If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.\n" -"\n" -" Thank you in advance for your anticipated cooperation in this matter.\n" -"\n" -" Best regards\n" -" " -msgstr "Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n Si ce courrier à croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 10 jours.\n\n En vous remerciant de votre coopération.\n\nSalutations\n " - -#. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.3_time_1 msgid "" -"Our records indicate that we have not received the payment of the above mentioned invoice.\n" -"If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.\n" +"Our records indicate that we have not\n" +" received the payment of the above mentioned invoice.\n" +" If it has already been sent, please disregard this notice. If\n" +" not, please proceed with payment within 10 days.\n" "\n" -"Thank you in advance for your anticipated cooperation in this matter.\n" +" Thank you in advance for your anticipated cooperation in this\n" +" matter.\n" "\n" -"Best regards\n" +" Best regards\n" +" " +msgstr "" +"Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n" +" Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 10 jours.\n" +"\n" +" En vous remerciant de votre coopération.\n" +"\n" +"Salutations\n" +" " + +#. module: account_credit_control +#: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_1 +msgid "" +"Our records indicate that we have not received the payment of the invoices mentioned in the attached document.
\n" +"
\n" +" If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
\n" +"
\n" +" Thank you in advance for your anticipated cooperation in this matter.
\n" +"
\n" +" Best regards" +msgstr "" +"Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n" +" Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 10 jours.\n" +"\n" +" En vous remerciant de votre coopération.\n" +"\n" +"Salutations\n" +" " + +#. module: account_credit_control +#: model:credit.control.policy.level,custom_mail_text:account_credit_control.2_time_1 +msgid "" +"Our records indicate that we have not received the payment of the invoices mentioned in the attached document.
\n" +" If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
\n" +"
\n" +" Thank you in advance for your anticipated cooperation in this matter.
\n" +"
\n" +" Best regards" +msgstr "" +"Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n" +" Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 10 jours.\n" +"\n" +" En vous remerciant de votre coopération.\n" +"\n" +"Salutations\n" " " -msgstr "Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 10 jours.\n\n En vous remerciant de votre coopération.\n\nSalutations\n " #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.3_time_2 msgid "" -"Our records indicate that we have not yet received the payment of the above mentioned invoice despite our first reminder.\n" -" If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.\n" +"Our records indicate that we have not yet\n" +" received the payment of the above mentioned invoice despite our\n" +" first reminder.\n" +" If it has already been sent, please disregard this notice. If\n" +" not, please proceed with payment within 5 days.\n" "\n" -"Thank you in advance for your anticipated cooperation in this matter.\n" +" Thank you in advance for your anticipated cooperation in this\n" +" matter.\n" "\n" -"Best regards\n" +" Best regards\n" +" " +msgstr "" +"Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n" +" Si ce courrier à croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 5 jours.\n" +"\n" +" En vous remerciant de votre coopération.\n" +"\n" +"Salutations\n" +" " + +#. module: account_credit_control +#: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_2 +msgid "" +"Our records indicate that we have not yet received the payment of the invoices mentioned in the attached document despite our first reminder.
\n" +" If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.
\n" +"
\n" +" Thank you in advance for your anticipated cooperation in this matter.
\n" +"
\n" +" Best regards" +msgstr "" +"Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n" +" Si ce courrier à croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 5 jours.\n" +"\n" +" En vous remerciant de votre coopération.\n" +"\n" +"Salutations\n" " " -msgstr "Notre comptabilité nous informe que les factures ci-dessous n'ont pas été payées malgré un précédent rappel.\n Si ce courrier à croisé votre paiement veuillez le considérer comme nul et non avenu. Sinon, Merci de procéder au paiement dans les 5 jours.\n\n En vous remerciant de votre coopération.\n\nSalutations\n " #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.2_time_2 msgid "" -"Our records indicate that we still have not received the payment of the above mentioned invoice despite our reminder.\n" +"Our records indicate that we still have\n" +" not received the payment of the above mentioned invoice despite\n" +" our reminder.\n" "\n" -" If payment have already been sent, please disregard this notice. If not, please proceed with payment.\n" -" If your payment has not been received in the next 5 days, your file will be transfered to our debt\n" -" collection agency.\n" +" If payment have already been sent, please disregard this\n" +" notice. If not, please proceed with payment.\n" +" If your payment has not been received in the next 5 days, your\n" +" file will be transfered to our debt\n" +" collection agency.\n" "\n" -" Should you need us to arrange a payment plan for you, please advise.\n" -" A customer account statement is enclosed for you convenience.\n" +" Should you need us to arrange a payment plan for you, please\n" +" advise.\n" +" A customer account statement is enclosed for you convenience.\n" "\n" -" Thank you in advance for your anticipated cooperation in this matter.\n" +" Thank you in advance for your anticipated cooperation in this\n" +" matter.\n" "\n" -" Best regards\n" +" Best regards\n" +" " +msgstr "" +"Notre comptabilité nous indique que vous avez encore des factures ouvertes malgré nos précédents rappels.\n" +" Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu.\n" +" Si le paiement n'est pas effectué dans les 5 jours votre dossier sera transféré à une société de recouvrement.\n" +"\n" +" Si vous désirez un accord de paiement n'hésitez pas à nous contacter. \n" +" Un décompte est disponible ci-joint.\n" +"\n" +" En vous remerciant de votre coopération\n" +" " + +#. module: account_credit_control +#: model:credit.control.policy.level,custom_mail_text:account_credit_control.2_time_2 +msgid "" +"Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our reminder.\n" +"
\n" +"
\n" +" If payment have already been sent, please disregard this notice. If not, please proceed with payment.
\n" +" If your payment has not been received in the next 5 days, your file will be transfered to our debt
\n" +" collection agency.
\n" +"
\n" +" Should you need us to arrange a payment plan for you, please advise.
\n" +" A customer account statement is enclosed for you convenience.
\n" +"
\n" +" Thank you in advance for your anticipated cooperation in this matter.
\n" +"
\n" +" Best regards" +msgstr "" +"Notre comptabilité nous indique que vous avez encore des factures ouvertes malgré nos précédents rappels.\n" +" Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu.\n" +" Si le paiement n'est pas effectué dans les 5 jours votre dossier sera transféré à une société de recouvrement.\n" +"\n" +" Si vous désirez un accord de paiement n'hésitez pas à nous contacter. \n" +" Un décompte est disponible ci-joint.\n" +"\n" +" En vous remerciant de votre coopération\n" +" " + +#. module: account_credit_control +#: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_3 +msgid "" +"Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our two reminders.
\n" +" If payment have already been sent, please disregard this notice. If not, please proceed with payment.
\n" +" If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.
\n" +"
\n" +" Should you need us to arrange a payment plan for you, please advise.
\n" +" A customer account statement is enclosed for you convenience.
\n" +"
\n" +" Thank you in advance for your anticipated cooperation in this matter.
\n" +"
\n" +" Best regards" +msgstr "" +"Notre comptabilité nous indique que vous avez encore des factures ouvertes malgré nos précédents rappels.\n" +" Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu.\n" +" Si le paiement n'est pas effectué dans les 5 jours votre dossier sera transféré à une société de recouvrement.\n" +"\n" +" Si vous désirez un accord de paiement n'hésitez pas à nous contacter. \n" +" Un décompte est disponible ci-joint.\n" +"\n" +" En vous remerciant de votre coopération\n" " " -msgstr "Notre comptabilité nous indique que vous avez encore des factures ouvertes malgré nos précédents rappels.\n Si ce courrier a croisé votre paiement veuillez le considérer comme nul et non avenu.\n Si le paiement n'est pas effectué dans les 5 jours votre dossier sera transféré à une société de recouvrement.\n\n Si vous désirez un accord de paiement n'hésitez pas à nous contacter. \n Un décompte est disponible ci-joint.\n\n En vous remerciant de votre coopération\n " #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_mail_mail msgid "Outgoing Mails" -msgstr "Courriels envoyés" +msgstr "Courriels à envoyer" #. module: account_credit_control -#: field:credit.control.line,policy_level_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_policy_level_id msgid "Overdue Level" msgstr "Niveau de relance" #. module: account_credit_control -#: field:credit.control.communication,partner_id:0 -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: field:credit.control.line,partner_id:0 #: model:ir.model,name:account_credit_control.model_res_partner +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_partner_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_partner_id +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Partner" -msgstr "Client" +msgstr "Partenaire" #. module: account_credit_control -#: code:addons/account_credit_control/run.py:109 +#: code:addons/account_credit_control/models/credit_control_run.py:108 #, python-format msgid "Please select a policy" -msgstr "Choisissez une politique" +msgstr "Utilisez l'action sur les factures clients" #. module: account_credit_control -#: code:addons/account_credit_control/wizard/credit_control_policy_changer.py:61 +#: code:addons/account_credit_control/wizard/credit_control_policy_changer.py:60 #, python-format msgid "Please use wizard on customer invoices" msgstr "Utilisez l'action sur les factures clients" #. module: account_credit_control -#: view:credit.control.run:account_credit_control.credit_control_run_form -#: field:credit.control.run,policy_ids:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_policy_ids +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Policies" msgstr "Politiques" #. module: account_credit_control -#: code:addons/account_credit_control/run.py:132 +#: code:addons/account_credit_control/models/credit_control_run.py:131 #, python-format msgid "Policy \"%s\" has generated %d Credit Control Lines.
" msgstr "La politique de relance \"%s\" a généré %d lignes de relance.
" #. module: account_credit_control -#: code:addons/account_credit_control/run.py:136 +#: code:addons/account_credit_control/models/credit_control_run.py:135 #, python-format msgid "Policy \"%s\" has not generated any Credit Control Lines.
" msgstr "La politique de relance \"%s\" n'a pas généré de lignes de relance.
" #. module: account_credit_control -#: field:credit.control.policy,level_ids:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_ids msgid "Policy Levels" msgstr "Niveaux de relance" #. module: account_credit_control -#: view:credit.control.policy:account_credit_control.credit_control_policy_form -#: view:credit.control.policy.level:account_credit_control.credit_mangement_policy_level_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_mangement_policy_level_form msgid "Policy level" msgstr "Niveau de relance" #. module: account_credit_control -#: view:credit.control.policy:account_credit_control.credit_control_policy_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form msgid "Policy levels" msgstr "Niveaux de relance" @@ -937,7 +1067,7 @@ msgid "Previous Reminder" msgstr "Précédent rappel" #. module: account_credit_control -#: view:credit.control.printer:account_credit_control.credit_line_printer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Print" msgstr "Imprimer" @@ -953,36 +1083,35 @@ msgid "Print selected lines" msgstr "Imprimer la sélection" #. module: account_credit_control -#: view:credit.control.printer:account_credit_control.credit_line_printer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Print the selected lines" msgstr "Imprimer la sélection" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search -#: selection:credit.control.line,state:0 -#: selection:credit.control.marker,name:0 +#: selection:credit.control.line,state:0 selection:credit.control.marker,name:0 +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Ready To Send" msgstr "Prêt à l'envoi" #. module: account_credit_control -#: field:credit.control.line,policy_id:0 -#: field:credit.control.policy.level,policy_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_policy_id +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_policy_id msgid "Related Policy" msgstr "Niveau de relance" #. module: account_credit_control -#: view:credit.control.run:account_credit_control.credit_control_run_form -#: field:credit.control.run,report:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_report +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Report" msgstr "Lettre" #. module: account_credit_control -#: field:credit.control.communication,report_date:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_report_date msgid "Report Date" msgstr "Date du rapport" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Run date" msgstr "Date de relance" @@ -998,148 +1127,142 @@ msgid "Send an email for the selected lines." msgstr "Envoyer les rappels par email." #. module: account_credit_control -#: view:credit.control.emailer:account_credit_control.credit_line_emailer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form msgid "Send emails for the selected lines" msgstr "Envoyer un email depuis les lignes de relances sélectionnées" #. module: account_credit_control -#: view:credit.control.emailer:account_credit_control.credit_line_emailer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form msgid "Send the emails" msgstr "Envoyer les courriels" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Sent" -msgstr "Envoyées" +msgstr "Envoyer par email" #. module: account_credit_control -#: field:credit.control.line,mail_message_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_mail_message_id msgid "Sent Email" msgstr "Courriels envoyés" #. module: account_credit_control -#: field:credit.control.line,date_sent:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date_sent msgid "Sent date" msgstr "Date d'envoi" #. module: account_credit_control -#: view:credit.control.policy.changer:account_credit_control.credit_control_policy_changer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form msgid "Set current credit level" msgstr "Définir le niveau de relance actuel" #. module: account_credit_control -#: view:credit.control.policy.changer:account_credit_control.credit_control_policy_changer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form msgid "Set new policy" msgstr "Définir une nouvelle politique de relance" #. module: account_credit_control -#: field:credit.control.line,run_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_run_id msgid "Source" -msgstr "Source" +msgstr "Origine" #. module: account_credit_control -#: field:credit.control.line,state:0 field:credit.control.run,state:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_state +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_state msgid "State" msgstr "État" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Summary" msgstr "Listes des factures en attente de règlement" #. module: account_credit_control -#: help:account.invoice,credit_policy_id:0 -msgid "" -"The Credit Control Policy used for this invoice. If nothing is defined, it " -"will use the account setting or the partner setting." +#: model:ir.model.fields,help:account_credit_control.field_account_invoice_credit_policy_id +msgid "The Credit Control Policy used for this invoice. If nothing is defined, it will use the account setting or the partner setting." msgstr "Il s'agit de la politique de relance propre à cette facture Si vide, la politique de relance par défaut sera utilisée." #. module: account_credit_control -#: help:res.partner,credit_policy_id:0 -msgid "" -"The Credit Control Policy used for this partner. This setting can be forced " -"on the invoice. If nothing is defined, it will use the company setting." +#: model:ir.model.fields,help:account_credit_control.field_res_partner_credit_policy_id +msgid "The Credit Control Policy used for this partner. This setting can be forced on the invoice. If nothing is defined, it will use the company setting." msgstr "Politique de relance utilisée pour ce client. (Vous pouvez aussi en définir une autre au niveau d'une des factures de ce client.) Si vide, la politique par défaut (au niveau de la société) sera appliquée." #. module: account_credit_control -#: help:res.company,credit_policy_id:0 -msgid "" -"The Credit Control Policy used on partners by default. This setting can be " -"overridden on partners or invoices." +#: model:ir.model.fields,help:account_credit_control.field_res_company_credit_policy_id +msgid "The Credit Control Policy used on partners by default. This setting can be overridden on partners or invoices." msgstr "Politique de relance par défaut du client. (Ce paramétrage peut être défini plus spécifiquement au niveau de la facture)." #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "The line was deprecated by a manual change of policy on invoice." msgstr "La ligne a été remplacée par un changement manuel de politique sur la facture." #. module: account_credit_control -#: help:credit.control.line,currency_id:0 +#: model:ir.model.fields,help:account_credit_control.field_credit_control_line_currency_id msgid "The optional other currency if it is a multi-currency entry." -msgstr "Les autres devises optionnelles en cas de multi-devises." +msgstr "L'autre devise optionelle si c'est une écriture multi devise." #. module: account_credit_control -#: code:addons/account_credit_control/policy.py:258 +#: code:addons/account_credit_control/models/credit_control_policy.py:256 #, python-format msgid "The smallest level can not be of type Previous Reminder" msgstr "Le premier niveau ne peut pas être basé sur un précédent rappel" #. module: account_credit_control -#: view:credit.control.line:account_credit_control.credit_control_line_search +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "These lines are ready to send by email or by letter using the Actions." msgstr "Ces lignes sont prêtes à être traitées" #. module: account_credit_control -#: help:credit.control.policy,account_ids:0 +#: model:ir.model.fields,help:account_credit_control.field_credit_control_policy_account_ids msgid "This policy will be active only for the selected accounts" msgstr "Cette politique de relance sera active seulement pour les comptes sélectionnés" #. module: account_credit_control -#: view:credit.control.policy.changer:account_credit_control.credit_control_policy_changer_form -msgid "" -"This wizard will let you set the overdue policy and level for selected " -"invoices" +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form +msgid "This wizard will let you set the overdue policy and level for selected invoices" msgstr "Cette action vous permet de définir une politique et un niveau de relance pour les factures sélectionnées" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_total_due msgid "Total Due" -msgstr "Total dû" +msgstr "Total Due" #. module: account_credit_control -#: view:website:account_credit_control.report_credit_control_summary_document +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_total_invoiced msgid "Total Invoiced" msgstr "Total facturé" #. module: account_credit_control -#: field:credit.control.communication,user_id:0 +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_user_id +#: model:res.groups,name:account_credit_control.group_account_credit_control_user msgid "User" msgstr "Utilisateur" #. module: account_credit_control -#: view:credit.control.marker:account_credit_control.credit_line_marker_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Warning: you will maybe not be able to revert this operation." msgstr "Attention: Cette opération ne peut pas être annulée" #. module: account_credit_control -#: code:addons/account_credit_control/line.py:226 +#: code:addons/account_credit_control/models/credit_control_line.py:229 #, python-format -msgid "" -"You are not allowed to delete a credit control line that is not in draft " -"state." +msgid "You are not allowed to delete a credit control line that is not in draft state." msgstr "Vous ne pouvez pas supprimer une ligne de relance qui n'est pas en brouillon" #. module: account_credit_control -#: code:addons/account_credit_control/policy.py:203 +#: code:addons/account_credit_control/models/credit_control_policy.py:201 #, python-format msgid "" "You can only use a policy set on account %s.\n" "Please choose one of the following policies:\n" " %s" -msgstr "Vous ne pouvez utiliser qu'une politique associée au compte %s.Vous pouvez choisir une des politique suivantes:\n %s" +msgstr "" +"Vous ne pouvez utiliser qu'une politique associée au compte %s.Vous pouvez choisir une des politique suivantes:\n" +" %s" #. module: account_credit_control -#: code:addons/account_credit_control/invoice.py:60 +#: code:addons/account_credit_control/models/account_invoice.py:60 #, python-format msgid "" "You cannot cancel this invoice.\n" @@ -1153,14 +1276,19 @@ msgid "credit control communication" msgstr "Lettre de relance" #. module: account_credit_control -#: field:credit.control.line,level:0 -msgid "credit.control.policy.level" -msgstr "Une politique de relance" +#: model:ir.model,name:account_credit_control.model_credit_control_policy_changer +msgid "credit.control.policy.changer" +msgstr "credit.control.policy.changer" #. module: account_credit_control -#: view:credit.control.emailer:account_credit_control.credit_line_emailer_form -#: view:credit.control.marker:account_credit_control.credit_line_marker_form -#: view:credit.control.policy.changer:account_credit_control.credit_control_policy_changer_form -#: view:credit.control.printer:account_credit_control.credit_line_printer_form +#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_level +msgid "credit.control.policy.level" +msgstr "credit.control.policy.level" + +#. module: account_credit_control +#: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form +#: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "or" msgstr "ou" diff --git a/account_credit_control/line_view.xml b/account_credit_control/line_view.xml deleted file mode 100644 index 9538c577b..000000000 --- a/account_credit_control/line_view.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - credit.control.line.form - credit.control.line - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - Credit Control Lines - credit.control.line - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - credit.control.line.tree - credit.control.line - - - - - - - - - - - - - - - - - - - - - - - - - - Credit Control Lines - ir.actions.act_window - credit.control.line - - form - tree,form - - {'search_default_filter_draft': 1, 'search_default_filter_to_be_sent': 1} - - - - - - - -
-
diff --git a/account_credit_control/mail.py b/account_credit_control/mail.py deleted file mode 100644 index 7ec9be86d..000000000 --- a/account_credit_control/mail.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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, fields - - -class Mail(models.Model): - _inherit = 'mail.mail' - - # use HTML fields instead of text - body_html = fields.Html('Rich-text Contents', - help="Rich-text/HTML message") diff --git a/account_credit_control/migrations/0.3/post-migration.py b/account_credit_control/migrations/0.3/post-migration.py deleted file mode 100644 index 0bc929983..000000000 --- a/account_credit_control/migrations/0.3/post-migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- encoding: utf-8 -*- -import logging -from openerp import SUPERUSER_ID -from openerp.modules.registry import RegistryManager - -uid = SUPERUSER_ID - -__name__ = 'Change custom_mail_text text field to hmtl field' -_logger = logging.getLogger(__name__) - - -def migrate_replace_text_with_html(cr, registry): - cr.execute("""update credit_control_policy_level set - custom_mail_text=regexp_replace(custom_mail_text, E'[\\n]', - '
','g')""") - cr.execute("""update ir_translation set - value=regexp_replace(value, E'[\\n]','
','g') - where name='credit.control.policy.level,custom_mail_text'""") - - -def migrate(cr, version): - if not version: - # it is the installation of the module - return - registry = RegistryManager.get(cr.dbname) - migrate_replace_text_with_html(cr, registry) diff --git a/account_credit_control/models/__init__.py b/account_credit_control/models/__init__.py new file mode 100644 index 000000000..342e9b8cd --- /dev/null +++ b/account_credit_control/models/__init__.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import account_account +from . import account_invoice +from . import credit_control_line +from . import credit_control_policy +from . import credit_control_run +from . import mail_mail +from . import res_company +from . import res_partner diff --git a/account_credit_control/models/account_account.py b/account_credit_control/models/account_account.py new file mode 100644 index 000000000..2face2a5b --- /dev/null +++ b/account_credit_control/models/account_account.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class AccountAccount(models.Model): + """ Add a link to a credit control policy on account.account """ + + _inherit = "account.account" + + credit_control_line_ids = fields.One2many('credit.control.line', + 'account_id', + string='Credit Lines', + readonly=True) diff --git a/account_credit_control/invoice.py b/account_credit_control/models/account_invoice.py similarity index 66% rename from account_credit_control/invoice.py rename to account_credit_control/models/account_invoice.py index 69b747e8c..5cc66de22 100644 --- a/account_credit_control/invoice.py +++ b/account_credit_control/models/account_invoice.py @@ -1,24 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Vincent Renaville -# Copyright 2013 Camptocamp SA -# -# 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, fields, api, _ +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, fields, models +from odoo.exceptions import UserError class AccountInvoice(models.Model): @@ -56,7 +41,7 @@ class AccountInvoice(models.Model): ('state', '!=', 'draft')] cc_nondraft_lines = cc_line_obj.search(nondraft_domain) if cc_nondraft_lines: - raise api.Warning( + raise UserError( _('You cannot cancel this invoice.\n' 'A payment reminder has already been ' 'sent to the customer.\n' diff --git a/account_credit_control/line.py b/account_credit_control/models/credit_control_line.py similarity index 86% rename from account_credit_control/line.py rename to account_credit_control/models/credit_control_line.py index 326778870..d052b3669 100644 --- a/account_credit_control/line.py +++ b/account_credit_control/models/credit_control_line.py @@ -1,28 +1,13 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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 . -# -############################################################################## +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging -from openerp import models, fields, api, _ +from odoo import _, api, fields, models +from odoo.exceptions import UserError -logger = logging.getLogger('credit.line.control') +logger = logging.getLogger(__name__) class CreditControlLine(models.Model): @@ -40,7 +25,7 @@ class CreditControlLine(models.Model): date = fields.Date(string='Controlling date', required=True, - select=True) + index=True) # maturity date of related move line we do not use # a related field in order to # allow manual changes @@ -130,7 +115,7 @@ class CreditControlLine(models.Model): store=True, readonly=True) - level = fields.Integer('credit.control.policy.level', + level = fields.Integer('Level', related='policy_level_id.level', store=True, readonly=True) @@ -149,8 +134,8 @@ class CreditControlLine(models.Model): data['date_due'] = move_line.date_maturity data['state'] = 'draft' data['channel'] = level.channel - data['invoice_id'] = (move_line.invoice.id if - move_line.invoice else False) + data['invoice_id'] = (move_line.invoice_id.id if + move_line.invoice_id else False) data['partner_id'] = move_line.partner_id.id data['amount_due'] = (move_line.amount_currency or move_line.debit or move_line.credit) @@ -194,7 +179,10 @@ class CreditControlLine(models.Model): new_lines = self.browse() for move_line in lines: - open_amount = move_line.amount_residual_currency + if move_line.currency_id: + open_amount = move_line.amount_residual_currency + else: + open_amount = move_line.amount_residual cur_tolerance = tolerance.get(move_line.currency_id.id, tolerance_base) if check_tolerance and open_amount < cur_tolerance: @@ -204,7 +192,7 @@ class CreditControlLine(models.Model): controlling_date, open_amount) line = self.create(vals) - new_lines += line + new_lines |= line # when we have lines generated earlier in draft, # on the same level, it means that we have left @@ -222,7 +210,7 @@ class CreditControlLine(models.Model): def unlink(self): for line in self: if line.state != 'draft': - raise api.Warning( + raise UserError( _('You are not allowed to delete a credit control ' 'line that is not in draft state.') ) diff --git a/account_credit_control/policy.py b/account_credit_control/models/credit_control_policy.py similarity index 85% rename from account_credit_control/policy.py rename to account_credit_control/models/credit_control_policy.py index 51bda55f2..252712672 100644 --- a/account_credit_control/policy.py +++ b/account_credit_control/models/credit_control_policy.py @@ -1,24 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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, fields, api, _ +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, fields, models +from odoo.exceptions import UserError, ValidationError class CreditControlPolicy(models.Model): @@ -39,7 +24,7 @@ class CreditControlPolicy(models.Model): 'account.account', string='Accounts', required=True, - domain="[('type', '=', 'receivable')]", + domain="[('internal_type', '=', 'receivable')]", help="This policy will be active only" " for the selected accounts", ) @@ -51,7 +36,7 @@ class CreditControlPolicy(models.Model): self.ensure_one() return [('account_id', 'in', self.account_ids.ids), ('date_maturity', '<=', controlling_date), - ('reconcile_id', '=', False), + ('reconciled', '=', False), ('partner_id', '!=', False)] @api.multi @@ -71,7 +56,7 @@ class CreditControlPolicy(models.Model): move_l_obj = self.env['account.move.line'] user = self.env.user if user.company_id.credit_policy_id.id != self.id: - return move_l_obj.browse() + return move_l_obj domain_line = self._move_lines_domain(controlling_date) return move_l_obj.search(domain_line) @@ -97,11 +82,10 @@ class CreditControlPolicy(models.Model): self.ensure_one() # MARK possible place for a good optimisation my_obj = self.env[model] - move_l_obj = self.env['account.move.line'] default_domain = self._move_lines_domain(controlling_date) - to_add = move_l_obj.browse() - to_remove = move_l_obj.browse() + to_add = self.env['account.move.line'] + to_remove = self.env['account.move.line'] # The lines which are linked to this policy have to be included in the # run for this policy. @@ -110,7 +94,7 @@ class CreditControlPolicy(models.Model): if add_objs: domain = list(default_domain) domain.append((move_relation_field, 'in', add_objs.ids)) - to_add = move_l_obj.search(domain) + to_add = to_add.search(domain) # The lines which are linked to another policy do not have to be # included in the run for this policy. @@ -119,7 +103,7 @@ class CreditControlPolicy(models.Model): if neg_objs: domain = list(default_domain) domain.append((move_relation_field, 'in', neg_objs.ids)) - to_remove = move_l_obj.search(domain) + to_remove = to_remove.search(domain) return to_add, to_remove @api.multi @@ -150,7 +134,7 @@ class CreditControlPolicy(models.Model): the process """ return self._move_lines_subset(controlling_date, 'account.invoice', - 'invoice') + 'invoice_id') @api.multi @api.returns('account.move.line') @@ -177,8 +161,7 @@ class CreditControlPolicy(models.Model): existing credit line but with a different policy. """ self.ensure_one() - move_line_obj = self.env['account.move.line'] - different_lines = move_line_obj.browse() + different_lines = self.env['account.move.line'] if not lines: return different_lines cr = self.env.cr @@ -188,7 +171,7 @@ class CreditControlPolicy(models.Model): (self.id, tuple(lines.ids))) res = cr.fetchall() if res: - return move_line_obj.browse([row[0] for row in res]) + return different_lines.browse([row[0] for row in res]) return different_lines @api.multi @@ -199,7 +182,7 @@ class CreditControlPolicy(models.Model): if account in x.account_ids or x.do_nothing] if self not in allowed: allowed_names = u"\n".join(x.name for x in allowed) - raise api.Warning( + raise UserError( _('You can only use a policy set on ' 'account %s.\n' 'Please choose one of the following ' @@ -229,7 +212,7 @@ class CreditControlPolicyLevel(models.Model): required=True ) delay_days = fields.Integer(string='Delay (in days)', required=True) - email_template_id = fields.Many2one('email.template', + email_template_id = fields.Many2one('mail.template', string='Email Template', required=True) channel = fields.Selection([('letter', 'Letter'), @@ -246,17 +229,20 @@ class CreditControlPolicyLevel(models.Model): 'UNIQUE (policy_id, level)', 'Level must be unique per policy')] - @api.one + @api.multi @api.constrains('level', 'computation_mode') def _check_level_mode(self): """ The smallest level of a policy cannot be computed on the "previous_date". """ - smallest_level = self.search([('policy_id', '=', self.policy_id.id)], - order='level asc', limit=1) - if smallest_level.computation_mode == 'previous_date': - return api.ValidationError(_('The smallest level can not be of ' - 'type Previous Reminder')) + + for policy_level in self: + smallest_level = \ + self.search([('policy_id', '=', policy_level.policy_id.id)], + order='level asc', limit=1) + if smallest_level.computation_mode == 'previous_date': + raise ValidationError(_('The smallest level can not be ' + 'of type Previous Reminder')) @api.multi def _previous_level(self): @@ -294,7 +280,7 @@ class CreditControlPolicyLevel(models.Model): return "(cr_line.date + %(delay)s)::date <= date(%(controlling_date)s)" @api.multi - def _get_sql_date_boundary_for_computation_mode(self, controlling_date): + def _get_sql_date_boundary_for_computation_mode(self): """ Return a where clauses statement for the given controlling date and computation mode of the level """ @@ -321,7 +307,7 @@ class CreditControlPolicyLevel(models.Model): self.ensure_one() move_line_obj = self.env['account.move.line'] if not lines: - return move_line_obj.browse() + return move_line_obj cr = self.env.cr sql = ("SELECT DISTINCT mv_line.id\n" " FROM account_move_line mv_line\n" @@ -337,7 +323,7 @@ class CreditControlPolicyLevel(models.Model): " AND (mv_line.debit IS NOT NULL AND mv_line.debit != 0.0)\n") sql += " AND" _get_sql_date_part = self._get_sql_date_boundary_for_computation_mode - sql += _get_sql_date_part(controlling_date) + sql += _get_sql_date_part() data_dict = {'controlling_date': controlling_date, 'line_ids': tuple(lines.ids), 'delay': self.delay_days} @@ -345,7 +331,7 @@ class CreditControlPolicyLevel(models.Model): res = cr.fetchall() if res: return move_line_obj.browse([row[0] for row in res]) - return move_line_obj.browse() + return move_line_obj @api.multi @api.returns('account.move.line') @@ -355,7 +341,7 @@ class CreditControlPolicyLevel(models.Model): self.ensure_one() move_line_obj = self.env['account.move.line'] if not lines: - return move_line_obj.browse() + return move_line_obj cr = self.env.cr sql = ("SELECT mv_line.id\n" " FROM account_move_line mv_line\n" @@ -377,7 +363,7 @@ class CreditControlPolicyLevel(models.Model): " AND mv_line.id in %(line_ids)s\n") sql += " AND " _get_sql_date_part = self._get_sql_date_boundary_for_computation_mode - sql += _get_sql_date_part(controlling_date) + sql += _get_sql_date_part() previous_level = self._previous_level() data_dict = {'controlling_date': controlling_date, 'line_ids': tuple(lines.ids), @@ -389,15 +375,14 @@ class CreditControlPolicyLevel(models.Model): res = cr.fetchall() if res: return move_line_obj.browse([row[0] for row in res]) - return move_line_obj.browse() + return move_line_obj @api.multi @api.returns('account.move.line') def get_level_lines(self, controlling_date, lines): """ get all move lines in entry lines that match the current level """ self.ensure_one() - move_line_obj = self.env['account.move.line'] - matching_lines = move_line_obj.browse() + matching_lines = self.env['account.move.line'] if self._previous_level() is None: method = self._get_first_level_move_lines else: diff --git a/account_credit_control/run.py b/account_credit_control/models/credit_control_run.py similarity index 71% rename from account_credit_control/run.py rename to account_credit_control/models/credit_control_run.py index c6afb1d1e..4bd4ee2e1 100644 --- a/account_credit_control/run.py +++ b/account_credit_control/models/credit_control_run.py @@ -1,28 +1,13 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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 . -# -############################################################################## +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging -from openerp import models, fields, api, _ +from odoo import _, api, fields, models +from odoo.exceptions import UserError -logger = logging.getLogger('credit.control.run') +logger = logging.getLogger(__name__) class CreditControlRun(models.Model): @@ -74,7 +59,7 @@ class CreditControlRun(models.Model): copy=False, ) - @api.multi + @api.model def _check_run_date(self, controlling_date): """ Ensure that there is no credit line in the future using controlling_date @@ -83,33 +68,31 @@ class CreditControlRun(models.Model): runs = self.search([('date', '>', controlling_date)], order='date DESC', limit=1) if runs: - raise api.Warning(_('A run has already been executed more ' - 'recently than %s') % (runs.date)) + raise UserError(_('A run has already been executed more ' + 'recently than %s') % (runs.date)) line_obj = self.env['credit.control.line'] lines = line_obj.search([('date', '>', controlling_date)], order='date DESC', limit=1) if lines: - raise api.Warning(_('A credit control line more ' - 'recent than %s exists at %s') % - (controlling_date, lines.date)) + raise UserError(_('A credit control line more ' + 'recent than %s exists at %s') % + (controlling_date, lines.date)) @api.multi @api.returns('credit.control.line') def _generate_credit_lines(self): """ Generate credit control lines. """ self.ensure_one() - cr_line_obj = self.env['credit.control.line'] - move_line_obj = self.env['account.move.line'] - manually_managed_lines = move_line_obj.browse() + manually_managed_lines = self.env['account.move.line'] self._check_run_date(self.date) policies = self.policy_ids if not policies: - raise api.Warning(_('Please select a policy')) + raise UserError(_('Please select a policy')) report = '' - generated = cr_line_obj.browse() + generated = self.env['credit.control.line'] for policy in policies: if policy.do_nothing: continue @@ -117,11 +100,11 @@ class CreditControlRun(models.Model): manual_lines = policy._lines_different_policy(lines) lines -= manual_lines manually_managed_lines |= manual_lines - policy_lines_generated = cr_line_obj.browse() + policy_lines_generated = self.env['credit.control.line'] if lines: # policy levels are sorted by level # so iteration is in the correct order - create = cr_line_obj.create_or_update_from_mv_lines + create = policy_lines_generated.create_or_update_from_mv_lines for level in reversed(policy.level_ids): level_lines = level.get_level_lines(self.date, lines) policy_lines_generated += create(level_lines, @@ -158,8 +141,8 @@ class CreditControlRun(models.Model): except Exception: # In case of exception openerp will do a rollback # for us and free the lock - raise api.Warning(_('A credit control run is already running' - ' in background, please try later.')) + raise UserError(_('A credit control run is already running ' + 'in background, please try later.')) self._generate_credit_lines() return True diff --git a/account_credit_control/models/mail_mail.py b/account_credit_control/models/mail_mail.py new file mode 100644 index 000000000..3b5f95acb --- /dev/null +++ b/account_credit_control/models/mail_mail.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class Mail(models.Model): + _inherit = 'mail.mail' + + # use HTML fields instead of text + body_html = fields.Html('Rich-text Contents', + help="Rich-text/HTML message") diff --git a/account_credit_control/models/res_company.py b/account_credit_control/models/res_company.py new file mode 100644 index 000000000..4ae6dc332 --- /dev/null +++ b/account_credit_control/models/res_company.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResCompany(models.Model): + """ Add credit control parameters """ + _inherit = 'res.company' + + credit_control_tolerance = fields.Float(string='Credit Control Tolerance', + default=0.1) + # This is not a property on the partner because we cannot search + # on fields.property (subclass fields.function). + credit_policy_id = fields.Many2one('credit.control.policy', + string='Credit Control Policy', + help="The Credit Control Policy used " + "on partners by default. " + "This setting can be overridden" + " on partners or invoices.") diff --git a/account_credit_control/partner.py b/account_credit_control/models/res_partner.py similarity index 53% rename from account_credit_control/partner.py rename to account_credit_control/models/res_partner.py index 30f81eff2..b43e43d15 100644 --- a/account_credit_control/partner.py +++ b/account_credit_control/models/res_partner.py @@ -1,25 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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, fields, api -from openerp.exceptions import Warning, ValidationError +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import api, fields, models +from odoo.exceptions import UserError, ValidationError class ResPartner(models.Model): @@ -32,7 +16,7 @@ class ResPartner(models.Model): credit_policy_id = fields.Many2one( 'credit.control.policy', string='Credit Control Policy', - domain="[('account_ids', 'in', property_account_receivable)]", + domain="[('account_ids', 'in', property_account_receivable_id)]", help="The Credit Control Policy used for this " "partner. This setting can be forced on the " "invoice. If nothing is defined, it will use " @@ -43,17 +27,17 @@ class ResPartner(models.Model): string='Credit Control Lines', readonly=True) - @api.constrains('credit_policy_id', 'property_account_receivable') + @api.constrains('credit_policy_id', 'property_account_receivable_id') def _check_credit_policy(self): """ Ensure that policy on partner are limited to the account policy """ for partner in self: - if (not partner.property_account_receivable or + if (not partner.property_account_receivable_id or not partner.credit_policy_id): continue - account = partner.property_account_receivable + account = partner.property_account_receivable_id policy = partner.credit_policy_id try: policy.check_policy_against_account(account) - except Warning as err: + except UserError as err: # constrains should raise ValidationError exceptions raise ValidationError(err) diff --git a/account_credit_control/partner_view.xml b/account_credit_control/partner_view.xml deleted file mode 100644 index e2ad144e8..000000000 --- a/account_credit_control/partner_view.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - partner.credit_control.form.view - res.partner - - - - - - - - - - - - diff --git a/account_credit_control/policy_view.xml b/account_credit_control/policy_view.xml deleted file mode 100644 index 7158389f1..000000000 --- a/account_credit_control/policy_view.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - credit.control.policy.form - credit.control.policy - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
- - - credit.control.policy.tree - credit.control.policy - - - - - - - - - - - - Credit Control Policies - ir.actions.act_window - credit.control.policy - - form - tree,form - - - - - - - credit.mangement.policy.level.form - credit.control.policy.level - -
- - - - - - - - - - - - - - - - - - -
-
- - - credit.control.policy.level.tree - credit.control.policy.level - - - - - - - - - - - -
-
diff --git a/account_credit_control/report/report.xml b/account_credit_control/report/report.xml index 2d24c0862..187969d2e 100644 --- a/account_credit_control/report/report.xml +++ b/account_credit_control/report/report.xml @@ -1,15 +1,12 @@ - - - + + - - - + id="credit_control_summary" + model="credit.control.communication" + string="Credit Control Summary" + report_type="qweb-pdf" + name="account_credit_control.report_credit_control_summary" + file="account_credit_control.report_credit_control_summary" + auto="False" + /> + diff --git a/account_credit_control/report/report_credit_control_summary.xml b/account_credit_control/report/report_credit_control_summary.xml index 1b02093c8..676a5e213 100644 --- a/account_credit_control/report/report_credit_control_summary.xml +++ b/account_credit_control/report/report_credit_control_summary.xml @@ -1,99 +1,104 @@ - - + - - + diff --git a/account_credit_control/run_view.xml b/account_credit_control/run_view.xml deleted file mode 100644 index aa3cd0ea0..000000000 --- a/account_credit_control/run_view.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - credit.control.run.tree - credit.control.run - - - - - - - - - - credit.control.run.form - credit.control.run - -
-
-
- - - - - - - - - - - - - - - -
-
-
- - - - Credit Control Run - ir.actions.act_window - credit.control.run - - form - tree,form - - - - - - -
-
diff --git a/account_credit_control/security/ir.model.access.csv b/account_credit_control/security/ir.model.access.csv index a3854b714..979d3b7b8 100644 --- a/account_credit_control/security/ir.model.access.csv +++ b/account_credit_control/security/ir.model.access.csv @@ -1,20 +1,20 @@ -"id","perm_create","perm_unlink","group_id/id","name","model_id/id","perm_read","perm_write" -"account_credit_control.ir_model_access_270",1,1,"group_account_credit_control_manager","credit_control_manager_line","account_credit_control.model_credit_control_line",1,1 -"account_credit_control.ir_model_access_271",1,1,"group_account_credit_control_user","credit_control_user_line","account_credit_control.model_credit_control_line",1,1 -"account_credit_control.ir_model_access_272",0,0,"group_account_credit_control_info","credit_control_info_line","account_credit_control.model_credit_control_line",1,0 -"account_credit_control.ir_model_access_273",1,1,"group_account_credit_control_manager","credit_control_manager_mail_template","email_template.model_email_template",1,1 -"account_credit_control.ir_model_access_275",1,1,"group_account_credit_control_manager","credit_control_manager_mail_message","mail.model_mail_message",1,1 -"account_credit_control.ir_model_access_276",1,0,"group_account_credit_control_user","credit_control_user_mail_message","mail.model_mail_message",1,1 -"account_credit_control.ir_model_access_277",0,0,"group_account_credit_control_info","credit_control_info_mail_message","mail.model_mail_message",1,0 -"account_credit_control.ir_model_access_281",1,1,"group_account_credit_control_manager","credit_control_mananger_run","account_credit_control.model_credit_control_run",1,1 -"account_credit_control.ir_model_access_282",1,1,"group_account_credit_control_user","credit_control_user_run","account_credit_control.model_credit_control_run",1,1 -"account_credit_control.ir_model_access_283",0,0,"group_account_credit_control_info","credit_control_info_run","account_credit_control.model_credit_control_run",1,0 -"account_credit_control.ir_model_access_284",1,1,"group_account_credit_control_manager","credit_control_manager_policy","account_credit_control.model_credit_control_policy",1,1 -"account_credit_control.ir_model_access_285",0,0,"group_account_credit_control_user","credit_control_user_policy","account_credit_control.model_credit_control_policy",1,0 -"account_credit_control.ir_model_access_286",0,0,"group_account_credit_control_info","credit_control_info_policy","account_credit_control.model_credit_control_policy",1,0 -"account_credit_control.ir_model_access_287",1,1,"group_account_credit_control_manager","credit_control_manager_level","account_credit_control.model_credit_control_policy_level",1,1 -"account_credit_control.ir_model_access_288",0,0,"group_account_credit_control_user","credit_control_user_level","account_credit_control.model_credit_control_policy_level",1,0 -"account_credit_control.ir_model_access_289",0,0,"group_account_credit_control_info","credit_control_info_level","account_credit_control.model_credit_control_policy_level",1,0 -"account_credit_control.ir_model_access_290",0,0,"account.group_account_user","credit_control_fin_user_line","account_credit_control.model_credit_control_line",1,0 -"account_credit_control.ir_model_access_291",0,0,"account.group_account_invoice","credit_control_fin_invoice_line","account_credit_control.model_credit_control_line",1,0 -"account_credit_control.ir_model_access_292",1,1,"account.group_account_manager","credit_control_fin_manager_line","account_credit_control.model_credit_control_line",1,1 \ No newline at end of file +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +account_credit_control.ir_model_access_270,credit_control_manager_line,account_credit_control.model_credit_control_line,group_account_credit_control_manager,1,1,1,1 +account_credit_control.ir_model_access_271,credit_control_user_line,account_credit_control.model_credit_control_line,group_account_credit_control_user,1,1,1,1 +account_credit_control.ir_model_access_272,credit_control_info_line,account_credit_control.model_credit_control_line,group_account_credit_control_info,1,0,0,0 +account_credit_control.ir_model_access_273,credit_control_manager_mail_template,mail.model_mail_template,group_account_credit_control_manager,1,1,1,1 +account_credit_control.ir_model_access_275,credit_control_manager_mail_message,mail.model_mail_message,group_account_credit_control_manager,1,1,1,1 +account_credit_control.ir_model_access_276,credit_control_user_mail_message,mail.model_mail_message,group_account_credit_control_user,1,1,1,0 +account_credit_control.ir_model_access_277,credit_control_info_mail_message,mail.model_mail_message,group_account_credit_control_info,1,0,0,0 +account_credit_control.ir_model_access_281,credit_control_mananger_run,account_credit_control.model_credit_control_run,group_account_credit_control_manager,1,1,1,1 +account_credit_control.ir_model_access_282,credit_control_user_run,account_credit_control.model_credit_control_run,group_account_credit_control_user,1,1,1,1 +account_credit_control.ir_model_access_283,credit_control_info_run,account_credit_control.model_credit_control_run,group_account_credit_control_info,1,0,0,0 +account_credit_control.ir_model_access_284,credit_control_manager_policy,account_credit_control.model_credit_control_policy,group_account_credit_control_manager,1,1,1,1 +account_credit_control.ir_model_access_285,credit_control_user_policy,account_credit_control.model_credit_control_policy,group_account_credit_control_user,1,0,0,0 +account_credit_control.ir_model_access_286,credit_control_info_policy,account_credit_control.model_credit_control_policy,group_account_credit_control_info,1,0,0,0 +account_credit_control.ir_model_access_287,credit_control_manager_level,account_credit_control.model_credit_control_policy_level,group_account_credit_control_manager,1,1,1,1 +account_credit_control.ir_model_access_288,credit_control_user_level,account_credit_control.model_credit_control_policy_level,group_account_credit_control_user,1,0,0,0 +account_credit_control.ir_model_access_289,credit_control_info_level,account_credit_control.model_credit_control_policy_level,group_account_credit_control_info,1,0,0,0 +account_credit_control.ir_model_access_290,credit_control_fin_user_line,account_credit_control.model_credit_control_line,account.group_account_user,1,0,0,0 +account_credit_control.ir_model_access_291,credit_control_fin_invoice_line,account_credit_control.model_credit_control_line,account.group_account_invoice,1,0,0,0 +account_credit_control.ir_model_access_292,credit_control_fin_manager_line,account_credit_control.model_credit_control_line,account.group_account_manager,1,1,1,1 diff --git a/account_credit_control/security/res_groups.xml b/account_credit_control/security/res_groups.xml new file mode 100644 index 000000000..e7847cc74 --- /dev/null +++ b/account_credit_control/security/res_groups.xml @@ -0,0 +1,25 @@ + + + + Credit Control + + + + + Info + + + + + User + + + + + + Manager + + + + + diff --git a/account_credit_control/tests/__init__.py b/account_credit_control/tests/__init__.py new file mode 100644 index 000000000..c13729caa --- /dev/null +++ b/account_credit_control/tests/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import test_credit_control_policy +from . import test_res_partner +from . import test_account_invoice +from . import test_credit_control_run diff --git a/account_credit_control/tests/test_account_invoice.py b/account_credit_control/tests/test_account_invoice.py new file mode 100644 index 000000000..9f920b4c0 --- /dev/null +++ b/account_credit_control/tests/test_account_invoice.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from datetime import datetime +from dateutil import relativedelta + +from odoo import fields +from odoo.tests.common import TransactionCase +from odoo.exceptions import UserError + + +class TestAccountInvoice(TransactionCase): + post_install = True + at_install = False + + def test_action_cancel(self): + """ + Test the method action_cancel on invoice + We will create an old invoice, generate a control run + and check if I can unlink this invoice + :return: + """ + journal = self.env['account.invoice']._default_journal() + + account_type_rec = self.env.ref('account.data_account_type_receivable') + account = self.env['account.account'].create({ + 'code': '400001', + 'name': 'Clients (test)', + 'user_type_id': account_type_rec.id, + 'reconcile': True, + }) + + tag_operation = self.env.ref('account.account_tag_operating') + account_type_inc = self.env.ref('account.data_account_type_revenue') + analytic_account = self.env['account.account'].create({ + 'code': '701001', + 'name': 'Ventes en Belgique (test)', + 'user_type_id': account_type_inc.id, + 'reconcile': True, + 'tag_ids': [(6, 0, [tag_operation.id])] + }) + payment_term = self.env.ref('account.account_payment_term_immediate') + + product = self.env['product.product'].create({ + 'name': 'Product test' + }) + + policy = self.env.ref('account_credit_control.credit_control_3_time') + policy.write({ + 'account_ids': [(6, 0, [account.id])] + }) + + # There is a bug with Odoo ... + # The field "credit_policy_id" is considered as an "old field" and + # the field property_account_receivable_id like a "new field" + # The ORM will create the record with old field + # and update the record with new fields. + # However constrains are applied after the first creation. + partner = self.env['res.partner'].create({ + 'name': 'Partner', + 'property_account_receivable_id': account.id, + }) + partner.credit_policy_id = policy.id + + date_invoice = datetime.today() - relativedelta.relativedelta(years=1) + invoice = self.env['account.invoice'].create({ + 'partner_id': partner.id, + 'journal_id': journal.id, + 'type': 'out_invoice', + 'payment_term_id': payment_term.id, + 'date_invoice': fields.Datetime.to_string(date_invoice), + 'date_due': fields.Datetime.to_string(date_invoice), + }) + + invoice.invoice_line_ids.create({ + 'invoice_id': invoice.id, + 'product_id': product.id, + 'name': product.name, + 'account_id': analytic_account.id, + 'quantity': 5, + 'price_unit': 100, + }) + + # Validate the invoice + invoice.action_invoice_open() + + control_run = self.env['credit.control.run'].create({ + 'date': fields.Date.today(), + 'policy_ids': [(6, 0, [policy.id])] + }) + control_run.generate_credit_lines() + + self.assertTrue(len(invoice.credit_control_line_ids), 1) + control_line = invoice.credit_control_line_ids + + control_marker = self.env['credit.control.marker'] + marker_line = control_marker\ + .with_context(active_model='credit.control.line', + active_ids=[control_line.id])\ + ._get_line_ids() + + self.assertIn(control_line, marker_line) + + marker = self.env['credit.control.marker'].create({ + 'name': 'to_be_sent', + 'line_ids': [(6, 0, [control_line.id])] + }) + marker.mark_lines() + + with self.assertRaises(UserError): + invoice.unlink() diff --git a/account_credit_control/tests/test_credit_control_policy.py b/account_credit_control/tests/test_credit_control_policy.py new file mode 100644 index 000000000..c80566c06 --- /dev/null +++ b/account_credit_control/tests/test_credit_control_policy.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.exceptions import ValidationError, UserError +from odoo.tests.common import TransactionCase + + +class TestCreditControlPolicy(TransactionCase): + post_install = True + at_install = False + + def test_check_policy_against_account(self): + """ + Test the model check_policy_against_account with several case + :return: + """ + policy = self.env.ref('account_credit_control.credit_control_3_time') + + account_type = self.env.ref('account.data_account_type_receivable') + account = self.env['account.account'].create({ + 'code': '400001', + 'name': 'Test', + 'user_type_id': account_type.id, + 'reconcile': True, + }) + + # The account is not included in the policy + with self.assertRaises(UserError): + policy.check_policy_against_account(account) + + # We set the flag "do_nothing" to True + policy.write({ + 'account_ids': [(5, 0)], + 'do_nothing': True, + }) + result = policy.check_policy_against_account(account) + self.assertTrue(result) + + # We add the account in the policy + policy.write({ + 'account_ids': [(6, 0, [account.id])] + }) + result = policy.check_policy_against_account(account) + self.assertTrue(result) + + def test_check_level_mode(self): + """ + Check the method _check_level_mode on policy level + :return: + """ + level_1 = self.env.ref('account_credit_control.3_time_1') + + with self.assertRaises(ValidationError): + level_1.computation_mode = 'previous_date' + + def test_previous_level(self): + """ + Check the method _previous_level on policy level + :return: + """ + level_1 = self.env.ref('account_credit_control.3_time_1') + level_2 = self.env.ref('account_credit_control.3_time_2') + + previous_level = level_2._previous_level() + self.assertEqual(previous_level, level_1) + + def test_get_sql_date_boundary_for_computation_mode(self): + """ + Check the where clauses statement return by the method + _get_sql_date_boundary_for_computation_mode + according the computation mode + :return: + """ + level_2 = self.env.ref('account_credit_control.3_time_2') + + level_2.computation_mode = 'net_days' + where_clause = level_2._net_days_get_boundary() + result = level_2._get_sql_date_boundary_for_computation_mode() + self.assertEqual(result, where_clause) + + level_2.computation_mode = 'end_of_month' + where_clause = level_2._end_of_month_get_boundary() + result = level_2._get_sql_date_boundary_for_computation_mode() + self.assertEqual(result, where_clause) + + level_2.computation_mode = 'previous_date' + where_clause = level_2._previous_date_get_boundary() + result = level_2._get_sql_date_boundary_for_computation_mode() + self.assertEqual(result, where_clause) diff --git a/account_credit_control/tests/test_credit_control_run.py b/account_credit_control/tests/test_credit_control_run.py new file mode 100644 index 000000000..ac7c83196 --- /dev/null +++ b/account_credit_control/tests/test_credit_control_run.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import re +from datetime import datetime +from dateutil import relativedelta + +from odoo import fields +from odoo.tests.common import TransactionCase +from odoo.exceptions import UserError + + +class TestCreditControlRun(TransactionCase): + post_install = True + at_install = False + + def setUp(self): + super(TestCreditControlRun, self).setUp() + + journal = self.env['account.invoice']._default_journal() + + account_type_rec = self.env.ref('account.data_account_type_receivable') + account = self.env['account.account'].create({ + 'code': '400001', + 'name': 'Clients (test)', + 'user_type_id': account_type_rec.id, + 'reconcile': True, + }) + + tag_operation = self.env.ref('account.account_tag_operating') + account_type_inc = self.env.ref('account.data_account_type_revenue') + analytic_account = self.env['account.account'].create({ + 'code': '701001', + 'name': 'Ventes en Belgique (test)', + 'user_type_id': account_type_inc.id, + 'reconcile': True, + 'tag_ids': [(6, 0, [tag_operation.id])] + }) + payment_term = self.env.ref('account.account_payment_term_immediate') + + product = self.env['product.product'].create({ + 'name': 'Product test' + }) + + self.policy = \ + self.env.ref('account_credit_control.credit_control_3_time') + self.policy.write({ + 'account_ids': [(6, 0, [account.id])] + }) + + # There is a bug with Odoo ... + # The field "credit_policy_id" is considered as an "old field" and + # the field property_account_receivable_id like a "new field" + # The ORM will create the record with old field + # and update the record with new fields. + # However constrains are applied after the first creation. + partner = self.env['res.partner'].create({ + 'name': 'Partner', + 'property_account_receivable_id': account.id, + }) + partner.credit_policy_id = self.policy.id + + date_invoice = datetime.today() - relativedelta.relativedelta(years=1) + self.invoice = self.env['account.invoice'].create({ + 'partner_id': partner.id, + 'journal_id': journal.id, + 'type': 'out_invoice', + 'payment_term_id': payment_term.id, + 'date_invoice': fields.Datetime.to_string(date_invoice), + 'date_due': fields.Datetime.to_string(date_invoice), + }) + + self.invoice.invoice_line_ids.create({ + 'invoice_id': self.invoice.id, + 'product_id': product.id, + 'name': product.name, + 'account_id': analytic_account.id, + 'quantity': 5, + 'price_unit': 100, + }) + + # Validate the invoice + self.invoice.action_invoice_open() + + def test_check_run_date(self): + """ + Create a control run older than the last control run + :return: + """ + control_run = self.env['credit.control.run'].create({ + 'date': fields.Date.today(), + 'policy_ids': [(6, 0, [self.policy.id])] + }) + + with self.assertRaises(UserError): + today = datetime.today() + previous_date = today - relativedelta.relativedelta(days=15) + previous_date_str = fields.Date.to_string(previous_date) + control_run._check_run_date(previous_date_str) + + def test_generate_credit_lines(self): + """ + Test the method generate_credit_lines + :return: + """ + control_run = self.env['credit.control.run'].create({ + 'date': fields.Date.today(), + 'policy_ids': [(6, 0, [self.policy.id])] + }) + + control_run.with_context(lang='en_US').generate_credit_lines() + + self.assertTrue(len(self.invoice.credit_control_line_ids), 1) + self.assertEqual(control_run.state, 'done') + + report_regex = \ + r'

Policy "%s" has generated ' \ + r'\d+ Credit Control Lines.

' % self.policy.name + regex_result = re.match(report_regex, control_run.report) + self.assertIsNotNone(regex_result) + + def test_multi_credit_control_run(self): + """ + Generate several control run + :return: + """ + + six_months = datetime.today() - relativedelta.relativedelta(months=6) + six_months_str = fields.Date.to_string(six_months) + three_months = datetime.today() - relativedelta.relativedelta(months=2) + three_months_str = fields.Date.to_string(three_months) + + # First run + first_control_run = self.env['credit.control.run'].create({ + 'date': six_months_str, + 'policy_ids': [(6, 0, [self.policy.id])] + }) + first_control_run.with_context(lang='en_US').generate_credit_lines() + self.assertTrue(len(self.invoice.credit_control_line_ids), 1) + + # Second run + second_control_run = self.env['credit.control.run'].create({ + 'date': three_months_str, + 'policy_ids': [(6, 0, [self.policy.id])] + }) + second_control_run.with_context(lang='en_US').generate_credit_lines() + self.assertTrue(len(self.invoice.credit_control_line_ids), 2) + + # Last run + last_control_run = self.env['credit.control.run'].create({ + 'date': fields.Date.today(), + 'policy_ids': [(6, 0, [self.policy.id])] + }) + last_control_run.with_context(lang='en_US').generate_credit_lines() + self.assertTrue(len(self.invoice.credit_control_line_ids), 2) diff --git a/account_credit_control/tests/test_res_partner.py b/account_credit_control/tests/test_res_partner.py new file mode 100644 index 000000000..62399c6e4 --- /dev/null +++ b/account_credit_control/tests/test_res_partner.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase +from odoo.exceptions import ValidationError + + +class TestCreditControlPolicyLevel(TransactionCase): + post_install = True + at_install = False + + def test_check_credit_policy(self): + """ + Test the constrains on res.partner + First we try to assign an account and a policy with a wrong policy + (this policy doesn't contains the account of the partner). + After that we add the previous account in the policy and + retry to assign this policy and this account on the partner + :return: + """ + policy = self.env.ref('account_credit_control.credit_control_3_time') + + partner = self.env['res.partner'].create({ + 'name': 'Partner 1', + }) + account = partner.property_account_receivable_id + + with self.assertRaises(ValidationError): + partner.write({ + 'credit_policy_id': policy.id, + }) + + policy.write({ + 'account_ids': [(6, 0, [account.id])] + }) + partner.property_account_receivable_id = account.id + partner.credit_policy_id = policy.id diff --git a/account_credit_control/views/account_invoice.xml b/account_credit_control/views/account_invoice.xml new file mode 100644 index 000000000..2b9dcbbf3 --- /dev/null +++ b/account_credit_control/views/account_invoice.xml @@ -0,0 +1,44 @@ + + + + + + invoice.followup.form.view + account.invoice + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/account_credit_control/views/credit_control_line.xml b/account_credit_control/views/credit_control_line.xml new file mode 100644 index 000000000..74963f679 --- /dev/null +++ b/account_credit_control/views/credit_control_line.xml @@ -0,0 +1,171 @@ + + + + credit.control.line.form + credit.control.line + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + Credit Control Lines + credit.control.line + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + credit.control.line.tree + credit.control.line + + + + + + + + + + + + + + + + + + + + + + + + + + Credit Control Lines + ir.actions.act_window + credit.control.line + + form + tree,form + + {'search_default_filter_draft': 1, + 'search_default_filter_to_be_sent': 1} + + + + + + + + +
diff --git a/account_credit_control/views/credit_control_policy.xml b/account_credit_control/views/credit_control_policy.xml new file mode 100644 index 000000000..b3651fc90 --- /dev/null +++ b/account_credit_control/views/credit_control_policy.xml @@ -0,0 +1,133 @@ + + + + credit.control.policy.form + credit.control.policy + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + credit.control.policy.tree + credit.control.policy + + + + + + + + + + + + Credit Control Policies + ir.actions.act_window + credit.control.policy + + form + tree,form + + + + + + + credit.mangement.policy.level.form + credit.control.policy.level + +
+ + + + + + + + + + + + + + + + + + +
+
+ + + credit.control.policy.level.tree + credit.control.policy.level + + + + + + + + + + + +
diff --git a/account_credit_control/views/credit_control_run.xml b/account_credit_control/views/credit_control_run.xml new file mode 100644 index 000000000..c01a4d799 --- /dev/null +++ b/account_credit_control/views/credit_control_run.xml @@ -0,0 +1,74 @@ + + + + credit.control.run.tree + credit.control.run + + + + + + + + + + credit.control.run.form + credit.control.run + +
+
+
+ + + + + + + + + + + + + + + +
+
+
+ + + + Credit Control Run + ir.actions.act_window + credit.control.run + + form + tree,form + + + + + + +
diff --git a/account_credit_control/views/res_company.xml b/account_credit_control/views/res_company.xml new file mode 100644 index 000000000..22b71f9cb --- /dev/null +++ b/account_credit_control/views/res_company.xml @@ -0,0 +1,14 @@ + + + + credit.control.company.form + res.company + + + + + + + + + diff --git a/account_credit_control/views/res_partner.xml b/account_credit_control/views/res_partner.xml new file mode 100644 index 000000000..cdb4888ae --- /dev/null +++ b/account_credit_control/views/res_partner.xml @@ -0,0 +1,23 @@ + + + + partner.credit_control.form.view + res.partner + + + + + + + + + + + diff --git a/account_credit_control/wizard/__init__.py b/account_credit_control/wizard/__init__.py index 82938e856..f3c532641 100644 --- a/account_credit_control/wizard/__init__.py +++ b/account_credit_control/wizard/__init__.py @@ -1,23 +1,3 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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_emailer from . import credit_control_marker from . import credit_control_printer diff --git a/account_credit_control/wizard/credit_control_communication.py b/account_credit_control/wizard/credit_control_communication.py index b60a05f87..d23718555 100644 --- a/account_credit_control/wizard/credit_control_communication.py +++ b/account_credit_control/wizard/credit_control_communication.py @@ -1,27 +1,11 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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 . -# -############################################################################## +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging -from openerp import models, fields, api +from odoo import api, fields, models -logger = logging.getLogger('credit.control.line.mailing') +logger = logging.getLogger(__name__) class CreditCommunication(models.TransientModel): @@ -81,13 +65,14 @@ class CreditCommunication(models.TransientModel): balance_field = 'credit_control_line_ids.balance_due' return sum(self.mapped(balance_field)) - @api.one + @api.multi @api.depends('credit_control_line_ids', 'credit_control_line_ids.amount_due', 'credit_control_line_ids.balance_due') def _compute_total(self): - self.total_invoiced = self._get_total() - self.total_due = self._get_total_due() + for communication in self: + communication.total_invoiced = communication._get_total() + communication.total_due = communication._get_total_due() @api.model @api.returns('self', lambda value: value.id) @@ -176,30 +161,21 @@ class CreditCommunication(models.TransientModel): @api.returns('mail.mail') def _generate_emails(self): """ Generate email message using template related to level """ - email_message_obj = self.env['mail.mail'] - # Warning: still using the old-api on 'email.template' because - # the method generate_email() does not follow the cr, uid, ids - # convention and the new api wrapper can't translate the call - email_template_obj = self.pool['email.template'] - att_obj = self.env['ir.attachment'] - emails = email_message_obj.browse() + emails = self.env['mail.mail'] + attachments = self.env['ir.attachment'] required_fields = ['subject', 'body_html', 'email_from', 'email_to'] - cr, uid, context = self.env.cr, self.env.uid, self.env.context for comm in self: template = comm.current_policy_level.email_template_id - email_values = email_template_obj.generate_email(cr, uid, - template.id, - comm.id, - context=context) + email_values = template.generate_email(comm.id) email_values['type'] = 'email' # model is Transient record (self) removed periodically so no point # of storing res_id email_values.pop('model', None) email_values.pop('res_id', None) - email = email_message_obj.create(email_values) + email = emails.create(email_values) state = 'sent' # The mail will not be send, however it will be in the pool, in an @@ -213,7 +189,6 @@ class CreditCommunication(models.TransientModel): comm.credit_control_line_ids.write({'mail_message_id': email.id, 'state': state}) - attachments = att_obj.browse() for att in email_values.get('attachments', []): attach_fname = att[0] attach_datas = att[1] @@ -225,7 +200,7 @@ class CreditCommunication(models.TransientModel): 'res_id': email.id, 'type': 'binary', } - attachments += att_obj.create(data_attach) + attachments |= attachments.create(data_attach) email.write({'attachment_ids': [(6, 0, attachments.ids)]}) emails += email return emails @@ -242,8 +217,7 @@ class CreditCommunication(models.TransientModel): @api.multi @api.returns('credit.control.line') def _mark_credit_line_as_sent(self): - line_obj = self.env['credit.control.line'] - lines = line_obj.browse() + lines = self.env['credit.control.line'] for comm in self: lines |= comm.credit_control_line_ids diff --git a/account_credit_control/wizard/credit_control_emailer.py b/account_credit_control/wizard/credit_control_emailer.py index 61397e583..9c7230954 100644 --- a/account_credit_control/wizard/credit_control_emailer.py +++ b/account_credit_control/wizard/credit_control_emailer.py @@ -1,25 +1,10 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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 . -# -############################################################################## +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, _ +from odoo import _, api, fields, models +from odoo.exceptions import UserError class CreditControlEmailer(models.TransientModel): @@ -59,7 +44,7 @@ class CreditControlEmailer(models.TransientModel): def email_lines(self): self.ensure_one() if not self.line_ids: - raise api.Warning(_('No credit control lines selected.')) + raise UserError(_('No credit control lines selected.')) comm_obj = self.env['credit.control.communication'] diff --git a/account_credit_control/wizard/credit_control_emailer_view.xml b/account_credit_control/wizard/credit_control_emailer_view.xml index 2c299a64b..272289e4b 100644 --- a/account_credit_control/wizard/credit_control_emailer_view.xml +++ b/account_credit_control/wizard/credit_control_emailer_view.xml @@ -1,54 +1,52 @@ - - - + + - credit.line.emailer.form - credit.control.emailer - -
- - - - - - - - -
-
- -
+ credit.line.emailer.form + credit.control.emailer + +
+ + + + + + + + +
+
+ +
+ res_model="credit.control.emailer" + src_model="credit.control.line" + view_mode="form" + target="new" + key2="client_action_multi" + id="open_credit_line_emailer_wizard_menu_action"/> - Send By Email - credit.control.emailer - form - form - - new - Send an email for the selected lines. + Send By Email + credit.control.emailer + form + form + + new + Send an email for the selected lines. -
-
+ diff --git a/account_credit_control/wizard/credit_control_marker.py b/account_credit_control/wizard/credit_control_marker.py index 516c4febc..edb63e09d 100644 --- a/account_credit_control/wizard/credit_control_marker.py +++ b/account_credit_control/wizard/credit_control_marker.py @@ -1,24 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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, fields, api, _ +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import _, api, fields, models +from odoo.exceptions import UserError class CreditControlMarker(models.TransientModel): @@ -71,12 +56,12 @@ class CreditControlMarker(models.TransientModel): self.ensure_one() if not self.line_ids: - raise api.Warning(_('No credit control lines selected.')) + raise UserError(_('No credit control lines selected.')) filtered_lines = self._filter_lines(self.line_ids) if not filtered_lines: - raise api.Warning(_('No lines will be changed. ' - 'All the selected lines are already done.')) + raise UserError(_('No lines will be changed. ' + 'All the selected lines are already done.')) self._mark_lines(filtered_lines, self.name) diff --git a/account_credit_control/wizard/credit_control_marker_view.xml b/account_credit_control/wizard/credit_control_marker_view.xml index c32cc8e18..e21f22c11 100644 --- a/account_credit_control/wizard/credit_control_marker_view.xml +++ b/account_credit_control/wizard/credit_control_marker_view.xml @@ -1,39 +1,41 @@ - - - + + - credit.line.marker.form - credit.control.marker - -
- - - - - - - - - - - - - - -
-
- -
+ credit.line.marker.form + credit.control.marker + +
+ + + + + + + + + + + + + + + + +
+
+ +
@@ -46,15 +48,14 @@ id="open_credit_line_marker_wizard_menu_action"/> - Change Lines' State - credit.control.marker - credit.control.line - form - form - - new - Change the state of the selected lines. + Change Lines' State + credit.control.marker + credit.control.line + form + form + + new + Change the state of the selected lines. -
-
+ diff --git a/account_credit_control/wizard/credit_control_policy_changer.py b/account_credit_control/wizard/credit_control_policy_changer.py index 6829d7aff..76ecefb3d 100644 --- a/account_credit_control/wizard/credit_control_policy_changer.py +++ b/account_credit_control/wizard/credit_control_policy_changer.py @@ -1,29 +1,16 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2014 Camptocamp SA -# -# 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 . -# -############################################################################## +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging -from openerp import models, fields, api, _ + +from odoo import _, api, fields, models +from odoo.exceptions import UserError + logger = logging.getLogger(__name__) -class credit_control_policy_changer(models.TransientModel): +class CreditControlPolicyChanger(models.TransientModel): """ Wizard that is run from invoices and allows to set manually a policy Policy are actually apply to related move lines availabe in selection widget @@ -52,18 +39,17 @@ class credit_control_policy_changer(models.TransientModel): context = self.env.context active_ids = context.get('active_ids') invoice_obj = self.env['account.invoice'] - move_line_obj = self.env['account.move.line'] if not active_ids: return False - selected_lines = move_line_obj.browse() + selected_lines = self.env['account.move.line'] for invoice in invoice_obj.browse(active_ids): if invoice.type in ('in_invoice', 'in_refund', 'out_refund'): - raise api.Warning(_('Please use wizard on customer invoices')) + raise UserError(_('Please use wizard on customer invoices')) domain = [('account_id', '=', invoice.account_id.id), ('move_id', '=', invoice.move_id.id), - ('reconcile_id', '=', False)] - move_lines = move_line_obj.search(domain) + ('reconciled', '=', False)] + move_lines = selected_lines.search(domain) selected_lines |= move_lines return selected_lines @@ -96,10 +82,7 @@ class credit_control_policy_changer(models.TransientModel): @api.model def _set_invoice_policy(self, move_lines, policy): """ Force policy on invoice """ - invoice_obj = self.env['account.invoice'] - invoice_ids = set(line.invoice.id for line in move_lines - if line.invoice) - invoices = invoice_obj.browse(invoice_ids) + invoices = move_lines.mapped('invoice_id') invoices.write({'credit_policy_id': policy.id}) @api.model diff --git a/account_credit_control/wizard/credit_control_policy_changer_view.xml b/account_credit_control/wizard/credit_control_policy_changer_view.xml index cee46799d..b4598c387 100644 --- a/account_credit_control/wizard/credit_control_policy_changer_view.xml +++ b/account_credit_control/wizard/credit_control_policy_changer_view.xml @@ -1,54 +1,54 @@ - - + - credit control policy form - credit.control.policy.changer - -
- -
- - Change current credit policy - credit.control.policy.changer - account.invoice - form - form - - new - Allows to manually change credit level + + Change current credit policy + credit.control.policy.changer + account.invoice + form + form + + new + Allows to manually change credit level @@ -60,5 +60,4 @@ key2="client_action_multi" id="action_wizard_credit_policy_changer_menu_action"/> -
-
+ diff --git a/account_credit_control/wizard/credit_control_printer.py b/account_credit_control/wizard/credit_control_printer.py index f6e0bf04d..33798cb38 100644 --- a/account_credit_control/wizard/credit_control_printer.py +++ b/account_credit_control/wizard/credit_control_printer.py @@ -1,25 +1,10 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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 . -# -############################################################################## +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, _ +from odoo import _, api, fields, models +from odoo.exceptions import UserError class CreditControlPrinter(models.TransientModel): @@ -57,7 +42,7 @@ class CreditControlPrinter(models.TransientModel): self.ensure_one() comm_obj = self.env['credit.control.communication'] if not self.line_ids: - raise api.Warning(_('No credit control lines selected.')) + raise UserError(_('No credit control lines selected.')) lines = self._get_lines(self.line_ids, self._credit_line_predicate) diff --git a/account_credit_control/wizard/credit_control_printer_view.xml b/account_credit_control/wizard/credit_control_printer_view.xml index 5a388ca9f..47d53db18 100644 --- a/account_credit_control/wizard/credit_control_printer_view.xml +++ b/account_credit_control/wizard/credit_control_printer_view.xml @@ -1,30 +1,29 @@ - - - + + - credit.line.printer.form - credit.control.printer - -
- - - - - - - - - - - -
-
- -
+ credit.line.printer.form + credit.control.printer + +
+ + + + + + + + + + + +
+
+ +
@@ -37,15 +36,14 @@ id="open_credit_line_printer_wizard_menu_action"/> - Print Lines - credit.control.printer - credit.control.line - form - form - - new - Print selected lines + Print Lines + credit.control.printer + credit.control.line + form + form + + new + Print selected lines -
-
+ From 26557ddb249003a7a95ebcfbae7e9c5012a95872 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Tue, 2 May 2017 12:19:24 +0200 Subject: [PATCH 2/5] account_credit_control: remove demo file. (cherry picked from commit c32d167ac05ebef2256e3cb5919c13e7b9229fdf) --- account_credit_control/__openerp__.py | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/account_credit_control/__openerp__.py b/account_credit_control/__openerp__.py index 2c33cdb88..5a7c07d28 100644 --- a/account_credit_control/__openerp__.py +++ b/account_credit_control/__openerp__.py @@ -29,6 +29,7 @@ 'email_template', ], 'website': 'http://www.camptocamp.com', +<<<<<<< c22b2dde9403c91dc4e4f0835f97c737e54bdb43:account_credit_control/__openerp__.py 'data': ["report/report.xml", "report/report_credit_control_summary.xml", "data.xml", @@ -46,6 +47,37 @@ 'demo': ["credit_control_demo.xml"], 'tests': [], 'installable': False, +======= + 'data': [ + "security/res_groups.xml", + # Reports + "report/report.xml", + "report/report_credit_control_summary.xml", + + # Data + "data/data.xml", + + # Views + "views/account_invoice.xml", + "views/credit_control_line.xml", + "views/credit_control_policy.xml", + "views/credit_control_run.xml", + "views/res_company.xml", + "views/res_partner.xml", + + # Wizards + "wizard/credit_control_emailer_view.xml", + "wizard/credit_control_marker_view.xml", + "wizard/credit_control_printer_view.xml", + "wizard/credit_control_policy_changer_view.xml", + + # Security + "security/ir.model.access.csv", + ], + 'demo': [ + ], + 'installable': True, +>>>>>>> account_credit_control: remove demo file.:account_credit_control/__manifest__.py 'license': 'AGPL-3', 'application': True } From 0d567fa4b0d48c91a53319b227d64d1c393bf121 Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Mon, 29 May 2017 18:34:23 +0200 Subject: [PATCH 3/5] Fix errors, improve menus, views, readme (cherry picked from commit 93a9b1ee4fd05c2a8fd97c305e392cab6a24f865) --- account_credit_control/__init__.py | 3 +++ account_credit_control/__openerp__.py | 22 +++---------------- account_credit_control/models/__init__.py | 3 +++ .../wizard/credit_control_policy_changer.py | 4 ++++ 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/account_credit_control/__init__.py b/account_credit_control/__init__.py index 7b23af6a9..4da4c748d 100644 --- a/account_credit_control/__init__.py +++ b/account_credit_control/__init__.py @@ -1,5 +1,8 @@ +<<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +======= +>>>>>>> Fix errors, improve menus, views, readme from . import models from . import wizard diff --git a/account_credit_control/__openerp__.py b/account_credit_control/__openerp__.py index 5a7c07d28..7d30d3e2a 100644 --- a/account_credit_control/__openerp__.py +++ b/account_credit_control/__openerp__.py @@ -1,23 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Nicolas Bessi, Guewen Baconnier -# Copyright 2012-2014 Camptocamp SA -# -# 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 . -# -############################################################################## +# Copyright 2012-2017 Camptocamp SA +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). {'name': 'Account Credit Control', 'version': '8.0.0.3.0', 'author': "Camptocamp,Odoo Community Association (OCA)", diff --git a/account_credit_control/models/__init__.py b/account_credit_control/models/__init__.py index 342e9b8cd..d43188956 100644 --- a/account_credit_control/models/__init__.py +++ b/account_credit_control/models/__init__.py @@ -1,6 +1,9 @@ +<<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +======= +>>>>>>> Fix errors, improve menus, views, readme from . import account_account from . import account_invoice from . import credit_control_line diff --git a/account_credit_control/wizard/credit_control_policy_changer.py b/account_credit_control/wizard/credit_control_policy_changer.py index 76ecefb3d..7991ff6b7 100644 --- a/account_credit_control/wizard/credit_control_policy_changer.py +++ b/account_credit_control/wizard/credit_control_policy_changer.py @@ -82,6 +82,10 @@ class CreditControlPolicyChanger(models.TransientModel): @api.model def _set_invoice_policy(self, move_lines, policy): """ Force policy on invoice """ +<<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 +======= + invoice_obj = self.env['account.invoice'] +>>>>>>> Fix errors, improve menus, views, readme invoices = move_lines.mapped('invoice_id') invoices.write({'credit_policy_id': policy.id}) From 74c9e631991292f619bd786c985743f4d988d678 Mon Sep 17 00:00:00 2001 From: Sylvain Van Hoof Date: Fri, 2 Jun 2017 10:18:24 +0200 Subject: [PATCH 4/5] Add some unit tests on the module account_credit_control (cherry picked from commit 7fa1b0ac883914f3cdfcaaa1a00016a35cced368) [IMP] Add some unitest and fix a bug with exceptions (cherry picked from commit c2f34ecd06fa5ba093084cf32f35c722c5866ff5) [FIX] Reindent line (cherry picked from commit b643a48f86b20ed6496f2e08366a407095d1540b) [IMP] Add some new unittests (cherry picked from commit f118e2391de3b443558d26186fe44f55a7f0b9c4) [IMP] Add encoding in each python files (cherry picked from commit 9599a88303b921c8e73174db61318f6dc9f02017) --- account_credit_control/__init__.py | 6 ++++++ account_credit_control/models/__init__.py | 6 ++++++ .../wizard/credit_control_policy_changer.py | 3 +++ 3 files changed, 15 insertions(+) diff --git a/account_credit_control/__init__.py b/account_credit_control/__init__.py index 4da4c748d..b233d1220 100644 --- a/account_credit_control/__init__.py +++ b/account_credit_control/__init__.py @@ -1,8 +1,14 @@ +<<<<<<< 3bb811bb84ec5c265d8e9245eff93a4a5f98059f <<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). ======= >>>>>>> Fix errors, improve menus, views, readme +======= +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +>>>>>>> Add some unit tests on the module account_credit_control from . import models from . import wizard diff --git a/account_credit_control/models/__init__.py b/account_credit_control/models/__init__.py index d43188956..4f36aa6a3 100644 --- a/account_credit_control/models/__init__.py +++ b/account_credit_control/models/__init__.py @@ -1,9 +1,15 @@ +<<<<<<< 3bb811bb84ec5c265d8e9245eff93a4a5f98059f <<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). ======= >>>>>>> Fix errors, improve menus, views, readme +======= +# -*- coding: utf-8 -*- +# Copyright 2017 Okia SPRL (https://okia.be) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +>>>>>>> Add some unit tests on the module account_credit_control from . import account_account from . import account_invoice from . import credit_control_line diff --git a/account_credit_control/wizard/credit_control_policy_changer.py b/account_credit_control/wizard/credit_control_policy_changer.py index 7991ff6b7..7a2b65d5d 100644 --- a/account_credit_control/wizard/credit_control_policy_changer.py +++ b/account_credit_control/wizard/credit_control_policy_changer.py @@ -82,10 +82,13 @@ class CreditControlPolicyChanger(models.TransientModel): @api.model def _set_invoice_policy(self, move_lines, policy): """ Force policy on invoice """ +<<<<<<< 3bb811bb84ec5c265d8e9245eff93a4a5f98059f <<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 ======= invoice_obj = self.env['account.invoice'] >>>>>>> Fix errors, improve menus, views, readme +======= +>>>>>>> Add some unit tests on the module account_credit_control invoices = move_lines.mapped('invoice_id') invoices.write({'credit_policy_id': policy.id}) From b125a794aec7d740e81a90c94cf31a3b230407fb Mon Sep 17 00:00:00 2001 From: cubells Date: Fri, 7 Jul 2017 11:12:50 +0200 Subject: [PATCH 5/5] [ADD] account_credit_control: backport from 10.0 --- account_credit_control/README.rst | 19 +- account_credit_control/__init__.py | 12 +- account_credit_control/__openerp__.py | 97 +-- account_credit_control/models/__init__.py | 10 +- .../models/account_account.py | 14 +- .../models/account_invoice.py | 11 +- .../models/credit_control_line.py | 229 ++++--- .../models/credit_control_policy.py | 106 ++-- .../models/credit_control_run.py | 46 +- account_credit_control/models/mail_mail.py | 10 +- account_credit_control/models/res_company.py | 22 +- account_credit_control/models/res_partner.py | 18 +- .../features/00_credit_control_param.feature | 61 -- .../01_credit_control_partners.feature | 105 ---- .../02_credit_control_invoices.feature | 588 ------------------ .../03_credit_control_run_jan.feature | 29 - .../04_credit_control_run_feb.feature | 33 - .../05_credit_control_run_mar.feature | 45 -- .../06_credit_control_run_apr.feature | 44 -- .../07_credit_control_run_may.feature | 59 -- .../08_credit_control_run_jun.feature | 38 -- .../09_credit_control_run_jul.feature | 35 -- .../10_credit_control_run_aug.feature | 30 - .../11_credit_control_manual_setting.feature | 42 -- .../features/steps/account_credit_control.py | 147 ----- .../steps/account_credit_control_changer.py | 79 --- .../features/steps/account_voucher.py | 96 --- account_credit_control/tests/__init__.py | 1 + .../tests/test_account_invoice.py | 9 +- .../tests/test_credit_control_policy.py | 4 +- .../tests/test_credit_control_run.py | 8 +- .../tests/test_res_partner.py | 4 +- .../views/account_invoice.xml | 1 + .../views/credit_control_line.xml | 3 +- .../views/credit_control_policy.xml | 3 +- .../views/credit_control_run.xml | 2 +- account_credit_control/views/res_company.xml | 2 + account_credit_control/views/res_partner.xml | 1 + .../{wizard => wizards}/__init__.py | 0 .../credit_control_communication.py | 3 +- .../credit_control_emailer.py | 4 +- .../credit_control_emailer_view.xml | 0 .../credit_control_marker.py | 4 +- .../credit_control_marker_view.xml | 5 +- .../credit_control_policy_changer.py | 11 +- .../credit_control_policy_changer_view.xml | 2 +- .../credit_control_printer.py | 4 +- .../credit_control_printer_view.xml | 3 +- 48 files changed, 360 insertions(+), 1739 deletions(-) delete mode 100644 account_credit_control/scenarios/features/00_credit_control_param.feature delete mode 100644 account_credit_control/scenarios/features/01_credit_control_partners.feature delete mode 100644 account_credit_control/scenarios/features/02_credit_control_invoices.feature delete mode 100644 account_credit_control/scenarios/features/03_credit_control_run_jan.feature delete mode 100644 account_credit_control/scenarios/features/04_credit_control_run_feb.feature delete mode 100644 account_credit_control/scenarios/features/05_credit_control_run_mar.feature delete mode 100644 account_credit_control/scenarios/features/06_credit_control_run_apr.feature delete mode 100644 account_credit_control/scenarios/features/07_credit_control_run_may.feature delete mode 100644 account_credit_control/scenarios/features/08_credit_control_run_jun.feature delete mode 100644 account_credit_control/scenarios/features/09_credit_control_run_jul.feature delete mode 100644 account_credit_control/scenarios/features/10_credit_control_run_aug.feature delete mode 100644 account_credit_control/scenarios/features/11_credit_control_manual_setting.feature delete mode 100644 account_credit_control/scenarios/features/steps/account_credit_control.py delete mode 100644 account_credit_control/scenarios/features/steps/account_credit_control_changer.py delete mode 100644 account_credit_control/scenarios/features/steps/account_voucher.py rename account_credit_control/{wizard => wizards}/__init__.py (100%) rename account_credit_control/{wizard => wizards}/credit_control_communication.py (99%) rename account_credit_control/{wizard => wizards}/credit_control_emailer.py (95%) rename account_credit_control/{wizard => wizards}/credit_control_emailer_view.xml (100%) rename account_credit_control/{wizard => wizards}/credit_control_marker.py (96%) rename account_credit_control/{wizard => wizards}/credit_control_marker_view.xml (95%) rename account_credit_control/{wizard => wizards}/credit_control_policy_changer.py (93%) rename account_credit_control/{wizard => wizards}/credit_control_policy_changer_view.xml (98%) rename account_credit_control/{wizard => wizards}/credit_control_printer.py (95%) rename account_credit_control/{wizard => wizards}/credit_control_printer_view.xml (95%) diff --git a/account_credit_control/README.rst b/account_credit_control/README.rst index 6b3b93c80..619a63d86 100644 --- a/account_credit_control/README.rst +++ b/account_credit_control/README.rst @@ -14,14 +14,18 @@ Just install it Configuration ============= -Configure the policies and policy levels in ``Accounting > Configuration > -Credit Control > Credit Control Policies``. -You can define as many policy levels as you need. +* Configure the policies and policy levels in **Accounting > Configuration > + Credit Control > Credit Control Policies**. You can define as many policy + levels as you need. -Configure a tolerance for the Credit control and a default policy -applied on all partners in each company, under the Accounting tab. +* You must add in every policy, to which account or accounts this policy is + applied. To do, you must go to "Accounts" tab in policy form. + +* Configure a tolerance for the Credit control and a default policy + applied on all partners in each company, under the Accounting tab. + +* You are able to specify a particular policy for one partner or one invoice. -You are able to specify a particular policy for one partner or one invoice. Usage ===== @@ -40,7 +44,7 @@ On each generated line, you have many choices: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/92/10.0 + :target: https://runbot.odoo-community.org/runbot/92/9.0 Bug Tracker =========== @@ -65,6 +69,7 @@ Contributors * Guewen Baconnier (Camptocamp) * Sylvain Van Hoof (Okia SPRL) * Akim Juillerat (Camptocamp +* Vicent Cubells Maintainer ---------- diff --git a/account_credit_control/__init__.py b/account_credit_control/__init__.py index b233d1220..aa9bb32bb 100644 --- a/account_credit_control/__init__.py +++ b/account_credit_control/__init__.py @@ -1,14 +1,6 @@ -<<<<<<< 3bb811bb84ec5c265d8e9245eff93a4a5f98059f -<<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -======= ->>>>>>> Fix errors, improve menus, views, readme -======= -# -*- coding: utf-8 -*- -# Copyright 2017 Okia SPRL (https://okia.be) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). ->>>>>>> Add some unit tests on the module account_credit_control + from . import models -from . import wizard +from . import wizards diff --git a/account_credit_control/__openerp__.py b/account_credit_control/__openerp__.py index 7d30d3e2a..1bb40c2f7 100644 --- a/account_credit_control/__openerp__.py +++ b/account_credit_control/__openerp__.py @@ -1,67 +1,38 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -{'name': 'Account Credit Control', - 'version': '8.0.0.3.0', - 'author': "Camptocamp,Odoo Community Association (OCA)", - 'maintainer': 'Camptocamp', - 'category': 'Finance', - 'complexity': "normal", - 'depends': ['base', - 'account', - 'email_template', - ], - 'website': 'http://www.camptocamp.com', -<<<<<<< c22b2dde9403c91dc4e4f0835f97c737e54bdb43:account_credit_control/__openerp__.py - 'data': ["report/report.xml", - "report/report_credit_control_summary.xml", - "data.xml", - "line_view.xml", - "account_view.xml", - "partner_view.xml", - "policy_view.xml", - "run_view.xml", - "company_view.xml", - "wizard/credit_control_emailer_view.xml", - "wizard/credit_control_marker_view.xml", - "wizard/credit_control_printer_view.xml", - "wizard/credit_control_policy_changer_view.xml", - "security/ir.model.access.csv"], - 'demo': ["credit_control_demo.xml"], - 'tests': [], - 'installable': False, -======= - 'data': [ - "security/res_groups.xml", - # Reports - "report/report.xml", - "report/report_credit_control_summary.xml", - - # Data - "data/data.xml", - - # Views - "views/account_invoice.xml", - "views/credit_control_line.xml", - "views/credit_control_policy.xml", - "views/credit_control_run.xml", - "views/res_company.xml", - "views/res_partner.xml", - - # Wizards - "wizard/credit_control_emailer_view.xml", - "wizard/credit_control_marker_view.xml", - "wizard/credit_control_printer_view.xml", - "wizard/credit_control_policy_changer_view.xml", - - # Security - "security/ir.model.access.csv", - ], - 'demo': [ - ], - 'installable': True, ->>>>>>> account_credit_control: remove demo file.:account_credit_control/__manifest__.py - 'license': 'AGPL-3', - 'application': True - } +{ + 'name': 'Account Credit Control', + 'version': '9.0.0.1.0', + 'author': "Camptocamp, " + "Tecnativa, " + "Odoo Community Association (OCA)", + 'license': 'AGPL-3', + 'category': 'Finance', + 'depends': [ + 'base', + 'account', + 'mail', + ], + 'website': 'http://www.camptocamp.com', + 'data': [ + "security/res_groups.xml", + "report/report.xml", + "report/report_credit_control_summary.xml", + "data/data.xml", + "views/account_invoice.xml", + "views/credit_control_line.xml", + "views/credit_control_policy.xml", + "views/credit_control_run.xml", + "views/res_company.xml", + "views/res_partner.xml", + "wizards/credit_control_emailer_view.xml", + "wizards/credit_control_marker_view.xml", + "wizards/credit_control_printer_view.xml", + "wizards/credit_control_policy_changer_view.xml", + "security/ir.model.access.csv", + ], + 'installable': True, +} diff --git a/account_credit_control/models/__init__.py b/account_credit_control/models/__init__.py index 4f36aa6a3..6d929418d 100644 --- a/account_credit_control/models/__init__.py +++ b/account_credit_control/models/__init__.py @@ -1,15 +1,7 @@ -<<<<<<< 3bb811bb84ec5c265d8e9245eff93a4a5f98059f -<<<<<<< f4a71683cf11965d8ffc1f5016e254fe6aa2eaf5 # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -======= ->>>>>>> Fix errors, improve menus, views, readme -======= -# -*- coding: utf-8 -*- -# Copyright 2017 Okia SPRL (https://okia.be) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). ->>>>>>> Add some unit tests on the module account_credit_control + from . import account_account from . import account_invoice from . import credit_control_line diff --git a/account_credit_control/models/account_account.py b/account_credit_control/models/account_account.py index 2face2a5b..1b77be6dc 100644 --- a/account_credit_control/models/account_account.py +++ b/account_credit_control/models/account_account.py @@ -1,8 +1,10 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models + +from openerp import fields, models class AccountAccount(models.Model): @@ -10,7 +12,9 @@ class AccountAccount(models.Model): _inherit = "account.account" - credit_control_line_ids = fields.One2many('credit.control.line', - 'account_id', - string='Credit Lines', - readonly=True) + credit_control_line_ids = fields.One2many( + comodel_name='credit.control.line', + inverse_name='account_id', + string='Credit Lines', + readonly=True, + ) diff --git a/account_credit_control/models/account_invoice.py b/account_credit_control/models/account_invoice.py index 5cc66de22..527ad093c 100644 --- a/account_credit_control/models/account_invoice.py +++ b/account_credit_control/models/account_invoice.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models -from odoo.exceptions import UserError + +from openerp import _, api, fields, models +from openerp.exceptions import UserError class AccountInvoice(models.Model): @@ -11,7 +13,7 @@ class AccountInvoice(models.Model): _inherit = 'account.invoice' credit_policy_id = fields.Many2one( - 'credit.control.policy', + comodel_name='credit.control.policy', string='Credit Control Policy', help="The Credit Control Policy used for this " "invoice. If nothing is defined, it will " @@ -25,7 +27,8 @@ class AccountInvoice(models.Model): ) credit_control_line_ids = fields.One2many( - 'credit.control.line', 'invoice_id', + comodel_name='credit.control.line', + inverse_name='invoice_id', string='Credit Lines', readonly=True, copy=False, diff --git a/account_credit_control/models/credit_control_line.py b/account_credit_control/models/credit_control_line.py index d052b3669..b5d6bfb7f 100644 --- a/account_credit_control/models/credit_control_line.py +++ b/account_credit_control/models/credit_control_line.py @@ -1,11 +1,13 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + import logging -from odoo import _, api, fields, models -from odoo.exceptions import UserError +from openerp import _, api, fields, models +from openerp.exceptions import UserError logger = logging.getLogger(__name__) @@ -23,107 +25,136 @@ class CreditControlLine(models.Model): _rec_name = "id" _order = "date DESC" - date = fields.Date(string='Controlling date', - required=True, - index=True) + date = fields.Date( + string='Controlling date', + required=True, + index=True, + ) # maturity date of related move line we do not use # a related field in order to # allow manual changes - date_due = fields.Date(string='Due date', - required=True, - readonly=True, - states={'draft': [('readonly', False)]}) - - date_entry = fields.Date(string='Entry date', - related='move_line_id.date', - store=True, - readonly=True) - - date_sent = fields.Date(string='Sent date', - readonly=True, - states={'draft': [('readonly', False)]}) - - state = fields.Selection([('draft', 'Draft'), - ('ignored', 'Ignored'), - ('to_be_sent', 'Ready To Send'), - ('sent', 'Done'), - ('error', 'Error'), - ('email_error', 'Emailing Error')], - 'State', - required=True, - readonly=True, - default='draft', - help="Draft lines need to be triaged.\n" - "Ignored lines are lines for which we do " - "not want to send something.\n" - "Draft and ignored lines will be " - "generated again on the next run.") - - channel = fields.Selection([('letter', 'Letter'), - ('email', 'Email')], - string='Channel', - required=True, - readonly=True, - states={'draft': [('readonly', False)]}) - - invoice_id = fields.Many2one('account.invoice', - string='Invoice', - readonly=True) - - partner_id = fields.Many2one('res.partner', - string='Partner', - required=True) - - amount_due = fields.Float(string='Due Amount Tax incl.', - required=True, readonly=True) - - balance_due = fields.Float(string='Due balance', required=True, - readonly=True) - - mail_message_id = fields.Many2one('mail.mail', string='Sent Email', - readonly=True) - - move_line_id = fields.Many2one('account.move.line', - string='Move line', - required=True, - readonly=True) - - account_id = fields.Many2one('account.account', - related='move_line_id.account_id', - store=True, - readonly=True) - - currency_id = fields.Many2one('res.currency', - related='move_line_id.currency_id', - store=True, - readonly=True) - - company_id = fields.Many2one('res.company', - related='move_line_id.company_id', - store=True, - readonly=True) - + date_due = fields.Date( + string='Due date', + required=True, + readonly=True, + states={'draft': [('readonly', False)]}, + ) + date_entry = fields.Date( + string='Entry date', + related='move_line_id.date', + store=True, + readonly=True, + ) + date_sent = fields.Date( + string='Sent date', + readonly=True, + states={'draft': [('readonly', False)]}, + ) + state = fields.Selection( + selection=[ + ('draft', 'Draft'), + ('ignored', 'Ignored'), + ('to_be_sent', 'Ready To Send'), + ('sent', 'Done'), + ('error', 'Error'), + ('email_error', 'Emailing Error'), + ], + string='State', + required=True, + readonly=True, + default='draft', + help="Draft lines need to be triaged.\n" + "Ignored lines are lines for which we do " + "not want to send something.\n" + "Draft and ignored lines will be " + "generated again on the next run.", + ) + channel = fields.Selection( + selection=[ + ('letter', 'Letter'), + ('email', 'Email'), + ], + string='Channel', + required=True, + readonly=True, + states={'draft': [('readonly', False)]}, + ) + invoice_id = fields.Many2one( + comodel_name='account.invoice', + string='Invoice', + readonly=True, + ) + partner_id = fields.Many2one( + comodel_name='res.partner', + string='Partner', + required=True, + ) + amount_due = fields.Float( + string='Due Amount Tax incl.', + required=True, + readonly=True, + ) + balance_due = fields.Float( + string='Due balance', + required=True, + readonly=True, + ) + mail_message_id = fields.Many2one( + comodel_name='mail.mail', + string='Sent Email', + readonly=True, + ) + move_line_id = fields.Many2one( + comodel_name='account.move.line', + string='Move line', + required=True, + readonly=True, + ) + account_id = fields.Many2one( + comodel_name='account.account', + related='move_line_id.account_id', + store=True, + readonly=True, + ) + currency_id = fields.Many2one( + comodel_name='res.currency', + related='move_line_id.currency_id', + store=True, + readonly=True, + ) + company_id = fields.Many2one( + comodel_name='res.company', + related='move_line_id.company_id', + store=True, + readonly=True, + ) # we can allow a manual change of policy in draft state - policy_level_id = fields.Many2one('credit.control.policy.level', - string='Overdue Level', - required=True, - readonly=True, - states={'draft': [('readonly', False)]}) - - policy_id = fields.Many2one('credit.control.policy', - related='policy_level_id.policy_id', - store=True, - readonly=True) - - level = fields.Integer('Level', - related='policy_level_id.level', - store=True, - readonly=True) - - manually_overridden = fields.Boolean(string='Manually overridden') - - run_id = fields.Many2one(comodel_name='credit.control.run', - string='Source') + policy_level_id = fields.Many2one( + comodel_name='credit.control.policy.level', + string='Overdue Level', + required=True, + readonly=True, + states={'draft': [('readonly', False)]}, + ) + policy_id = fields.Many2one( + comodel_name='credit.control.policy', + related='policy_level_id.policy_id', + store=True, + readonly=True, + ) + level = fields.Integer( + string='Level', + related='policy_level_id.level', + store=True, + readonly=True, + ) + manually_overridden = fields.Boolean( + string='Manually overridden', + ) + run_id = fields.Many2one( + comodel_name='credit.control.run', + string='Source', + ) @api.model def _prepare_from_move_line(self, move_line, level, controlling_date, diff --git a/account_credit_control/models/credit_control_policy.py b/account_credit_control/models/credit_control_policy.py index 252712672..99643c1da 100644 --- a/account_credit_control/models/credit_control_policy.py +++ b/account_credit_control/models/credit_control_policy.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models -from odoo.exceptions import UserError, ValidationError + +from openerp import _, api, fields, models +from openerp.exceptions import UserError, ValidationError class CreditControlPolicy(models.Model): @@ -12,23 +14,32 @@ class CreditControlPolicy(models.Model): _name = "credit.control.policy" _description = """Define a reminder policy""" - name = fields.Char('Name', required=True) - level_ids = fields.One2many('credit.control.policy.level', - 'policy_id', - string='Policy Levels') - do_nothing = fields.Boolean('Do nothing', - help='For policies which should not ' - 'generate lines or are obsolete') - company_id = fields.Many2one('res.company', string='Company') + name = fields.Char( + required=True, + ) + level_ids = fields.One2many( + comodel_name='credit.control.policy.level', + inverse_name='policy_id', + string='Policy Levels', + ) + do_nothing = fields.Boolean( + help='For policies which should not generate lines or are obsolete', + ) + company_id = fields.Many2one( + comodel_name='res.company', + string='Company', + ) account_ids = fields.Many2many( - 'account.account', + comodel_name='account.account', string='Accounts', required=True, domain="[('internal_type', '=', 'receivable')]", help="This policy will be active only" " for the selected accounts", ) - active = fields.Boolean('Active', default=True) + active = fields.Boolean( + default=True, + ) @api.multi def _move_lines_domain(self, controlling_date): @@ -199,31 +210,54 @@ class CreditControlPolicyLevel(models.Model): _order = 'level' _description = """A credit control policy level""" - name = fields.Char(string='Name', required=True, translate=True) - policy_id = fields.Many2one('credit.control.policy', - string='Related Policy', - required=True) - level = fields.Integer(string='Level', required=True) - computation_mode = fields.Selection( - [('net_days', 'Due Date'), - ('end_of_month', 'Due Date, End Of Month'), - ('previous_date', 'Previous Reminder')], - string='Compute Mode', - required=True + name = fields.Char( + required=True, + translate=True, + ) + policy_id = fields.Many2one( + comodel_name='credit.control.policy', + string='Related Policy', + required=True, + ) + level = fields.Integer( + required=True, + ) + computation_mode = fields.Selection( + selection=[ + ('net_days', 'Due Date'), + ('end_of_month', 'Due Date, End Of Month'), + ('previous_date', 'Previous Reminder'), + ], + string='Compute Mode', + required=True, + ) + delay_days = fields.Integer( + string='Delay (in days)', + required=True, + ) + email_template_id = fields.Many2one( + comodel_name='mail.template', + string='Email Template', + required=True, + ) + channel = fields.Selection( + selection=[ + ('letter', 'Letter'), + ('email', 'Email'), + ], + string='Channel', + required=True, + ) + custom_text = fields.Text( + string='Custom Message', + required=True, + translate=True, + ) + custom_mail_text = fields.Html( + string='Custom Mail Message', + required=True, + translate=True, ) - delay_days = fields.Integer(string='Delay (in days)', required=True) - email_template_id = fields.Many2one('mail.template', - string='Email Template', - required=True) - channel = fields.Selection([('letter', 'Letter'), - ('email', 'Email')], - string='Channel', - required=True) - custom_text = fields.Text(string='Custom Message', - required=True, - translate=True) - custom_mail_text = fields.Html(string='Custom Mail Message', - required=True, translate=True) _sql_constraint = [('unique level', 'UNIQUE (policy_id, level)', diff --git a/account_credit_control/models/credit_control_run.py b/account_credit_control/models/credit_control_run.py index 4bd4ee2e1..8426580cf 100644 --- a/account_credit_control/models/credit_control_run.py +++ b/account_credit_control/models/credit_control_run.py @@ -1,11 +1,13 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + import logging -from odoo import _, api, fields, models -from odoo.exceptions import UserError +from openerp import _, api, fields, models +from openerp.exceptions import UserError logger = logging.getLogger(__name__) @@ -17,16 +19,18 @@ class CreditControlRun(models.Model): _rec_name = 'date' _description = "Credit control line generator" - date = fields.Date(string='Controlling Date', required=True, - readonly=True, - states={'draft': [('readonly', False)]}) - @api.model def _get_policies(self): return self.env['credit.control.policy'].search([]) + date = fields.Date( + string='Controlling Date', + required=True, + readonly=True, + states={'draft': [('readonly', False)]}, + ) policy_ids = fields.Many2many( - 'credit.control.policy', + comodel_name='credit.control.policy', rel="credit_run_policy_rel", id1='run_id', id2='policy_id', string='Policies', @@ -34,21 +38,29 @@ class CreditControlRun(models.Model): states={'draft': [('readonly', False)]}, default=_get_policies, ) - report = fields.Html(string='Report', readonly=True, copy=False) - state = fields.Selection([('draft', 'Draft'), - ('done', 'Done')], - string='State', - required=True, - readonly=True, - default='draft') - + report = fields.Html( + string='Report', + readonly=True, + copy=False, + ) + state = fields.Selection( + selection=[ + ('draft', 'Draft'), + ('done', 'Done'), + ], + string='State', + required=True, + readonly=True, + default='draft', + ) line_ids = fields.One2many( comodel_name='credit.control.line', inverse_name='run_id', - string='Generated lines') + string='Generated lines', + ) manual_ids = fields.Many2many( - 'account.move.line', + comodel_name='account.move.line', rel="credit_runreject_rel", string='Lines to handle manually', help='If a credit control line has been generated' diff --git a/account_credit_control/models/mail_mail.py b/account_credit_control/models/mail_mail.py index 3b5f95acb..59eb7130d 100644 --- a/account_credit_control/models/mail_mail.py +++ b/account_credit_control/models/mail_mail.py @@ -1,13 +1,17 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models + +from openerp import fields, models class Mail(models.Model): _inherit = 'mail.mail' # use HTML fields instead of text - body_html = fields.Html('Rich-text Contents', - help="Rich-text/HTML message") + body_html = fields.Html( + string='Rich-text Contents', + help="Rich-text/HTML message", + ) diff --git a/account_credit_control/models/res_company.py b/account_credit_control/models/res_company.py index 4ae6dc332..b5bbebd2a 100644 --- a/account_credit_control/models/res_company.py +++ b/account_credit_control/models/res_company.py @@ -1,21 +1,25 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models + +from openerp import fields, models class ResCompany(models.Model): """ Add credit control parameters """ _inherit = 'res.company' - credit_control_tolerance = fields.Float(string='Credit Control Tolerance', - default=0.1) + credit_control_tolerance = fields.Float( + string='Credit Control Tolerance', + default=0.1, + ) # This is not a property on the partner because we cannot search # on fields.property (subclass fields.function). - credit_policy_id = fields.Many2one('credit.control.policy', - string='Credit Control Policy', - help="The Credit Control Policy used " - "on partners by default. " - "This setting can be overridden" - " on partners or invoices.") + credit_policy_id = fields.Many2one( + comodel_name='credit.control.policy', + string='Credit Control Policy', + help="The Credit Control Policy used on partners by default. " + "This setting can be overridden on partners or invoices.", + ) diff --git a/account_credit_control/models/res_partner.py b/account_credit_control/models/res_partner.py index b43e43d15..e12a3e143 100644 --- a/account_credit_control/models/res_partner.py +++ b/account_credit_control/models/res_partner.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models -from odoo.exceptions import UserError, ValidationError + +from openerp import api, fields, models +from openerp.exceptions import UserError, ValidationError class ResPartner(models.Model): @@ -14,7 +16,7 @@ class ResPartner(models.Model): _inherit = "res.partner" credit_policy_id = fields.Many2one( - 'credit.control.policy', + comodel_name='credit.control.policy', string='Credit Control Policy', domain="[('account_ids', 'in', property_account_receivable_id)]", help="The Credit Control Policy used for this " @@ -22,10 +24,12 @@ class ResPartner(models.Model): "invoice. If nothing is defined, it will use " "the company setting.", ) - credit_control_line_ids = fields.One2many('credit.control.line', - 'invoice_id', - string='Credit Control Lines', - readonly=True) + credit_control_line_ids = fields.One2many( + comodel_name='credit.control.line', + inverse_name='invoice_id', + string='Credit Control Lines', + readonly=True, + ) @api.constrains('credit_policy_id', 'property_account_receivable_id') def _check_credit_policy(self): diff --git a/account_credit_control/scenarios/features/00_credit_control_param.feature b/account_credit_control/scenarios/features/00_credit_control_param.feature deleted file mode 100644 index c02bb6384..000000000 --- a/account_credit_control/scenarios/features/00_credit_control_param.feature +++ /dev/null @@ -1,61 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2009 Camptocamp SA -# -# -# The base scenario for the finance data must be executed before this -# one. The finance scenario is included in the oerpscenario base and -# the tag to run it is: @base_finance -# -# -############################################################################## -############################################################################## -# Branch # Module # Processes # System -@account_credit_control @account_credit_control_setup - -Feature: General parameters in order to test the credit control module - - - @account_credit_control_setup_install_modules - Scenario: MODULES INSTALLATION - - Given I do not want all demo data to be loaded on install - Given I install the required modules with dependencies: - | name | - | account_credit_control | - - Then my modules should have been installed and models reloaded - - - @deactivate_journal_control - Scenario: Journal setup to avoid unfixed voucher bug - Given I execute the SQL commands - """ - UPDATE account_journal SET allow_date = false; - """ - - @email_params_mailtrap - Scenario: E-MAIL PARAMS WITH EMAIL EATER (http://mailtrap.io) - Given I need a "ir.mail_server" with name: mailstrap_testings - And having: - | name | value | - | smtp_host | mailtrap.io | - | sequence | 1 | - | smtp_port | 2525 | - | smtp_user | camptocamp1 | - | smtp_pass | 20468fa2f2879cb9 | - - @account_credit_control_policy_2_times - Scenario: Configure the credit control policy in 2 times - Given I configure the following accounts on the credit control policy with oid: "account_credit_control.credit_control_2_time": - | account code | - | 4111 | - | 4112 | - - @account_credit_control_policy_3_times - Scenario: Configure the credit control policy in 3 times - Given I configure the following accounts on the credit control policy with oid: "account_credit_control.credit_control_3_time": - | account code | - | 4111 | - | 4112 | diff --git a/account_credit_control/scenarios/features/01_credit_control_partners.feature b/account_credit_control/scenarios/features/01_credit_control_partners.feature deleted file mode 100644 index 9edb192c7..000000000 --- a/account_credit_control/scenarios/features/01_credit_control_partners.feature +++ /dev/null @@ -1,105 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2009 Camptocamp SA -# -############################################################################## -############################################################################## -# Branch # Module # Processes # System -@account_credit_control @account_credit_control_add_policy @account_credit_control_setup - -Feature: I add policy to partners already created - @account_credit_control_partner_1 - Scenario: Partner_1 - Given I need a "res.partner" with oid: scen.partner_1 - And having: - | name | value | - | name | partner_1 | - | credit_policy_id | by name: No follow | - - @account_credit_control_customer_1 - Scenario: Customer_1 - Given I need a "res.partner" with oid: scen.customer_1 - And having: - | name | value | - | name | customer_1 | - | credit_policy_id | by name: 2 time policy | - - @account_credit_control_customer_2 - Scenario: Customer_2 - Given I need a "res.partner" with oid: scen.customer_2 - And having: - | name | value | - | name | customer_2 | - | credit_policy_id | by name: 2 time policy | - - @account_credit_control_customer_3 - Scenario: Customer_3 - Given I need a "res.partner" with oid: scen.customer_3 - And having: - | name | value | - | name | customer_3 | - | credit_policy_id | by name: 2 time policy | - - @account_credit_control_customer_4 - Scenario: Customer_4 - Given I need a "res.partner" with oid: scen.customer_4 - And having: - | name | value | - | name | customer_4 | - # the credit policy must be 3 time policy (inherited from company) - - @account_credit_control_customer_5 - Scenario: Customer_5 - Given I need a "res.partner" with oid: scen.customer_5 - And having: - | name | value | - | name | customer_5_usd | - | credit_policy_id | by name: 3 time policy | - - @account_credit_control_customer_6 - Scenario: Customer_6 - Given I need a "res.partner" with oid: scen.customer_6 - And having: - | name | value | - | name | customer_6 | - | credit_policy_id | by name: 3 time policy | - - @account_credit_control_customer_partial_pay - Scenario: A customer who like to do partial payments - Given I need a "res.partner" with oid: scen.customer_partial_pay - And having: - | name | value | - | name | Scrooge McDuck | - | zip | 1000 | - | city | Duckburg | - | email | openerp@locahost.dummy | - | phone | | - | street | Duckstreet | - - - @account_credit_control_customer_multiple_payterm - Scenario: A customer who use payment terms in 2 times - Given I need a "res.partner" with oid: scen.customer_multiple_payterm - And having: - | name | value | - | name | Donald Duck | - | zip | 1100 | - | city | Duckburg | - | email | openerp@locahost.dummy | - | phone | | - | street | Duckstreet | - - @account_credit_control_customer_multiple_payterm2 - Scenario: A customer who use payment terms in 2 times - Given I need a "res.partner" with oid: scen.customer_multiple_payterm2 - And having: - | name | value | - | name | Gus Goose | - | type | default | - | name | Gus Goose | - | zip | 1100 | - | city | Duckburg | - | email | openerp@locahost.dummy | - | phone | | - | street | Duckstreet | diff --git a/account_credit_control/scenarios/features/02_credit_control_invoices.feature b/account_credit_control/scenarios/features/02_credit_control_invoices.feature deleted file mode 100644 index a153d39f7..000000000 --- a/account_credit_control/scenarios/features/02_credit_control_invoices.feature +++ /dev/null @@ -1,588 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - - -@account_credit_control @account_credit_control_setup @account_credit_control_base_data @account_credit_control_invoices - -Feature: Invoices creation - -##################### Partner 1 ########################################################## - - @inv_1 - Scenario: Create invoice 1 - - Given I need a "account.invoice" with oid: scen._inv_1 - And having: - | name | value | - | name | SI_1 | - | date_invoice | 2013-01-15 | - | partner_id | by oid: scen.partner_1 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30 Days End of Month | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv1_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1000 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_1 | - Given I find a "account.invoice" with oid: scen._inv_1 - - Given I need a "account.invoice.line" with oid: scen._inv1_line2 - And having: - | name | value | - | name | invoice line 2 | - | quantity | 1 | - | price_unit | 1000 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_1 | - Given I find a "account.invoice" with oid: scen._inv_1 - And I open the credit invoice - - @inv_2 - Scenario: Create invoice 2 - Given I need a "account.invoice" with oid: scen._inv_2 - And having: - | name | value | - | name | SI_2 | - | date_invoice | 2013-02-15 | - | partner_id | by oid: scen.partner_1 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Days End of Month | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv2_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1200 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_2 | - Given I find a "account.invoice" with oid: scen._inv_2 - And I open the credit invoice - - - @inv_3 - Scenario: Create invoice 3 - Given I need a "account.invoice" with oid: scen._inv_3 - And having: - | name | value | - | name | SI_3 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.partner_1 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Days End of Month | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv3_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_3 | - Given I find a "account.invoice" with oid: scen._inv_3 - And I open the credit invoice - -##################### Customer 2 ########################################################## - - @inv_4 - Scenario: Create invoice 4 - - Given I need a "account.invoice" with oid: scen._inv_4 - And having: - | name | value | - | name | SI_4 | - | date_invoice | 2013-01-18 | - | partner_id | by oid: scen.customer_2 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30 Days End of Month | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv4_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1000 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_4 | - Given I find a "account.invoice" with oid: scen._inv_4 - And I open the credit invoice - - - - @inv_5 - Scenario: Create invoice 5 - Given I need a "account.invoice" with oid: scen._inv_5 - And having: - | name | value | - | name | SI_5 | - | date_invoice | 2013-02-15 | - | partner_id | by oid: scen.customer_2 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Days End of Month | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv5_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1200 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_5 | - Given I find a "account.invoice" with oid: scen._inv_5 - And I open the credit invoice - - - @inv_6 - Scenario: Create invoice 6 - Given I need a "account.invoice" with oid: scen._inv_6 - And having: - | name | value | - | name | SI_6 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_2 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Days End of Month | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv6_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_6 | - Given I find a "account.invoice" with oid: scen._inv_6 - And I open the credit invoice - -##################### Customer 3 ########################################################## - - @inv_7 - Scenario: Create invoice 7 - - Given I need a "account.invoice" with oid: scen._inv_7 - And having: - | name | value | - | name | SI_7 | - | date_invoice | 2013-01-18 | - | partner_id | by oid: scen.customer_3 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv7_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1000 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_7 | - Given I find a "account.invoice" with oid: scen._inv_7 - And I open the credit invoice - - - - @inv_8 - Scenario: Create invoice 8 - Given I need a "account.invoice" with oid: scen._inv_8 - And having: - | name | value | - | name | SI_8 | - | date_invoice | 2013-02-15 | - | partner_id | by oid: scen.customer_3 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv8_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1200 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_8 | - Given I find a "account.invoice" with oid: scen._inv_8 - And I open the credit invoice - - - @inv_9 - Scenario: Create invoice 9 - Given I need a "account.invoice" with oid: scen._inv_9 - And having: - | name | value | - | name | SI_9 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_3 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv9_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_9 | - Given I find a "account.invoice" with oid: scen._inv_9 - And I open the credit invoice - -##################### Customer 4 ########################################################## - - @inv_10 - Scenario: Create invoice 10 - - Given I need a "account.invoice" with oid: scen._inv_10 - And having: - | name | value | - | name | SI_10 | - | date_invoice | 2013-01-18 | - | partner_id | by oid: scen.customer_4 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30% Advance End 30 Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv10_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1000 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_10 | - Given I find a "account.invoice" with oid: scen._inv_10 - And I open the credit invoice - - - - @inv_11 - Scenario: Create invoice 11 - Given I need a "account.invoice" with oid: scen._inv_11 - And having: - | name | value | - | name | SI_11 | - | date_invoice | 2013-02-15 | - | partner_id | by oid: scen.customer_4 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30% Advance End 30 Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv11_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1200 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_11 | - Given I find a "account.invoice" with oid: scen._inv_11 - And I open the credit invoice - - - @inv_12 - Scenario: Create invoice 12 - Given I need a "account.invoice" with oid: scen._inv_12 - And having: - | name | value | - | name | SI_12 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_4 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30% Advance End 30 Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv12_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_12 | - Given I find a "account.invoice" with oid: scen._inv_12 - And I open the credit invoice - -##################### Customer 5 ########################################################## - - @inv_13 - Scenario: Create invoice 13 - - Given I need a "account.invoice" with oid: scen._inv_13 - And having: - | name | value | - | name | SI_13 | - | date_invoice | 2013-01-18 | - | partner_id | by oid: scen.customer_5 | - | account_id | by name: Debtors USD | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv13_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1000 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_13 | - Given I find a "account.invoice" with oid: scen._inv_13 - And I open the credit invoice - - - - @inv_14 - Scenario: Create invoice 14 - Given I need a "account.invoice" with oid: scen._inv_14 - And having: - | name | value | - | name | SI_14 | - | date_invoice | 2013-02-15 | - | partner_id | by oid: scen.customer_5 | - | account_id | by name: Debtors USD | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv14_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1200 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_14 | - Given I find a "account.invoice" with oid: scen._inv_14 - And I open the credit invoice - - - @inv_15 - Scenario: Create invoice 15 - Given I need a "account.invoice" with oid: scen._inv_15 - And having: - | name | value | - | name | SI_15 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_5 | - | account_id | by name: Debtors USD | - | journal_id | by name: Sales | - | currency_id | by name: USD | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - - Given I need a "account.invoice.line" with oid: scen._inv15_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_15 | - Given I find a "account.invoice" with oid: scen._inv_15 - And I open the credit invoice - - @inv_16 - Scenario: Create invoice 16 - Given I need a "account.invoice" with oid: scen._inv_16 - And having: - | name | value | - | name | SI_16 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_4 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - And I need a "account.invoice.line" with oid: scen._inv16_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_16 | - Then I find a "account.invoice" with oid: scen._inv_16 - And I open the credit invoice - - @inv_17 - Scenario: Create invoice 17 - Given I need a "account.invoice" with oid: scen._inv_17 - And having: - | name | value | - | name | SI_17 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_partial_pay | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - And I need a "account.invoice.line" with oid: scen._inv17_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_17 | - Then I find a "account.invoice" with oid: scen._inv_17 - And I open the credit invoice - - @inv_18 - Scenario: Create invoice 18 - Given I need a "account.invoice" with oid: scen._inv_18 - And having: - | name | value | - | name | SI_18 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_multiple_payterm | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30% Advance End 30 Days | - | type | out_invoice | - - And I need a "account.invoice.line" with oid: scen._inv18_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_18 | - Then I find a "account.invoice" with oid: scen._inv_18 - And I open the credit invoice - - @inv_19 - Scenario: Create invoice 19 - Given I need a "account.invoice" with oid: scen._inv_19 - And having: - | name | value | - | name | SI_19 | - | date_invoice | 2013-03-15 | - | partner_id | by oid: scen.customer_multiple_payterm2 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30% Advance End 30 Days | - | type | out_invoice | - And I need a "account.invoice.line" with oid: scen._inv19_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 1500 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_19 | - Then I find a "account.invoice" with oid: scen._inv_19 - And I open the credit invoice - - @inv_20 - Scenario: Create invoice 20 - Given I need a "account.invoice" with oid: scen._inv_20 - And having: - | name | value | - | name | SI_20_test_tolerance | - | date_invoice | 2013-03-23 | - | partner_id | by oid: scen.customer_6 | - | account_id | by name: Debtors | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - And I need a "account.invoice.line" with oid: scen._inv20_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 0.09 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_20 | - Then I find a "account.invoice" with oid: scen._inv_20 - And I open the credit invoice - - @inv_20 - Scenario: Create invoice 21 (this receivable account must not be chased-> no credit line creation) - Given I need a "account.invoice" with oid: scen._inv_21 - And having: - | name | value | - | name | SI_21_test_receivable_account_excluded | - | date_invoice | 2013-03-25 | - | partner_id | by oid: scen.customer_6 | - | account_id | by name: Debtors GBP | - | journal_id | by name: Sales | - | currency_id | by name: EUR | - | payment_term | by name: 30 Net Days | - | type | out_invoice | - - And I need a "account.invoice.line" with oid: scen._inv21_line1 - And having: - | name | value | - | name | invoice line 1 | - | quantity | 1 | - | price_unit | 6666 | - | account_id | by name: Sales | - | invoice_id | by oid: scen._inv_21 | - Then I find a "account.invoice" with oid: scen._inv_21 - And I open the credit invoice diff --git a/account_credit_control/scenarios/features/03_credit_control_run_jan.feature b/account_credit_control/scenarios/features/03_credit_control_run_jan.feature deleted file mode 100644 index 9839f9bf1..000000000 --- a/account_credit_control/scenarios/features/03_credit_control_run_jan.feature +++ /dev/null @@ -1,29 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_jan - -Feature: Ensure that mail credit line generation first pass is correct - - Scenario: clean data - Given I clean all the credit lines - #Given I unreconcile and clean all move line - - @account_credit_control_run_month - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.run1 - And having: - | name | value | - | date | 2013-01-31 | - When I launch the credit run - Then my credit run should be in state "done" - And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 300 | 2013-01-18 | Debtors | 3 time policy | 2013-01-31 | customer_4 | email | 1 | SI_10 | 10 days net | draft | 300 | | diff --git a/account_credit_control/scenarios/features/04_credit_control_run_feb.feature b/account_credit_control/scenarios/features/04_credit_control_run_feb.feature deleted file mode 100644 index f9b1865ca..000000000 --- a/account_credit_control/scenarios/features/04_credit_control_run_feb.feature +++ /dev/null @@ -1,33 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_feb - -Feature: Ensure that mail credit line generation first pass is correct - - @account_credit_control_mark - Scenario: mark lines - Given there is "draft" credit lines - And I mark all draft email to state "to_be_sent" - Then the draft line should be in state "to_be_sent" - - @account_credit_control_run_month - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.run2 - And having: - | name | value | - | date | 2013-02-28 | - When I launch the credit run - Then my credit run should be in state "done" - And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 360 | 2013-02-15 | Debtors | 3 time policy | 2013-02-28 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 360 | USD | - | 1000 | 2013-02-17 | Debtors USD | 3 time policy | 2013-02-28 | customer_5_usd | email | 1 | SI_13 | 10 days net | draft | 1000 | USD | - | 300 | 2013-01-18 | Debtors | 3 time policy | 2013-02-28 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 300 | | diff --git a/account_credit_control/scenarios/features/05_credit_control_run_mar.feature b/account_credit_control/scenarios/features/05_credit_control_run_mar.feature deleted file mode 100644 index af5199b10..000000000 --- a/account_credit_control/scenarios/features/05_credit_control_run_mar.feature +++ /dev/null @@ -1,45 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_mar - -Feature: Ensure that email credit line generation first pass is correct - - @account_credit_control_mark - Scenario: mark lines - Given there is "draft" credit lines - And I mark all draft email to state "to_be_sent" - Then the draft line should be in state "to_be_sent" - - @pay_invoice_si_19_part1 - Scenario: I pay a part of the first part of the invoice SI 19, - Given I pay 300.0 on the invoice "SI_19" - Then My invoice "SI_19" is in state "open" reconciled with a residual amount of "1200.0" - - @account_credit_control_run_month_mar - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.run3 - And having: - | name | value | - | date | 2013-03-31 | - When I launch the credit run - Then my credit run should be in state "done" - And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1000 | 2013-02-28 | Debtors | 2 time policy | 2013-03-31 | customer_2 | email | 1 | SI_4 | 30 days end of month | draft | 1000 | | - | 1000 | 2013-02-17 | Debtors | 2 time policy | 2013-03-31 | customer_3 | email | 1 | SI_7 | 30 days end of month | draft | 1000 | | - | 700 | 2013-02-28 | Debtors | 3 time policy | 2013-03-31 | customer_4 | email | 1 | SI_10 | 10 days net | draft | 700 | | - | 449.99 | 2013-03-15 | Debtors | 3 time policy | 2013-03-31 | customer_4 | email | 1 | SI_12 | 10 days net | draft | 449.99 | USD | - | 1200 | 2013-03-17 | Debtors USD | 3 time policy | 2013-03-31 | customer_5_usd | email | 1 | SI_14 | 10 days net | draft | 1200 | USD | - | 360 | 2013-02-15 | Debtors | 3 time policy | 2013-03-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 360 | USD | - | 1000 | 2013-02-17 | Debtors USD | 3 time policy | 2013-03-31 | customer_5_usd | email | 2 | SI_13 | 30 days end of month | draft | 1000 | USD | - | 300 | 2013-01-18 | Debtors | 3 time policy | 2013-03-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 300 | | - | 450 | 2013-03-15 | Debtors | 3 time policy | 2013-03-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 450 | | - | 150 | 2013-03-15 | Debtors | 3 time policy | 2013-03-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 450 | | diff --git a/account_credit_control/scenarios/features/06_credit_control_run_apr.feature b/account_credit_control/scenarios/features/06_credit_control_run_apr.feature deleted file mode 100644 index 635bfeee7..000000000 --- a/account_credit_control/scenarios/features/06_credit_control_run_apr.feature +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_apr - -Feature: Ensure that email credit line generation first pass is correct - - @account_credit_control_mark - Scenario: mark lines - Given there is "draft" credit lines - And I mark all draft email to state "to_be_sent" - Then the draft line should be in state "to_be_sent" - - @account_credit_control_run_month - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.run4 - And having: - | name | value | - | date | 2013-04-30 | - - When I launch the credit run - Then my credit run should be in state "done" - And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 360 | 2013-02-15 | Debtors | 3 time policy | 2013-04-30 | customer_4 | letter | 3 | SI_11 | 10 days last reminder | draft | 360 | USD | - | 1200 | 2013-03-31 | Debtors | 2 time policy | 2013-04-30 | customer_2 | email | 1 | SI_5 | 30 days end of month | draft | 1200 | USD | - | 1200 | 2013-03-17 | Debtors | 2 time policy | 2013-04-30 | customer_3 | email | 1 | SI_8 | 30 days end of month | draft | 1200 | USD | - | 700 | 2013-02-28 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 700 | | - | 840 | 2013-03-31 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 840 | USD | - | 449.99 | 2013-03-15 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 449.99 | USD | - | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-04-30 | customer_5_usd | email | 1 | SI_15 | 10 days net | draft | 1500 | USD | - | 1200 | 2013-03-17 | Debtors USD | 3 time policy | 2013-04-30 | customer_5_usd | email | 2 | SI_14 | 30 days end of month | draft | 1200 | USD | - | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-04-30 | customer_5_usd | email | 1 | SI_15 | 10 days net | draft | 1500 | USD | - | 1500 | 2013-04-14 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 1 | SI_16 | 10 days net | draft | 1500 | | - | 1500 | 2013-04-14 | Debtors | 3 time policy | 2013-04-30 | Scrooge McDuck | email | 1 | SI_17 | 10 days net | draft | 1500 | | - | 450 | 2013-03-15 | Debtors | 3 time policy | 2013-04-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 450 | | - | 150 | 2013-03-15 | Debtors | 3 time policy | 2013-04-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 450 | | diff --git a/account_credit_control/scenarios/features/07_credit_control_run_may.feature b/account_credit_control/scenarios/features/07_credit_control_run_may.feature deleted file mode 100644 index 2b73fa660..000000000 --- a/account_credit_control/scenarios/features/07_credit_control_run_may.feature +++ /dev/null @@ -1,59 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_may - -Feature: Ensure that email credit line generation first pass is correct - - @account_credit_control_mark - Scenario: mark lines - Given there is "draft" credit lines - And I mark all draft email to state "to_be_sent" - Then the draft line should be in state "to_be_sent" - - @pay_invoice_si_16 - Scenario: I pay entirely the invoice SI 16, so it should no longer appear in the credit control lines - Given I pay the full amount on the invoice "SI_16" - Then My invoice "SI_16" is in state "paid" reconciled with a residual amount of "0.0" - - @pay_invoice_si_17 - Scenario: I pay entirely the invoice SI 17, so it should no longer appear in the credit control lines - Given I pay 1000.0 on the invoice "SI_17" - Then My invoice "SI_17" is in state "open" reconciled with a residual amount of "500.0" - - @pay_invoice_si_18_part1 - Scenario: I pay the first part of the invoice SI 18, so it should no longer appear in the credit control lines however, the second move lines should still appears - Given I pay 450.0 on the invoice "SI_18" - Then My invoice "SI_18" is in state "open" reconciled with a residual amount of "1050.0" - - @account_credit_control_run_month - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.run5 - And having: - | name | value | - | date | 2013-05-31 | - When I launch the credit run - Then my credit run should be in state "done" - And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1500 | 2013-04-30 | Debtors | 2 time policy | 2013-05-31 | customer_2 | email | 1 | SI_6 | 30 days end of month | draft | 1500 | USD | - | 1000 | 2013-02-28 | Debtors | 2 time policy | 2013-05-31 | customer_2 | letter | 2 | SI_4 | 60 days last reminder | draft | 1000 | | - | 1000 | 2013-02-17 | Debtors | 2 time policy | 2013-05-31 | customer_3 | letter | 2 | SI_7 | 60 days last reminder | draft | 1000 | | - | 1500 | 2013-04-14 | Debtors | 2 time policy | 2013-05-31 | customer_3 | email | 1 | SI_9 | 30 days end of month | draft | 1500 | | - | 840 | 2013-03-31 | Debtors | 3 time policy | 2013-05-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 840 | USD | - | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-05-31 | customer_5_usd | email | 2 | SI_15 | 30 days end of month | draft | 1500 | USD | - | 700 | 2013-02-28 | Debtors | 3 time policy | 2013-05-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 700 | | - | 449.99 | 2013-03-15 | Debtors | 3 time policy | 2013-05-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 449.99 | USD | - | 1050.01 | 2013-04-30 | Debtors | 3 time policy | 2013-05-31 | customer_4 | email | 1 | SI_12 | 10 days net | draft | 1050.01 | USD | - | 1200 | 2013-03-17 | Debtors USD | 3 time policy | 2013-05-31 | customer_5_usd | letter | 3 | SI_14 | 10 days last reminder | draft | 1200 | USD | - | 500 | 2013-04-14 | Debtors | 3 time policy | 2013-05-31 | Scrooge McDuck | email | 2 | SI_17 | 30 days end of month | draft | 1500 | | - | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-05-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 1050 | | - | 150 | 2013-03-15 | Debtors | 3 time policy | 2013-05-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 450 | | - | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-05-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 1050 | | diff --git a/account_credit_control/scenarios/features/08_credit_control_run_jun.feature b/account_credit_control/scenarios/features/08_credit_control_run_jun.feature deleted file mode 100644 index 75c7df7f5..000000000 --- a/account_credit_control/scenarios/features/08_credit_control_run_jun.feature +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_jun - -Feature: Ensure that email credit line generation first pass is correct - - @account_credit_control_mark - Scenario: mark lines - Given there is "draft" credit lines - And I mark all draft email to state "to_be_sent" - Then the draft line should be in state "to_be_sent" - - @account_credit_control_run_month - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.run6 - And having: - | name | value | - | date | 2013-06-30 | - When I launch the credit run - Then my credit run should be in state "done" - And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1200 | 2013-03-31 | Debtors | 2 time policy | 2013-06-30 | customer_2 | letter | 2 | SI_5 | 60 days last reminder | draft | 1200 | USD | - | 1200 | 2013-03-17 | Debtors | 2 time policy | 2013-06-30 | customer_3 | letter | 2 | SI_8 | 60 days last reminder | draft | 1200 | USD | - | 1050.01 | 2013-04-30 | Debtors | 3 time policy | 2013-06-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 1050.01 | USD | - | 840 | 2013-03-31 | Debtors | 3 time policy | 2013-06-30 | customer_4 | letter | 3 | SI_11 | 10 days last reminder | draft | 840 | USD | - | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-06-30 | customer_5_usd | letter | 3 | SI_15 | 10 days last reminder | draft | 1500 | USD | - | 500 | 2013-04-14 | Debtors | 3 time policy | 2013-06-30 | Scrooge McDuck | letter | 3 | SI_17 | 10 days last reminder | draft | 1500 | | - | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-06-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 1050 | | - | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-06-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 1050 | | diff --git a/account_credit_control/scenarios/features/09_credit_control_run_jul.feature b/account_credit_control/scenarios/features/09_credit_control_run_jul.feature deleted file mode 100644 index df0aa4c55..000000000 --- a/account_credit_control/scenarios/features/09_credit_control_run_jul.feature +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_jul - -Feature: Ensure that email credit line generation first pass is correct - - @account_credit_control_mark - Scenario: mark lines - Given there is "draft" credit lines - And I mark all draft email to state "to_be_sent" - Then the draft line should be in state "to_be_sent" - - @account_credit_control_run_month - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.run7 - And having: - | name | value | - | date | 2013-07-31 | - When I launch the credit run - Then my credit run should be in state "done" - And the generated credit lines should have the following values: - | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency | - | 1500 | 2013-04-30 | Debtors | 2 time policy | 2013-07-31 | customer_2 | letter | 2 | SI_6 | 60 days last reminder | draft | 1500 | USD | - | 1500 | 2013-04-14 | Debtors | 2 time policy | 2013-07-31 | customer_3 | letter | 2 | SI_9 | 60 days last reminder | draft | 1500 | USD | - | 1050.01 | 2013-04-30 | Debtors | 3 time policy | 2013-07-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 1050.01 | USD | - | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-07-31 | Donald Duck | letter | 3 | SI_18 | 10 days last reminder | draft | 1050 | | - | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-07-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 1050 | | diff --git a/account_credit_control/scenarios/features/10_credit_control_run_aug.feature b/account_credit_control/scenarios/features/10_credit_control_run_aug.feature deleted file mode 100644 index 5351b4b9c..000000000 --- a/account_credit_control/scenarios/features/10_credit_control_run_aug.feature +++ /dev/null @@ -1,30 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_aug - -Feature: Ensure that ignore feature works as expected - - @account_credit_control_mark_as_ignore - Scenario: mark last line as ignore - Given I ignore the "Gus Goose" credit line at level "3" for move line "SI_19" with amount "1050.0" - - @account_credit_control_run_month_aug - Scenario: Create run - Given I need a "credit.control.run" with oid: credit_control.runignored - And having: - | name | value | - | date | 2013-08-30 | - When I launch the credit run - Then my credit run should be in state "done" - - @check_ignored_line - Scenario: Check ignored lines - Given I have for "Gus Goose" "2" credit lines at level "3" for move line "SI_19" with amount "1050.0" respectively in state "draft" and "ignored" diff --git a/account_credit_control/scenarios/features/11_credit_control_manual_setting.feature b/account_credit_control/scenarios/features/11_credit_control_manual_setting.feature deleted file mode 100644 index 6c30d67b1..000000000 --- a/account_credit_control/scenarios/features/11_credit_control_manual_setting.feature +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################### -# -# OERPScenario, OpenERP Functional Tests -# Copyright 2012-2014 Camptocamp SA -# Author Nicolas Bessi -############################################################################## - -# Features Generic tags (none for all) -############################################################################## - -@account_credit_control @account_credit_control_run @account_credit_control_run_change_level - -Feature: Ensure that manually changing an invoice level feature works as expected - - @account_credit_control_change_level - Scenario: Change level - Given I change level for invoice "SAJ/2014/0004" to "10 days net" of policy "3 time policy" - Then wizard selected move lines should be: - | name | - | SI_4 | - When I confirm the level change - And I should have "3" credit control lines overridden - And one new credit control line of level "10 days net" related to invoice "SAJ/2014/0004" - Then I force date of generated credit line to "2013-09-15" - - @account_credit_control_run_month_sept - Scenario: Create run - Given there is "draft" credit lines - And I mark all draft email to state "to_be_sent" - Then the draft line should be in state "to_be_sent" - Given I need a "credit.control.run" with oid: credit_control.manual_change - And having: - | name | value | - | date | 2013-09-30 | - When I launch the credit run - Then my credit run should be in state "done" - - @account_credit_control_manual_next_step - Scenario: Check manually managed line on run - Given the invoice "SAJ/2014/0004" with manual changes - And the invoice has "1" line of level "1" for policy "3 time policy" - And the invoice has "1" line of level "2" for policy "3 time policy" diff --git a/account_credit_control/scenarios/features/steps/account_credit_control.py b/account_credit_control/scenarios/features/steps/account_credit_control.py deleted file mode 100644 index 2a292d0a5..000000000 --- a/account_credit_control/scenarios/features/steps/account_credit_control.py +++ /dev/null @@ -1,147 +0,0 @@ -# -*- coding: utf-8 -*- -# flake8: noqa -import time -from behave import given, when -from support import model, assert_equal - -@given(u'I configure the following accounts on the credit control policy with oid: "{policy_oid}"') -def impl(ctx, policy_oid): - policy = model('credit.control.policy').get(policy_oid) - assert policy, 'No policy % found' % policy_oid - acc_obj = model('account.account') - accounts = [] - for row in ctx.table: - acc = acc_obj.get(['code = %s' % row['account code']]) - assert acc, "Account with code %s not found" % row['account code'] - accounts.append(acc) - policy.write({'account_ids': [x.id for x in accounts]}) - - -@when(u'I launch the credit run') -def impl(ctx): - assert ctx.found_item - # Must be a cleaner way to do it - assert 'credit.control.run' == ctx.found_item._model._name - ctx.found_item.generate_credit_lines() - -@given(u'I clean all the credit lines') -def impl(ctx): - model('credit.control.line').browse([]).unlink() - -@then(u'my credit run should be in state "done"') -def impl(ctx): - assert ctx.found_item - # Must be a cleaner way to do it - assert model("credit.control.run").get(ctx.found_item.id).state == 'done' - -@then(u'the generated credit lines should have the following values') -def impl(ctx): - def _row_to_dict(row): - return dict((name, row[name]) for name in row.headings if row[name]) - rows = map(_row_to_dict, ctx.table) - - def _parse_date(value): - return time.strftime(value) if '%' in value else value - - for row in rows: - account = model('account.account').get(['name = %s' % row['account']]) - assert account, "no account named %s found" % row['account'] - - policy = model('credit.control.policy').get(['name = %s' % row['policy']]) - assert policy, "No policy %s found" % row['policy'] - - partner = model('res.partner').get(['name = %s' % row['partner']]) - assert partner, "No partner %s found" % row['partner'] - - maturity_date = _parse_date(row['date due']) - move_line = model('account.move.line').get(['name = %s' % row['move line'], - 'date_maturity = %s' % maturity_date]) - assert move_line, "No move line %s found" % row['move line'] - - level = model('credit.control.policy.level').get(['name = %s' % row['policy level'], - 'policy_id = %s' % policy.id]) - assert level, "No level % found" % row['policy level'] - - domain = [['account_id', '=', account.id], - ['policy_id', '=', policy.id], - ['partner_id', '=', partner.id], - ['policy_level_id', '=', level.id], - ['amount_due', '=', row.get('amount due', 0.0)], - ['state', '=', row['state']], - ['level', '=', row.get('level', 0.0)], - ['channel', '=', row['channel']], - ['balance_due', '=', row.get('balance', 0.0)], - ['date_due', '=', _parse_date(row['date due'])], - ['date', '=', _parse_date(row['date'])], - ['move_line_id', '=', move_line.id], - ] - if row.get('currency'): - curreny = model('res.currency').get(['name = %s' % row['currency']]) - assert curreny, "No currency %s found" % row['currency'] - domain.append(('currency_id', '=', curreny.id)) - - lines = model('credit.control.line').search(domain) - assert lines, "no line found for %s" % repr(row) - assert len(lines) == 1, "Too many lines found for %s" % repr(row) - date_lines = model('credit.control.line').search([('date', '=', ctx.found_item.date)]) - assert len(date_lines) == len(ctx.table.rows), "Too many lines generated" - - -def open_invoice(ctx): - assert ctx.found_item - ctx.found_item._send('invoice_open') - # _send refresh object - assert ctx.found_item.state == 'open' - -@then(u'I open the credit invoice') -def impl(ctx): - open_invoice(ctx) - -@given(u'I open the credit invoice') -def impl(ctx): - open_invoice(ctx) - -@given(u'there is "{state}" credit lines') -def impl(ctx, state): - assert model('credit.control.line').search(['state = %s' % state]) - -@given(u'I mark all draft email to state "{state}"') -def impl(ctx, state): - wiz = model('credit.control.marker').create({'name': state}) - lines = model('credit.control.line').search([('state', '=', 'draft')]) - assert lines - ctx.lines = lines - wiz.write({'line_ids': lines}) - wiz.mark_lines() - -@then(u'the draft line should be in state "{state}"') -def impl(ctx, state): - assert ctx.lines - lines = model('credit.control.line').search([('state', '!=', state), - ('id', 'in', ctx.lines)]) - assert not lines - -@given(u'I ignore the "{partner}" credit line at level "{level:d}" for move line "{move_line_name}" with amount "{amount:f}"') -def impl(ctx, partner, level, move_line_name, amount): - print ctx, partner, level, move_line_name, amount - to_ignore = model('credit.control.line').search([('partner_id.name', '=', partner), - ('level', '=', level), - ('amount_due', '=', amount), - ('move_line_id.name', '=', move_line_name)]) - assert to_ignore - wiz = model('credit.control.marker').create({'name': 'ignored'}) - ctx.lines = to_ignore - wiz.write({'line_ids': to_ignore}) - wiz.mark_lines() - assert model('credit.control.line').get(to_ignore[0]).state == 'ignored' - -@given(u'I have for "{partner}" "{number:d}" credit lines at level "{level:d}" for move line "{move_line_name}" with amount "{amount:f}" respectively in state "draft" and "ignored"') -def impl(ctx, partner, number, level, move_line_name, amount): - to_check = model('credit.control.line').search([('partner_id.name', '=', partner), - ('level', '=', level), - ('amount_due', '=', amount), - ('move_line_id.name', '=', move_line_name), - ('state', 'in', ('draft', 'ignored'))]) - assert_equal(len(to_check), int(number), msg="More than %s found" % number) - lines = model('credit.control.line').browse(to_check) - assert set(['ignored', 'draft']) == set(lines.state) diff --git a/account_credit_control/scenarios/features/steps/account_credit_control_changer.py b/account_credit_control/scenarios/features/steps/account_credit_control_changer.py deleted file mode 100644 index 6f46d11fc..000000000 --- a/account_credit_control/scenarios/features/steps/account_credit_control_changer.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -from support import model, assert_equal, assert_in, assert_true - -# flake8: noqa -@given(u'I change level for invoice "{invoice_name}" to "{level_name}" of policy "{policy_name}"') -def impl(ctx, invoice_name, level_name, policy_name): - invoice = model('account.invoice').get([('number', '=', invoice_name)]) - assert_true(invoice, msg='No invoices found') - level = model('credit.control.policy.level').get([('name', '=', level_name)]) - assert_true(level, 'level not found') - policy = model('credit.control.policy').get([('name', '=', policy_name)]) - assert_true(policy, 'Policy not found') - assert_equal(policy.id, level.policy_id.id) - context = {'active_ids': [invoice.id]} - data = {'new_policy_id': policy.id, - 'new_policy_level_id': level.id} - wizard = model('credit.control.policy.changer').create(data, context=context) - ctx.wizard = wizard - -@then(u'wizard selected move lines should be') -def impl(ctx): - assert_true(ctx.wizard) - names = [x.name for x in ctx.wizard.move_line_ids] - for line in ctx.table: - assert_in(line['name'], names) - -@when(u'I confirm the level change') -def impl(ctx): - assert_true(ctx.wizard) - ctx.wizard.set_new_policy() - -@when(u'I should have "{line_number:d}" credit control lines overridden') -def impl(ctx, line_number): - assert_true(ctx.wizard) - move_ids = [x.id for x in ctx.wizard.move_line_ids] - overridden = model('credit.control.line').search([('move_line_id', 'in', move_ids), - ('manually_overridden', '=', True)]) -# assert len(overridden) == line_number - -@when(u'one new credit control line of level "{level_name}" related to invoice "{invoice_name}"') -def impl(ctx, level_name, invoice_name): - invoice = model('account.invoice').get([('number', '=', invoice_name)]) - assert_true(invoice, msg='No invoices found') - level = model('credit.control.policy.level').get([('name', '=', level_name)]) - assert_true(level, 'level not found') - assert_true(ctx.wizard) - move_ids = [x.id for x in ctx.wizard.move_line_ids] - created_id = model('credit.control.line').search([('move_line_id', 'in', move_ids), - ('manually_overridden', '=', False)]) - - assert len(created_id) == 1 - created = model('credit.control.line').get(created_id[0]) - ctx.created = created - assert_equal(created.policy_level_id.id, level.id) - assert_equal(created.invoice_id.id, invoice.id) - assert_equal(created.invoice_id.credit_policy_id.id, level.policy_id.id) - -@then(u'I force date of generated credit line to "{date}"') -def impl(ctx, date): - assert_true(ctx.created) - ctx.created.write({'date': date}) - -@given(u'the invoice "{invoice_name}" with manual changes') -def impl(ctx, invoice_name): - invoice = model('account.invoice').get([('number', '=', invoice_name)]) - assert_true(invoice, msg='No invoices found') - man_lines = (x for x in invoice.credit_control_line_ids if x.manually_overridden) - assert_true(next(man_lines, None), 'No manual change on the invoice') - ctx.invoice = invoice - -@given(u'the invoice has "{line_number:d}" line of level "{level:d}" for policy "{policy_name}"') -def impl(ctx, line_number, level, policy_name): - assert_true(ctx.invoice) - policy = model('credit.control.policy').get([('name', '=', policy_name)]) - assert_true(policy) - lines = model('credit.control.line').search([('invoice_id', '=', ctx.invoice.id), - ('level', '=', level), - ('policy_id', '=', policy.id)]) - assert_equal(len(lines), line_number) diff --git a/account_credit_control/scenarios/features/steps/account_voucher.py b/account_credit_control/scenarios/features/steps/account_voucher.py deleted file mode 100644 index 6d314316f..000000000 --- a/account_credit_control/scenarios/features/steps/account_voucher.py +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- -# flake8: noqa -from support import model, assert_equal, assert_almost_equal -import datetime - - -@step('I pay the full amount on the invoice "{inv_name}"') -def impl(ctx, inv_name): - Invoice = model('account.invoice') - invoice = Invoice.get([('name', '=', inv_name)]) - assert invoice - ctx.execute_steps(""" - When I pay %f on the invoice "%s" - """ % (invoice.residual, inv_name)) - - -@step('I pay {amount:f} on the invoice "{inv_name}"') -def impl(ctx, amount, inv_name): - Partner = model('res.partner') - Invoice = model('account.invoice') - Voucher = model('account.voucher') - VoucherLine = model('account.voucher.line') - Journal = model('account.journal') - invoice = Invoice.get([('name', '=', inv_name)]) - assert invoice - journal = Journal.get('scen.eur_journal') - values = { - 'partner_id': invoice.partner_id.commercial_partner_id.id, - 'reference': invoice.name, - 'amount': amount, - 'date': invoice.date_invoice, - 'currency_id': invoice.currency_id.id, - 'company_id': invoice.company_id.id, - 'journal_id': journal.id, - } - - if invoice.type in ('out_invoice','out_refund'): - values['type'] = 'receipt' - else: - values['type'] = 'payment' - - onchange = Voucher.onchange_partner_id([], values['partner_id'], - values['journal_id'], - values['amount'], - values['currency_id'], - values['type'], - values['date']) - values.update(onchange['value']) - - onchange = Voucher.onchange_date([], values['date'], - values['currency_id'], - False, - values['amount'], - values['company_id']) - values.update(onchange['value']) - - onchange = Voucher.onchange_amount([], values['amount'], - False, - values['partner_id'], - values['journal_id'], - values['currency_id'], - values['type'], - values['date'], - False, - values['company_id']) - values.update(onchange['value']) - values['line_cr_ids'] = False - - voucher = Voucher.create(values) - - vals = voucher.recompute_voucher_lines(voucher.partner_id.id, - voucher.journal_id.id, - voucher.amount, - voucher.currency_id.id, - voucher.type, - voucher.date) - for line in vals['value']['line_cr_ids']: - line['voucher_id'] = voucher.id - VoucherLine.create(line) - - for line in vals['value']['line_dr_ids']: - line['voucher_id'] = voucher.id - VoucherLine.create(line) - - voucher.button_proforma_voucher() - # Workaround to force recomputation of the residual. - # Must be removed once this bug is fixed: - # https://github.com/odoo/odoo/issues/3395 - invoice.write({'currency_id': invoice.currency_id.id}) - - -@step('My invoice "{inv_name}" is in state "{state}" reconciled with a residual amount of "{amount:f}"') -def impl(ctx, inv_name, state, amount): - invoice = model('account.invoice').get([('name', '=', inv_name)]) - assert_almost_equal(invoice.residual, amount) - assert_equal(invoice.state, state) diff --git a/account_credit_control/tests/__init__.py b/account_credit_control/tests/__init__.py index c13729caa..8563d5c70 100644 --- a/account_credit_control/tests/__init__.py +++ b/account_credit_control/tests/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import test_credit_control_policy from . import test_res_partner from . import test_account_invoice diff --git a/account_credit_control/tests/test_account_invoice.py b/account_credit_control/tests/test_account_invoice.py index 9f920b4c0..ce2065388 100644 --- a/account_credit_control/tests/test_account_invoice.py +++ b/account_credit_control/tests/test_account_invoice.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from datetime import datetime from dateutil import relativedelta -from odoo import fields -from odoo.tests.common import TransactionCase -from odoo.exceptions import UserError +from openerp import fields +from openerp.tests.common import TransactionCase +from openerp.exceptions import UserError class TestAccountInvoice(TransactionCase): @@ -82,7 +83,7 @@ class TestAccountInvoice(TransactionCase): }) # Validate the invoice - invoice.action_invoice_open() + invoice.signal_workflow('invoice_open') control_run = self.env['credit.control.run'].create({ 'date': fields.Date.today(), diff --git a/account_credit_control/tests/test_credit_control_policy.py b/account_credit_control/tests/test_credit_control_policy.py index c80566c06..0e94a472e 100644 --- a/account_credit_control/tests/test_credit_control_policy.py +++ b/account_credit_control/tests/test_credit_control_policy.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.exceptions import ValidationError, UserError -from odoo.tests.common import TransactionCase +from openerp.exceptions import ValidationError, UserError +from openerp.tests.common import TransactionCase class TestCreditControlPolicy(TransactionCase): diff --git a/account_credit_control/tests/test_credit_control_run.py b/account_credit_control/tests/test_credit_control_run.py index ac7c83196..a53b83981 100644 --- a/account_credit_control/tests/test_credit_control_run.py +++ b/account_credit_control/tests/test_credit_control_run.py @@ -5,9 +5,9 @@ import re from datetime import datetime from dateutil import relativedelta -from odoo import fields -from odoo.tests.common import TransactionCase -from odoo.exceptions import UserError +from openerp import fields +from openerp.tests.common import TransactionCase +from openerp.exceptions import UserError class TestCreditControlRun(TransactionCase): @@ -80,7 +80,7 @@ class TestCreditControlRun(TransactionCase): }) # Validate the invoice - self.invoice.action_invoice_open() + self.invoice.signal_workflow('invoice_open') def test_check_run_date(self): """ diff --git a/account_credit_control/tests/test_res_partner.py b/account_credit_control/tests/test_res_partner.py index 62399c6e4..0f3514f9b 100644 --- a/account_credit_control/tests/test_res_partner.py +++ b/account_credit_control/tests/test_res_partner.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests.common import TransactionCase -from odoo.exceptions import ValidationError +from openerp.tests.common import TransactionCase +from openerp.exceptions import ValidationError class TestCreditControlPolicyLevel(TransactionCase): diff --git a/account_credit_control/views/account_invoice.xml b/account_credit_control/views/account_invoice.xml index 2b9dcbbf3..5fede04d6 100644 --- a/account_credit_control/views/account_invoice.xml +++ b/account_credit_control/views/account_invoice.xml @@ -1,5 +1,6 @@ + + credit.control.line.form credit.control.line @@ -148,7 +149,6 @@ Credit Control Lines ir.actions.act_window credit.control.line - form tree,form @@ -167,5 +167,4 @@ id="credit_control_line_action_menu" /> - diff --git a/account_credit_control/views/credit_control_policy.xml b/account_credit_control/views/credit_control_policy.xml index b3651fc90..141793afa 100644 --- a/account_credit_control/views/credit_control_policy.xml +++ b/account_credit_control/views/credit_control_policy.xml @@ -1,5 +1,6 @@ + credit.control.policy.form credit.control.policy @@ -78,7 +79,6 @@ Credit Control Policies ir.actions.act_window credit.control.policy - form tree,form @@ -130,4 +130,5 @@ + diff --git a/account_credit_control/views/credit_control_run.xml b/account_credit_control/views/credit_control_run.xml index c01a4d799..bd72132dd 100644 --- a/account_credit_control/views/credit_control_run.xml +++ b/account_credit_control/views/credit_control_run.xml @@ -1,5 +1,6 @@ + credit.control.run.tree credit.control.run @@ -56,7 +57,6 @@ Credit Control Run ir.actions.act_window credit.control.run - form tree,form diff --git a/account_credit_control/views/res_company.xml b/account_credit_control/views/res_company.xml index 22b71f9cb..8b5fd08e9 100644 --- a/account_credit_control/views/res_company.xml +++ b/account_credit_control/views/res_company.xml @@ -1,5 +1,6 @@ + credit.control.company.form res.company @@ -11,4 +12,5 @@ + diff --git a/account_credit_control/views/res_partner.xml b/account_credit_control/views/res_partner.xml index cdb4888ae..ddfe35f30 100644 --- a/account_credit_control/views/res_partner.xml +++ b/account_credit_control/views/res_partner.xml @@ -1,5 +1,6 @@ + partner.credit_control.form.view res.partner diff --git a/account_credit_control/wizard/__init__.py b/account_credit_control/wizards/__init__.py similarity index 100% rename from account_credit_control/wizard/__init__.py rename to account_credit_control/wizards/__init__.py diff --git a/account_credit_control/wizard/credit_control_communication.py b/account_credit_control/wizards/credit_control_communication.py similarity index 99% rename from account_credit_control/wizard/credit_control_communication.py rename to account_credit_control/wizards/credit_control_communication.py index d23718555..d39fedb90 100644 --- a/account_credit_control/wizard/credit_control_communication.py +++ b/account_credit_control/wizards/credit_control_communication.py @@ -3,7 +3,7 @@ # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging -from odoo import api, fields, models +from openerp import api, fields, models logger = logging.getLogger(__name__) @@ -170,7 +170,6 @@ class CreditCommunication(models.TransientModel): for comm in self: template = comm.current_policy_level.email_template_id email_values = template.generate_email(comm.id) - email_values['type'] = 'email' # model is Transient record (self) removed periodically so no point # of storing res_id email_values.pop('model', None) diff --git a/account_credit_control/wizard/credit_control_emailer.py b/account_credit_control/wizards/credit_control_emailer.py similarity index 95% rename from account_credit_control/wizard/credit_control_emailer.py rename to account_credit_control/wizards/credit_control_emailer.py index 9c7230954..e8f0db9cf 100644 --- a/account_credit_control/wizard/credit_control_emailer.py +++ b/account_credit_control/wizards/credit_control_emailer.py @@ -3,8 +3,8 @@ # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models -from odoo.exceptions import UserError +from openerp import _, api, fields, models +from openerp.exceptions import UserError class CreditControlEmailer(models.TransientModel): diff --git a/account_credit_control/wizard/credit_control_emailer_view.xml b/account_credit_control/wizards/credit_control_emailer_view.xml similarity index 100% rename from account_credit_control/wizard/credit_control_emailer_view.xml rename to account_credit_control/wizards/credit_control_emailer_view.xml diff --git a/account_credit_control/wizard/credit_control_marker.py b/account_credit_control/wizards/credit_control_marker.py similarity index 96% rename from account_credit_control/wizard/credit_control_marker.py rename to account_credit_control/wizards/credit_control_marker.py index edb63e09d..7fc338e85 100644 --- a/account_credit_control/wizard/credit_control_marker.py +++ b/account_credit_control/wizards/credit_control_marker.py @@ -2,8 +2,8 @@ # Copyright 2012-2017 Camptocamp SA # Copyright 2017 Okia SPRL (https://okia.be) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models -from odoo.exceptions import UserError +from openerp import _, api, fields, models +from openerp.exceptions import UserError class CreditControlMarker(models.TransientModel): diff --git a/account_credit_control/wizard/credit_control_marker_view.xml b/account_credit_control/wizards/credit_control_marker_view.xml similarity index 95% rename from account_credit_control/wizard/credit_control_marker_view.xml rename to account_credit_control/wizards/credit_control_marker_view.xml index e21f22c11..d0e9b9422 100644 --- a/account_credit_control/wizard/credit_control_marker_view.xml +++ b/account_credit_control/wizards/credit_control_marker_view.xml @@ -8,14 +8,13 @@ - +