From 75d69ef9bd085b8d150562e2c5360ffab8881f5b Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Mon, 29 May 2017 18:34:23 +0200 Subject: [PATCH] Fix errors, improve menus, views, readme (cherry picked from commit 93a9b1ee4fd05c2a8fd97c305e392cab6a24f865) --- account_credit_control/README.rst | 44 +++++++++++- account_credit_control/__init__.py | 20 ------ account_credit_control/__manifest__.py | 22 +----- account_credit_control/data/data.xml | 67 ++++++------------- account_credit_control/models/__init__.py | 4 -- .../models/account_account.py | 22 +----- .../models/account_invoice.py | 22 +----- .../models/credit_control_line.py | 22 +----- .../models/credit_control_policy.py | 24 ++----- .../models/credit_control_run.py | 22 +----- account_credit_control/models/mail_mail.py | 22 +----- account_credit_control/models/res_company.py | 22 +----- account_credit_control/models/res_partner.py | 22 +----- .../report/report_credit_control_summary.xml | 5 +- .../views/account_invoice.xml | 2 +- .../views/credit_control_line.xml | 45 +++++-------- .../views/credit_control_policy.xml | 3 +- .../views/credit_control_run.xml | 5 +- account_credit_control/views/res_partner.xml | 2 +- account_credit_control/wizard/__init__.py | 20 ------ .../wizard/credit_control_communication.py | 22 +----- .../wizard/credit_control_emailer.py | 22 +----- .../wizard/credit_control_emailer_view.xml | 1 - .../wizard/credit_control_marker.py | 22 +----- .../wizard/credit_control_marker_view.xml | 1 - .../wizard/credit_control_policy_changer.py | 26 ++----- .../credit_control_policy_changer_view.xml | 1 - .../wizard/credit_control_printer.py | 22 +----- .../wizard/credit_control_printer_view.xml | 1 - 29 files changed, 135 insertions(+), 400 deletions(-) diff --git a/account_credit_control/README.rst b/account_credit_control/README.rst index a554f55feac..6b3b93c80c8 100644 --- a/account_credit_control/README.rst +++ b/account_credit_control/README.rst @@ -6,8 +6,13 @@ Credit Control ============== +Installation +============ + +Just install it + Configuration -------------- +============= Configure the policies and policy levels in ``Accounting > Configuration > Credit Control > Credit Control Policies``. @@ -19,9 +24,9 @@ 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 > Report > 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 @@ -33,12 +38,45 @@ On each generated line, you have many choices: * 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 22d46d48f85..9b4296142f4 100644 --- a/account_credit_control/__init__.py +++ b/account_credit_control/__init__.py @@ -1,22 +1,2 @@ -# -*- 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 models from . import wizard diff --git a/account_credit_control/__manifest__.py b/account_credit_control/__manifest__.py index baccc997e62..9cfbe9b7b79 100644 --- a/account_credit_control/__manifest__.py +++ b/account_credit_control/__manifest__.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': '10.0.1.0.0', 'author': "Camptocamp,Odoo Community Association (OCA),Okia", diff --git a/account_credit_control/data/data.xml b/account_credit_control/data/data.xml index 5806c7b611c..79a44ce25e0 100644 --- a/account_credit_control/data/data.xml +++ b/account_credit_control/data/data.xml @@ -61,13 +61,10 @@ ref="email_template_credit_control_base"/> 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. + 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. + Thank you in advance for your anticipated cooperation in this matter. Best regards @@ -93,14 +90,10 @@ ref="email_template_credit_control_base"/> 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. + 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. + Thank you in advance for your anticipated cooperation in this matter. Best regards @@ -125,20 +118,14 @@ 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. + 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. + Thank you in advance for your anticipated cooperation in this matter. Best regards @@ -173,13 +160,10 @@ ref="email_template_credit_control_base"/> 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. + 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. + Thank you in advance for your anticipated cooperation in this matter. Best regards @@ -203,22 +187,15 @@ ref="email_template_credit_control_base"/> 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. + 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. + Thank you in advance for your anticipated cooperation in this matter. Best regards diff --git a/account_credit_control/models/__init__.py b/account_credit_control/models/__init__.py index 8db8b812069..01bbe9e10c0 100644 --- a/account_credit_control/models/__init__.py +++ b/account_credit_control/models/__init__.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- -# Copyright 2012-2014 Camptocamp SA -# 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 diff --git a/account_credit_control/models/account_account.py b/account_credit_control/models/account_account.py index 0470b243060..2face2a5ba0 100644 --- a/account_credit_control/models/account_account.py +++ b/account_credit_control/models/account_account.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). from odoo import fields, models diff --git a/account_credit_control/models/account_invoice.py b/account_credit_control/models/account_invoice.py index 41294f547fb..5cc66de2297 100644 --- a/account_credit_control/models/account_invoice.py +++ b/account_credit_control/models/account_invoice.py @@ -1,23 +1,7 @@ # -*- 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 . -# -############################################################################## +# 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 diff --git a/account_credit_control/models/credit_control_line.py b/account_credit_control/models/credit_control_line.py index 2eae120c630..d052b3669f4 100644 --- a/account_credit_control/models/credit_control_line.py +++ b/account_credit_control/models/credit_control_line.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). import logging from odoo import _, api, fields, models diff --git a/account_credit_control/models/credit_control_policy.py b/account_credit_control/models/credit_control_policy.py index 63832b3ff0f..2c3666d9184 100644 --- a/account_credit_control/models/credit_control_policy.py +++ b/account_credit_control/models/credit_control_policy.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). from odoo import _, api, fields, models from odoo.exceptions import UserError @@ -150,7 +134,7 @@ def _get_invoice_related_lines(self, controlling_date): the process """ return self._move_lines_subset(controlling_date, 'account.invoice', - 'invoice') + 'invoice_id') @api.multi @api.returns('account.move.line') diff --git a/account_credit_control/models/credit_control_run.py b/account_credit_control/models/credit_control_run.py index c9435b8ce79..910525aa5e4 100644 --- a/account_credit_control/models/credit_control_run.py +++ b/account_credit_control/models/credit_control_run.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). import logging from odoo import _, api, fields, models diff --git a/account_credit_control/models/mail_mail.py b/account_credit_control/models/mail_mail.py index 3100ad297c2..3b5f95acb20 100644 --- a/account_credit_control/models/mail_mail.py +++ b/account_credit_control/models/mail_mail.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). from odoo import fields, models diff --git a/account_credit_control/models/res_company.py b/account_credit_control/models/res_company.py index 63a5cfda78c..4ae6dc33260 100644 --- a/account_credit_control/models/res_company.py +++ b/account_credit_control/models/res_company.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). from odoo import fields, models diff --git a/account_credit_control/models/res_partner.py b/account_credit_control/models/res_partner.py index 728c7222a95..b43e43d15c7 100644 --- a/account_credit_control/models/res_partner.py +++ b/account_credit_control/models/res_partner.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). from odoo import api, fields, models from odoo.exceptions import UserError, ValidationError diff --git a/account_credit_control/report/report_credit_control_summary.xml b/account_credit_control/report/report_credit_control_summary.xml index 97345ff1cb9..676a5e213ea 100644 --- a/account_credit_control/report/report_credit_control_summary.xml +++ b/account_credit_control/report/report_credit_control_summary.xml @@ -19,8 +19,9 @@ -

