From b2a9010d02dbeccdb9be4bdc515fc920c3a8a806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Duy=20=28=C4=90=E1=BB=97=20Anh=29?= Date: Tue, 1 Oct 2024 19:52:09 +0700 Subject: [PATCH] [MIG] base_exception: Migraion to 18.0 --- base_exception/README.rst | 17 +++++++---- base_exception/__manifest__.py | 5 ++-- base_exception/models/base_exception.py | 15 +++++----- base_exception/readme/CONTRIBUTORS.md | 1 + base_exception/readme/CREDITS.md | 1 + base_exception/static/description/index.html | 28 +++++++++++++------ base_exception/views/base_exception_view.xml | 18 ++++++------ .../wizard/base_exception_confirm_view.xml | 4 +-- test-requirements.txt | 1 + 9 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 base_exception/readme/CREDITS.md create mode 100644 test-requirements.txt diff --git a/base_exception/README.rst b/base_exception/README.rst index f858995da07..032646f691a 100644 --- a/base_exception/README.rst +++ b/base_exception/README.rst @@ -17,13 +17,13 @@ Exception Rule :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github - :target: https://github.com/OCA/server-tools/tree/17.0/base_exception + :target: https://github.com/OCA/server-tools/tree/18.0/base_exception :alt: OCA/server-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-base_exception + :target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_exception :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -53,7 +53,7 @@ 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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -86,6 +86,13 @@ Contributors - Kevin Khao - Laurent Mignon +- Do Anh Duy + +Other credits +------------- + +The migration of this module from 17.0 to 18.0 was financially supported +by Camptocamp. Maintainers ----------- @@ -111,6 +118,6 @@ Current `maintainers `__: |maintainer-hparfr| |maintainer-sebastienbeau| -This module is part of the `OCA/server-tools `_ project on GitHub. +This module is part of the `OCA/server-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/base_exception/__manifest__.py b/base_exception/__manifest__.py index a47c3f1142b..1f8607fa30b 100644 --- a/base_exception/__manifest__.py +++ b/base_exception/__manifest__.py @@ -5,13 +5,14 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Exception Rule", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "development_status": "Mature", "category": "Generic Modules", "summary": """ This module provide an abstract model to manage customizable exceptions to be applied on different models (sale order, invoice, ...)""", - "author": "Akretion, Sodexis, Camptocamp, ACSONE SA/NV, Odoo Community Association (OCA)", + "author": """Akretion, Sodexis, Camptocamp, + ACSONE SA/NV, Odoo Community Association (OCA)""", "website": "https://github.com/OCA/server-tools", "depends": ["base_setup"], "maintainers": ["hparfr", "sebastienbeau"], diff --git a/base_exception/models/base_exception.py b/base_exception/models/base_exception.py index cce2fdf2def..b15b355fa11 100644 --- a/base_exception/models/base_exception.py +++ b/base_exception/models/base_exception.py @@ -5,11 +5,11 @@ # Copyright 2023 ACSONE SA/NV (http://acsone.eu) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -import html import logging from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError +from odoo.tools import html_escape _logger = logging.getLogger(__name__) @@ -53,14 +53,15 @@ def _compute_main_error(self): def _compute_exceptions_summary(self): for rec in self: if rec.exception_ids and not rec.ignore_exception: - rec.exceptions_summary = "
    %s
" % "".join( - [ - f"
  • {html.escape(e.name)}: {html.escape(e.description or '')} " - + _( - f"{'(Blocking exception)' if e.is_blocking else ''}
  • " + rec.exceptions_summary = "
      {}
    ".format( + "".join( + "
  • {}: {} {}
  • ".format( + html_escape(e.name), + html_escape(e.description or ""), + "(Blocking exception)" if e.is_blocking else "", ) for e in rec.exception_ids - ] + ) ) else: rec.exceptions_summary = False diff --git a/base_exception/readme/CONTRIBUTORS.md b/base_exception/readme/CONTRIBUTORS.md index 0652b3b208e..2df68f2fd76 100644 --- a/base_exception/readme/CONTRIBUTORS.md +++ b/base_exception/readme/CONTRIBUTORS.md @@ -11,3 +11,4 @@ - João Marques - Kevin Khao \<\> - Laurent Mignon \<\> +- Do Anh Duy \<\> diff --git a/base_exception/readme/CREDITS.md b/base_exception/readme/CREDITS.md new file mode 100644 index 00000000000..83b3ec91f7d --- /dev/null +++ b/base_exception/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 17.0 to 18.0 was financially supported by Camptocamp. diff --git a/base_exception/static/description/index.html b/base_exception/static/description/index.html index b7e22e72c95..769d3cf5d2a 100644 --- a/base_exception/static/description/index.html +++ b/base_exception/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,7 +369,7 @@

    Exception Rule

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:27862fe526d377f41fca08cd07aa13254640f79cca5f6247c0292af5e7e96276 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Mature License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

    +

    Mature License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

    This module provide an abstract model to manage customizable exceptions to be applied on different models (sale order, invoice, …).

    It is not useful by itself. You can see an example of implementation in @@ -382,7 +383,8 @@

    Exception Rule

  • Credits
  • @@ -398,7 +400,7 @@

    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 to smash it by providing a detailed and welcomed -feedback.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    @@ -430,18 +432,26 @@

    Contributors

  • Kevin Khao <kevin.khao@akretion.com>
  • Laurent Mignon <laurent.mignon@acsone.eu>
  • +
  • Do Anh Duy <duyda@trobz.com>
  • +
    +

    Other credits

    +

    The migration of this module from 17.0 to 18.0 was financially supported +by Camptocamp.

    +
    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    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.

    Current maintainers:

    hparfr sebastienbeau

    -

    This module is part of the OCA/server-tools project on GitHub.

    +

    This module is part of the OCA/server-tools project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/base_exception/views/base_exception_view.xml b/base_exception/views/base_exception_view.xml index 7ffdeba1e8b..42c1daa88e2 100644 --- a/base_exception/views/base_exception_view.xml +++ b/base_exception/views/base_exception_view.xml @@ -1,16 +1,16 @@ - - exception.rule.tree + + exception.rule.list exception.rule - + - + @@ -63,7 +63,7 @@ > @@ -92,15 +92,15 @@ - + Exception Rules exception.rule - tree,form - + list,form + {'active_test': False} - + - + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000000..66bc2cbae3f --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo_test_helper