From f230221a98fcae58ca2592f4afba87e49c3829a4 Mon Sep 17 00:00:00 2001 From: Kevin Khao Date: Fri, 10 Jan 2025 08:50:58 +0200 Subject: [PATCH] [18.0][MIG] account_credit_control: Migration to 18.0 --- account_credit_control/README.rst | 1 + account_credit_control/__manifest__.py | 2 +- .../models/credit_control_line.py | 2 +- account_credit_control/readme/CONTRIBUTORS.md | 1 + .../account_credit_control_analysis.xml | 6 +++--- .../static/description/index.html | 1 + .../tests/test_account_move.py | 7 +++---- .../tests/test_credit_control_run.py | 19 +++++++++--------- account_credit_control/views/account_move.xml | 4 ++-- .../views/credit_control_communication.xml | 12 +++++------ .../views/credit_control_line.xml | 8 ++++---- .../views/credit_control_policy.xml | 18 ++++++++--------- .../views/credit_control_run.xml | 8 ++++---- account_credit_control/views/res_partner.xml | 20 +++++++++---------- .../wizard/credit_control_marker.py | 2 +- 15 files changed, 56 insertions(+), 55 deletions(-) diff --git a/account_credit_control/README.rst b/account_credit_control/README.rst index af99871d7..cdf004acb 100644 --- a/account_credit_control/README.rst +++ b/account_credit_control/README.rst @@ -128,6 +128,7 @@ Contributors - `360ERP `__: - Andrea Stirpe + - Kevin Khao Maintainers ----------- diff --git a/account_credit_control/__manifest__.py b/account_credit_control/__manifest__.py index b0e628dad..8235678f1 100644 --- a/account_credit_control/__manifest__.py +++ b/account_credit_control/__manifest__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Account Credit Control", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "author": "Camptocamp," "Odoo Community Association (OCA)," "Okia," diff --git a/account_credit_control/models/credit_control_line.py b/account_credit_control/models/credit_control_line.py index 2eebf36f3..7532baea3 100644 --- a/account_credit_control/models/credit_control_line.py +++ b/account_credit_control/models/credit_control_line.py @@ -119,7 +119,7 @@ class CreditControlLine(models.Model): store=True, ) level = fields.Integer( - related="policy_level_id.level", group_operator="max", store=True + related="policy_level_id.level", aggregator="max", store=True ) manually_overridden = fields.Boolean() run_id = fields.Many2one(comodel_name="credit.control.run", string="Source") diff --git a/account_credit_control/readme/CONTRIBUTORS.md b/account_credit_control/readme/CONTRIBUTORS.md index dd3c25aa7..8e5f5d085 100644 --- a/account_credit_control/readme/CONTRIBUTORS.md +++ b/account_credit_control/readme/CONTRIBUTORS.md @@ -18,3 +18,4 @@ - Naglis Jonaitis (Versada UAB) \<\> - [360ERP](https://www.360erp.com): - Andrea Stirpe + - Kevin Khao diff --git a/account_credit_control/report/account_credit_control_analysis.xml b/account_credit_control/report/account_credit_control_analysis.xml index 40734ceb9..0b0d13979 100644 --- a/account_credit_control/report/account_credit_control_analysis.xml +++ b/account_credit_control/report/account_credit_control_analysis.xml @@ -8,7 +8,7 @@ >credit.control.analysis.tree (in account_credit_control_analysis) credit.control.analysis - + @@ -16,7 +16,7 @@ - + @@ -37,7 +37,7 @@ Credit Control Analysis credit.control.analysis - tree,pivot + list,pivot [] {} diff --git a/account_credit_control/static/description/index.html b/account_credit_control/static/description/index.html index d0af78d1c..83ace854b 100644 --- a/account_credit_control/static/description/index.html +++ b/account_credit_control/static/description/index.html @@ -468,6 +468,7 @@