+

+ +

Summary

diff --git a/account_credit_control/views/account_invoice.xml b/account_credit_control/views/account_invoice.xml index 94883cc9dd3..2b9dcbbf356 100644 --- a/account_credit_control/views/account_invoice.xml +++ b/account_credit_control/views/account_invoice.xml @@ -17,7 +17,7 @@ - diff --git a/account_credit_control/views/credit_control_line.xml b/account_credit_control/views/credit_control_line.xml index 3bd2c87e0f1..74963f679bf 100644 --- a/account_credit_control/views/credit_control_line.xml +++ b/account_credit_control/views/credit_control_line.xml @@ -49,6 +49,18 @@ credit.control.line + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + - - - - - - - + parent="account.menu_finance_entries" + id="base_credit_control_menu" sequence="10" + groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user,account_credit_control.group_account_credit_control_info"/> Credit Control Lines @@ -174,7 +164,8 @@ parent="base_credit_control_menu" action="credit_control_line_action" sequence="20" - id="credit_control_line_action_menu"/> + 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 0bbc58aa845..b3651fc909d 100644 --- a/account_credit_control/views/credit_control_policy.xml +++ b/account_credit_control/views/credit_control_policy.xml @@ -70,7 +70,8 @@ + id="base_credit_control_configuration_menu" + groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user"/> diff --git a/account_credit_control/views/credit_control_run.xml b/account_credit_control/views/credit_control_run.xml index 981d582faa3..c01a4d7999b 100644 --- a/account_credit_control/views/credit_control_run.xml +++ b/account_credit_control/views/credit_control_run.xml @@ -20,7 +20,7 @@