Skip to content

Commit

Permalink
[MIG] base_exception: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Nov 17, 2023
1 parent 710f8e5 commit f3a1ee4
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 119 deletions.
58 changes: 30 additions & 28 deletions base_exception/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ 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/16.0/base_exception
:target: https://github.com/OCA/server-tools/tree/17.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-16-0/server-tools-16-0-base_exception
:target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-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=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module provide an abstract model to manage customizable
exceptions to be applied on different models (sale order, invoice, ...).
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 the 'sale_exception' module. (sale-workflow repository) or
It is not useful by itself. You can see an example of implementation in
the 'sale_exception' module. (sale-workflow repository) or
'purchase_exception' module (purchase-workflow repository).

**Table of contents**
Expand All @@ -43,53 +43,55 @@ in the 'sale_exception' module. (sale-workflow repository) or
Known issues / Roadmap
======================

This module executes user-provided code though a safe_eval which might be
unsecure.
How to mitigate risks should be adressed in future versions of this module.
This module executes user-provided code though a safe_eval which might
be unsecure. How to mitigate risks should be adressed in future versions
of this module.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/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 <https://github.com/OCA/server-tools/issues/new?body=module:%20base_exception%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_exception%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~
-------

* Akretion
* Sodexis
* Camptocamp
* ACSONE SA/NV

Contributors
~~~~~~~~~~~~
------------

* Raphaël Valyi <raphael.valyi@akretion.com>
* Renato Lima <renato.lima@akretion.com>
* Sébastien BEAU <sebastien.beau@akretion.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* SodexisTeam <dev@sodexis.com>
* Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
* Raphaël Reverdy <raphael.reverdy@akretion.com>
* Iván Todorovich <ivan.todorovich@druidoo.io>
- Raphaël Valyi <raphael.valyi@akretion.com>
- Renato Lima <renato.lima@akretion.com>
- Sébastien BEAU <sebastien.beau@akretion.com>
- Guewen Baconnier <guewen.baconnier@camptocamp.com>
- Yannick Vaucher <yannick.vaucher@camptocamp.com>
- SodexisTeam <dev@sodexis.com>
- Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
- Raphaël Reverdy <raphael.reverdy@akretion.com>
- Iván Todorovich <ivan.todorovich@druidoo.io>
- Tecnativa <tecnativa.com>

* Tecnativa <tecnativa.com>
- João Marques