Contributors

  • Naglis Jonaitis (Versada UAB) <naglis@versada.eu>
  • 360ERP:
    • Andrea Stirpe
    • +
    • Kevin Khao
  • diff --git a/account_credit_control/tests/test_account_move.py b/account_credit_control/tests/test_account_move.py index 42bc7aa0d..1b85ca722 100644 --- a/account_credit_control/tests/test_account_move.py +++ b/account_credit_control/tests/test_account_move.py @@ -7,8 +7,7 @@ from odoo import fields from odoo.exceptions import UserError -from odoo.tests import tagged -from odoo.tests.common import Form +from odoo.tests import Form, tagged from odoo.addons.account.tests.common import AccountTestInvoicingCommon from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT @@ -17,8 +16,8 @@ @tagged("post_install", "-at_install") class TestAccountInvoice(AccountTestInvoicingCommon): @classmethod - def setUpClass(cls, chart_template_ref=None): - super().setUpClass(chart_template_ref=chart_template_ref) + def setUpClass(cls): + super().setUpClass() cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) cls.env.user.groups_id |= cls.env.ref( "account_credit_control.group_account_credit_control_manager" diff --git a/account_credit_control/tests/test_credit_control_run.py b/account_credit_control/tests/test_credit_control_run.py index e8008cc7b..c584e3f7f 100644 --- a/account_credit_control/tests/test_credit_control_run.py +++ b/account_credit_control/tests/test_credit_control_run.py @@ -9,8 +9,7 @@ from odoo import fields from odoo.exceptions import AccessError, UserError -from odoo.tests import tagged -from odoo.tests.common import Form +from odoo.tests import Form, tagged from odoo.addons.account.tests.common import AccountTestInvoicingCommon from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT @@ -19,8 +18,8 @@ @tagged("post_install", "-at_install") class TestCreditControlRun(AccountTestInvoicingCommon): @classmethod - def setUpClass(cls, chart_template_ref=None): - super().setUpClass(chart_template_ref=chart_template_ref) + def setUpClass(cls): + super().setUpClass() cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) cls.env.user.groups_id |= cls.env.ref( "account_credit_control.group_account_credit_control_manager" @@ -110,8 +109,8 @@ def test_generate_credit_lines(self): self.assertEqual(control_run.state, "done") report_regex = ( - r'

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

    " % self.policy.name + rf'

    Policy "{self.policy.name}" has generated ' + r"\d+ Credit Control Lines.

    " ) regex_result = re.match(report_regex, control_run.report) self.assertIsNotNone(regex_result) @@ -161,8 +160,8 @@ def test_wiz_print_lines(self): self.assertEqual(control_run.state, "done") report_regex = ( - r'

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

    " % self.policy.name + rf'

    Policy "{self.policy.name}" has generated ' + r"\d+ Credit Control Lines.

    " ) regex_result = re.match(report_regex, control_run.report) self.assertIsNotNone(regex_result) @@ -196,8 +195,8 @@ def test_wiz_credit_control_emailer(self): self.assertEqual(control_run.state, "done") report_regex = ( - r'

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

    " % self.policy.name + rf'

    Policy "{self.policy.name}" has generated ' + r"\d+ Credit Control Lines.

    " ) regex_result = re.match(report_regex, control_run.report) self.assertIsNotNone(regex_result) diff --git a/account_credit_control/views/account_move.xml b/account_credit_control/views/account_move.xml index 7351429d0..f2522659e 100644 --- a/account_credit_control/views/account_move.xml +++ b/account_credit_control/views/account_move.xml @@ -30,7 +30,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/account_credit_control/views/credit_control_communication.xml b/account_credit_control/views/credit_control_communication.xml index b1f1cab90..bbad2649e 100644 --- a/account_credit_control/views/credit_control_communication.xml +++ b/account_credit_control/views/credit_control_communication.xml @@ -35,7 +35,7 @@ - + @@ -43,7 +43,7 @@ - +
    @@ -115,24 +115,24 @@ - credit.control.communication.tree + credit.control.communication.list credit.control.communication - + - + Credit Control Communications ir.actions.act_window credit.control.communication - tree,form + list,form

    diff --git a/account_credit_control/views/credit_control_line.xml b/account_credit_control/views/credit_control_line.xml index 1f715b138..71cf685f1 100644 --- a/account_credit_control/views/credit_control_line.xml +++ b/account_credit_control/views/credit_control_line.xml @@ -202,10 +202,10 @@ - credit.control.line.tree + credit.control.line.list credit.control.line - - + credit.control.line form - tree,form + list,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 index 57147ea56..1d4a2e3c1 100644 --- a/account_credit_control/views/credit_control_policy.xml +++ b/account_credit_control/views/credit_control_policy.xml @@ -22,14 +22,14 @@ - + - +

    @@ -75,13 +75,13 @@ - credit.control.policy.tree + credit.control.policy.list credit.control.policy - + - + credit.control.policy form - tree,form + list,form - credit.control.policy.level.tree + credit.control.policy.level.list credit.control.policy.level - + - + diff --git a/account_credit_control/views/credit_control_run.xml b/account_credit_control/views/credit_control_run.xml index 652802e04..fbc133372 100644 --- a/account_credit_control/views/credit_control_run.xml +++ b/account_credit_control/views/credit_control_run.xml @@ -1,10 +1,10 @@ - credit.control.run.tree + credit.control.run.list credit.control.run - + - + @@ -118,7 +118,7 @@ credit.control.run form - tree,form + list,form - + - + @@ -84,11 +84,11 @@ - res.partner.followup.inherit.tree + res.partner.followup.inherit.list res.partner - + - + @@ -121,13 +121,13 @@ res.partner form - tree,form + list,form [('manual_followup', '=', True)] {} - tree + list @@ -167,10 +167,10 @@ res.partner.payment.action.type.form res.partner.payment.action.type - + - + Partner Payment Action Types res.partner.payment.action.type - tree,form + list,form Partner Payment Action Types diff --git a/account_credit_control/wizard/credit_control_marker.py b/account_credit_control/wizard/credit_control_marker.py index 8afe3c19c..afa7efc35 100644 --- a/account_credit_control/wizard/credit_control_marker.py +++ b/account_credit_control/wizard/credit_control_marker.py @@ -78,7 +78,7 @@ def mark_lines(self): return { "domain": str([("id", "in", filtered_lines.ids)]), "binding_view_types": "form", - "view_mode": "tree,form", + "view_mode": "list,form", "view_id": False, "name": _("Control Credit Line"), "res_model": "credit.control.line",