diff --git a/base_view_inheritance_extension/README.rst b/base_view_inheritance_extension/README.rst index 4d732570a..637555c7c 100644 --- a/base_view_inheritance_extension/README.rst +++ b/base_view_inheritance_extension/README.rst @@ -7,7 +7,7 @@ Extended view inheritance !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:a2a6ec82054d07e82194c05453c4e8e2a0e32f5c503b8d08a1d115ad9f75e8ef + !! source digest: sha256:b4ce51071687c3c1085145c8aa6b9212febea204d46ff6382f8b44d5539fa426 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png @@ -23,7 +23,7 @@ Extended view inheritance :target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-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/webui/builds.html?repo=OCA/server-tools&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -56,6 +56,23 @@ Usage 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 + + Known issues / Roadmap ====================== @@ -84,7 +101,11 @@ Contributors * Holger Brunn * Ronald Portier -* Sergio Teruel +* `Tecnativa `_: + + * Sergio Teruel + * Carlos Dauden + * Iván Todorovich Maintainers diff --git a/base_view_inheritance_extension/models/ir_ui_view.py b/base_view_inheritance_extension/models/ir_ui_view.py index 3a45dcc3b..37508736e 100644 --- a/base_view_inheritance_extension/models/ir_ui_view.py +++ b/base_view_inheritance_extension/models/ir_ui_view.py @@ -177,12 +177,14 @@ class IrUiView(models.Model): new_value = str(expression.AND([old_domain, new_domain])) new_value = self.str2var_domain_text(new_value) else: - new_value = attribute_node.text + # We must ensure that the domain definition has not line breaks because + # 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, + old_value=old_value or [], ) node.attrib[attribute_name] = new_value return source diff --git a/base_view_inheritance_extension/static/description/index.html b/base_view_inheritance_extension/static/description/index.html index 37ddfc1c0..1c0b32f00 100644 --- a/base_view_inheritance_extension/static/description/index.html +++ b/base_view_inheritance_extension/static/description/index.html @@ -1,20 +1,20 @@ - + - + Extended view inheritance