* João Marques
- Kevin Khao <kevin.khao@akretion.com>
- Laurent Mignon <laurent.mignon@acsone.eu>
- [APSL](https://apsl.tech):

* Kevin Khao <kevin.khao@akretion.com>
* Laurent Mignon <laurent.mignon@acsone.eu>
- Antoni Marroig <toni.marroig1@gmail.com>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -112,6 +114,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-hparfr| |maintainer-sebastienbeau|

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/16.0/base_exception>`_ project on GitHub.
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/17.0/base_exception>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion base_exception/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Exception Rule",
"version": "16.0.2.0.0",
"version": "17.0.1.0.0",
"development_status": "Mature",
"category": "Generic Modules",
"summary": """
Expand Down
57 changes: 20 additions & 37 deletions base_exception/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,16 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-28 22:06+0000\n"
"PO-Revision-Date: 2023-09-03 00:15+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"POT-Creation-Date: 2023-11-17 12:53+0000\n"
"PO-Revision-Date: 2023-11-17 12:53+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: base_exception
#. odoo-python
#: code:addons/base_exception/models/base_exception.py:0
#, python-format
msgid "(Blocking exception)"
msgstr "(Excepción de bloqueo)"
"Plural-Forms: \n"

#. module: base_exception
#: model_terms:ir.ui.view,arch_db:base_exception.view_exception_rule_form
Expand Down Expand Up @@ -69,14 +60,12 @@ msgstr "Código python"
msgid ""
"By python code: allow to define any arbitrary check\n"
"By domain: limited to a selection by an odoo domain:\n"
" performance can be better when exceptions are evaluated "
"with several records\n"
" performance can be better when exceptions are evaluated with several records\n"
"By method: allow to select an existing check method"
msgstr ""
"Por código python: permite definir cualquier comprobación arbitraria\n"
"Por dominio: limitado a una selección por un dominio odoo:\n"
" el rendimiento puede ser mejor cuando las excepciones se evalúan "
"con varios registros\n"
" el rendimiento puede ser mejor cuando las excepciones se evalúan con varios registros\n"
"Por método: permite seleccionar un método de comprobación existente"

#. module: base_exception
Expand All @@ -87,7 +76,7 @@ msgstr "Creado por"
#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__create_date
msgid "Created on"
msgstr "Creado el"
msgstr "Creado en"

#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__description
Expand All @@ -97,7 +86,7 @@ msgstr "Descripción"
#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__display_name
msgid "Display Name"
msgstr "Nombre a mostrar"
msgstr "Nombre para mostrar"

#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__domain
Expand Down Expand Up @@ -218,11 +207,6 @@ msgstr "Ignorar excepciones"
msgid "Is Blocking"
msgstr "Está bloqueando"

#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule____last_update
msgid "Last Modified on"
msgstr "Última actualización por"

#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__write_uid
msgid "Last Updated by"
Expand All @@ -231,7 +215,7 @@ msgstr "Última actualización por"
#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__write_date
msgid "Last Updated on"
msgstr "Última actualización el"
msgstr "Última actualización en"

#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_base_exception__main_exception_id
Expand Down Expand Up @@ -278,21 +262,13 @@ msgstr ""
#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule_confirm__related_model_id
msgid "Related Model"
msgstr "Modelo relacionado"
msgstr "Creado en"

#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__sequence
msgid "Sequence"
msgstr "Secuencia"

#. module: base_exception
#: model:ir.model.fields,field_description:base_exception.field_base_exception__smart_search
#: model:ir.model.fields,field_description:base_exception.field_base_exception_method__smart_search
#: model:ir.model.fields,field_description:base_exception.field_exception_rule__smart_search
#: model:ir.model.fields,field_description:base_exception.field_exception_rule_confirm__smart_search
msgid "Smart Search"
msgstr "Búsqueda inteligente"

#. module: base_exception
#. odoo-python
#: code:addons/base_exception/models/base_exception.py:0
Expand All @@ -310,8 +286,8 @@ msgid ""
"There is a problem of configuration, python code, domain or method is "
"missing to match the exception type."
msgstr ""
"Hay un problema de configuración, falta código python, dominio o método para "
"que coincida con el tipo de excepción."
"Hay un problema de configuración, falta código python, dominio o método para"
" que coincida con el tipo de excepción."

#. module: base_exception
#: model_terms:ir.ui.view,arch_db:base_exception.view_exception_rule_form
Expand All @@ -336,3 +312,10 @@ msgstr "Cuando está marcada, la excepción no se puede ignorar"
#: model_terms:ir.ui.view,arch_db:base_exception.view_exception_rule_confirm
msgid "_Close"
msgstr "_Cerrar"

#. module: base_exception
#. odoo-python
#: code:addons/base_exception/models/base_exception.py:0
#, python-format
msgid "{'(Blocking exception)' if e.is_blocking else ''}</b></li>"
msgstr "{'(Excepción de bloqueo)' if e.is_blocking else ''}</b></li>"
13 changes: 3 additions & 10 deletions base_exception/models/base_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,9 @@ def _compute_exceptions_summary(self):
if rec.exception_ids and not rec.ignore_exception:
rec.exceptions_summary = "<ul>%s</ul>" % "".join(
[
"<li>%s: <i>%s</i> <b>%s<b></li>"
% tuple(
map(
html.escape,
(
e.name,
e.description or "",
_("(Blocking exception)") if e.is_blocking else "",
),
)
f"<li>{html.escape(e.name)}: <i>{html.escape(e.description or '')}</i> <b>"
+ _(
"{'(Blocking exception)' if e.is_blocking else ''}</b></li>"
)
for e in rec.exception_ids
]
Expand Down
6 changes: 3 additions & 3 deletions base_exception/models/exception_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ def _to_cache_entry(self):
@api.model_create_multi
def create(self, vals_list):
res = super().create(vals_list)
self._get_cached_rules_for_domain.clear_cache(self)
self._get_cached_rules_for_domain.cache.clear(self)
return res

def write(self, vals):
res = super().write(vals)
self._get_cached_rules_for_domain.clear_cache(self)
self._get_cached_rules_for_domain.cache.clear(self)
return res

def unlink(self):
res = super().unlink()
self._get_cached_rules_for_domain.clear_cache(self)
self._get_cached_rules_for_domain.cache.clear(self)
return res
3 changes: 3 additions & 0 deletions base_exception/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
15 changes: 15 additions & 0 deletions base_exception/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- Raphaël Valyi \<<raphael.valyi@akretion.com>\>
- Renato Lima \<<renato.lima@akretion.com>\>
- Sébastien BEAU \<<sebastien.beau@akretion.com>\>
- Guewen Baconnier \<<guewen.baconnier@camptocamp.com>\>
- Yannick Vaucher \<<yannick.vaucher@camptocamp.com>\>
- SodexisTeam \<<dev@sodexis.com>\>
- Mourad EL HADJ MIMOUNE \<<mourad.elhadj.mimoune@akretion.com>\>
- Raphaël Reverdy \<<raphael.reverdy@akretion.com>\>
- Iván Todorovich \<<ivan.todorovich@druidoo.io>\>
- Tecnativa \<tecnativa.com\>
- João Marques
- Kevin Khao \<<kevin.khao@akretion.com>\>
- Laurent Mignon \<<laurent.mignon@acsone.eu>\>
- \[APSL\](<https://apsl.tech>):
- Antoni Marroig \<<toni.marroig1@gmail.com>\>
16 changes: 0 additions & 16 deletions base_exception/readme/CONTRIBUTORS.rst

This file was deleted.

6 changes: 6 additions & 0 deletions base_exception/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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
the 'sale_exception' module. (sale-workflow repository) or
'purchase_exception' module (purchase-workflow repository).
6 changes: 0 additions & 6 deletions base_exception/readme/DESCRIPTION.rst

This file was deleted.

3 changes: 3 additions & 0 deletions base_exception/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module executes user-provided code though a safe_eval which might
be unsecure. How to mitigate risks should be adressed in future versions
of this module.
3 changes: 0 additions & 3 deletions base_exception/readme/ROADMAP.rst

This file was deleted.

Loading

0 comments on commit f3a1ee4

Please sign in to comment.