diff --git a/base_view_inheritance_extension/README.rst b/base_view_inheritance_extension/README.rst index bf148650e..b5b018598 100644 --- a/base_view_inheritance_extension/README.rst +++ b/base_view_inheritance_extension/README.rst @@ -17,19 +17,19 @@ Extended view inheritance :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-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_view_inheritance_extension + :target: https://github.com/OCA/server-tools/tree/17.0/base_view_inheritance_extension :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_view_inheritance_extension + :target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-base_view_inheritance_extension :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 was written to make it simple to add custom operators for view -inheritance. +This module was written to make it simple to add custom operators for +view inheritance. **Table of contents** @@ -41,42 +41,41 @@ Usage **Change a python dictionary (context for example)** +.. code:: xml -.. code-block:: xml + + + { + "key": "value", + } + + - - - { - "key": "value", - } - - - - -Note that views are subject to evaluation of xmlids anyways, so if you need -to refer to some xmlid, say ``%(xmlid)s``. +Note that views are subject to evaluation of xmlids anyways, so if you +need to refer to some xmlid, say ``%(xmlid)s``. **Add text after and/or before than original** -.. code-block:: xml +.. code:: xml - - $text_before {old_value} $text_after - + + $text_before {old_value} $text_after + -**Add domain with AND/OR join operator (AND if missed) allowing conditional changes** +**Add domain with AND/OR join operator (AND if missed) allowing +conditional changes** -.. code-block:: xml +.. code:: xml - - $domain_to_add - + + $domain_to_add + Known issues / Roadmap ====================== -* Support an ``eval`` attribute for our new node types. +- Support an ``eval`` attribute for our new node types. Bug Tracker =========== @@ -84,7 +83,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. @@ -92,24 +91,24 @@ Credits ======= Authors -~~~~~~~ +------- * Therp BV Contributors -~~~~~~~~~~~~ +------------ -* Holger Brunn -* Ronald Portier -* `Tecnativa `_: +- Holger Brunn +- Ronald Portier +- `Tecnativa `__: - * Sergio Teruel - * Carlos Dauden + - Sergio Teruel + - Carlos Dauden -* Iván Todorovich +- Iván Todorovich Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -121,6 +120,6 @@ 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. -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_view_inheritance_extension/models/ir_ui_view.py b/base_view_inheritance_extension/models/ir_ui_view.py index 37508736e..bd43e426e 100644 --- a/base_view_inheritance_extension/models/ir_ui_view.py +++ b/base_view_inheritance_extension/models/ir_ui_view.py @@ -181,11 +181,7 @@ class IrUiView(models.Model): # in update mode the domain cause an invalid syntax error new_value = attribute_node.text.strip() if condition: - new_value = "{condition} and {new_value} or {old_value}".format( - condition=condition, - new_value=new_value, - old_value=old_value or [], - ) + new_value = f"{condition} and {new_value} or {old_value or []}" node.attrib[attribute_name] = new_value return source diff --git a/base_view_inheritance_extension/pyproject.toml b/base_view_inheritance_extension/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/base_view_inheritance_extension/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/base_view_inheritance_extension/readme/CONTRIBUTORS.md b/base_view_inheritance_extension/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..2a5ae09f4 --- /dev/null +++ b/base_view_inheritance_extension/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- Holger Brunn \<\> +- Ronald Portier \<\> +- [Tecnativa](https://www.tecnativa.com): + - Sergio Teruel + - Carlos Dauden +- Iván Todorovich \<\> diff --git a/base_view_inheritance_extension/readme/CONTRIBUTORS.rst b/base_view_inheritance_extension/readme/CONTRIBUTORS.rst deleted file mode 100644 index 141a85c2f..000000000 --- a/base_view_inheritance_extension/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,8 +0,0 @@ -* Holger Brunn -* Ronald Portier -* `Tecnativa `_: - - * Sergio Teruel - * Carlos Dauden - -* Iván Todorovich diff --git a/base_view_inheritance_extension/readme/DESCRIPTION.rst b/base_view_inheritance_extension/readme/DESCRIPTION.md similarity index 72% rename from base_view_inheritance_extension/readme/DESCRIPTION.rst rename to base_view_inheritance_extension/readme/DESCRIPTION.md index 0536b6f26..4fc9dc0a4 100644 --- a/base_view_inheritance_extension/readme/DESCRIPTION.rst +++ b/base_view_inheritance_extension/readme/DESCRIPTION.md @@ -1,2 +1,2 @@ -This module was written to make it simple to add custom operators for view -inheritance. +This module was written to make it simple to add custom operators for +view inheritance. diff --git a/base_view_inheritance_extension/readme/ROADMAP.md b/base_view_inheritance_extension/readme/ROADMAP.md new file mode 100644 index 000000000..f2dc1c6a7 --- /dev/null +++ b/base_view_inheritance_extension/readme/ROADMAP.md @@ -0,0 +1 @@ +- Support an `eval` attribute for our new node types. diff --git a/base_view_inheritance_extension/readme/ROADMAP.rst b/base_view_inheritance_extension/readme/ROADMAP.rst deleted file mode 100644 index ad27c61b8..000000000 --- a/base_view_inheritance_extension/readme/ROADMAP.rst +++ /dev/null @@ -1 +0,0 @@ -* Support an ``eval`` attribute for our new node types. diff --git a/base_view_inheritance_extension/readme/USAGE.md b/base_view_inheritance_extension/readme/USAGE.md new file mode 100644 index 000000000..e4bda1aa9 --- /dev/null +++ b/base_view_inheritance_extension/readme/USAGE.md @@ -0,0 +1,32 @@ +**Change a python dictionary (context for example)** + +``` xml + + + { + "key": "value", + } + + +``` + +Note that views are subject to evaluation of xmlids anyways, so if you +need to refer to some xmlid, say `%(xmlid)s`. + +**Add text after and/or before than original** + +``` xml + + $text_before {old_value} $text_after + +``` + +**Add domain with AND/OR join operator (AND if missed) allowing +conditional changes** + +``` xml + + $domain_to_add + +``` diff --git a/base_view_inheritance_extension/readme/USAGE.rst b/base_view_inheritance_extension/readme/USAGE.rst deleted file mode 100644 index 7acccf59c..000000000 --- a/base_view_inheritance_extension/readme/USAGE.rst +++ /dev/null @@ -1,33 +0,0 @@ -**Change a python dictionary (context for example)** - - -.. code-block:: xml - - - - { - "key": "value", - } - - - - -Note that views are subject to evaluation of xmlids anyways, so if you need -to refer to some xmlid, say ``%(xmlid)s``. - -**Add text after and/or before than original** - -.. code-block:: xml - - - $text_before {old_value} $text_after - - -**Add domain with AND/OR join operator (AND if missed) allowing conditional changes** - -.. code-block:: xml - - - $domain_to_add - diff --git a/base_view_inheritance_extension/static/description/index.html b/base_view_inheritance_extension/static/description/index.html index e2e840975..11217bc7a 100644 --- a/base_view_inheritance_extension/static/description/index.html +++ b/base_view_inheritance_extension/static/description/index.html @@ -369,9 +369,9 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:56c707d911c93aace4dc1593e4c0f7de5816cdf8883d581a9cfdf7d500b2de66 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

This module was written to make it simple to add custom operators for view -inheritance.

+

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

+

This module was written to make it simple to add custom operators for +view inheritance.

Table of contents

    @@ -398,15 +398,16 @@ inheritance.

    </attribute> </field> -

    Note that views are subject to evaluation of xmlids anyways, so if you need -to refer to some xmlid, say %(xmlid)s.

    +

    Note that views are subject to evaluation of xmlids anyways, so if you +need to refer to some xmlid, say %(xmlid)s.

    Add text after and/or before than original

     <attribute name="$attribute" operation="text_add">
         $text_before {old_value} $text_after
     </attribute>
     
    -

    Add domain with AND/OR join operator (AND if missed) allowing conditional changes

    +

    Add domain with AND/OR join operator (AND if missed) allowing +conditional changes

     <attribute name="$attribute" operation="domain_add"
                condition="$field_condition" join_operator="OR">
    @@ -425,7 +426,7 @@ to refer to some xmlid, say %(xmlid)s.

    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.

@@ -456,7 +457,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

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.

-

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/requirements.txt b/requirements.txt new file mode 100644 index 000000000..f0e2006cc --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# generated from manifests external_dependencies +astor