odoo-addon-base-view-inheritance-extension 17.0.1.0.2__py3-none-any.whl → 18.0.1.0.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ Extended view inheritance
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:27191b04e1a7392892f0450c00e69e35976d78ed35b380c30359a4316f44f950
10
+ !! source digest: sha256:7d139c75ecf0e269f19de0443b9a28f4e56833de6af60ecff96f40a589297f5c
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
@@ -17,13 +17,13 @@ Extended view inheritance
17
17
  :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18
18
  :alt: License: LGPL-3
19
19
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
20
- :target: https://github.com/OCA/server-tools/tree/17.0/base_view_inheritance_extension
20
+ :target: https://github.com/OCA/server-tools/tree/18.0/base_view_inheritance_extension
21
21
  :alt: OCA/server-tools
22
22
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
- :target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-base_view_inheritance_extension
23
+ :target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_view_inheritance_extension
24
24
  :alt: Translate me on Weblate
25
25
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
- :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0
27
27
  :alt: Try me on Runboat
28
28
 
29
29
  |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -75,7 +75,7 @@ conditional changes**
75
75
  Known issues / Roadmap
76
76
  ======================
77
77
 
78
- - Support an ``eval`` attribute for our new node types.
78
+ - Support an ``eval`` attribute for our new node types.
79
79
 
80
80
  Bug Tracker
81
81
  ===========
@@ -83,7 +83,7 @@ Bug Tracker
83
83
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
84
84
  In case of trouble, please check there if your issue has already been reported.
85
85
  If you spotted it first, help us to smash it by providing a detailed and welcomed
86
- `feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_view_inheritance_extension%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
86
+ `feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_view_inheritance_extension%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
87
87
 
88
88
  Do not contact contributors directly about support or help with technical issues.
89
89
 
@@ -98,14 +98,19 @@ Authors
98
98
  Contributors
99
99
  ------------
100
100
 
101
- - Holger Brunn <hbrunn@therp.nl>
102
- - Ronald Portier <rportier@therp.nl>
103
- - `Tecnativa <https://www.tecnativa.com>`__:
101
+ - Holger Brunn <hbrunn@therp.nl>
102
+ - Ronald Portier <rportier@therp.nl>
103
+ - `Tecnativa <https://www.tecnativa.com>`__:
104
104
 
105
- - Sergio Teruel
106
- - Carlos Dauden
105
+ - Sergio Teruel
106
+ - Carlos Dauden
107
107
 
108
- - Iván Todorovich <ivan.todorovich@camptocamp.com>
108
+ - `Trobz <https://www.trobz.com>`__:
109
+
110
+ - Nhan Tran <nhant@trobz.com>
111
+
112
+ - Iván Todorovich <ivan.todorovich@camptocamp.com>
113
+ - Frederic Grall <fgr@apik.cloud>
109
114
 
110
115
  Maintainers
111
116
  -----------
@@ -120,6 +125,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
120
125
  mission is to support the collaborative development of Odoo features and
121
126
  promote its widespread use.
122
127
 
123
- This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/17.0/base_view_inheritance_extension>`_ project on GitHub.
128
+ This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/base_view_inheritance_extension>`_ project on GitHub.
124
129
 
125
130
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -3,7 +3,7 @@
3
3
  # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
4
4
  {
5
5
  "name": "Extended view inheritance",
6
- "version": "17.0.1.0.2",
6
+ "version": "18.0.1.0.0",
7
7
  "development_status": "Mature",
8
8
  "author": "Therp BV,Odoo Community Association (OCA)",
9
9
  "license": "LGPL-3",
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 17.0\n"
7
+ "Project-Id-Version: Odoo Server 18.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -16,8 +16,8 @@ msgstr ""
16
16
  "MIME-Version: 1.0\n"
17
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
18
  "Content-Transfer-Encoding: \n"
19
- "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
20
- "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
19
+ "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20
+ "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21
21
  "X-Generator: Weblate 4.14.1\n"
22
22
 
23
23
  #. module: base_view_inheritance_extension
@@ -16,8 +16,8 @@ msgstr ""
16
16
  "MIME-Version: 1.0\n"
17
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
18
  "Content-Transfer-Encoding: \n"
19
- "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
20
- "%100==4 ? 2 : 3);\n"
19
+ "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
20
+ "n%100==4 ? 2 : 3);\n"
21
21
 
22
22
  #. module: base_view_inheritance_extension
23
23
  #: model_terms:ir.ui.view,arch_db:base_view_inheritance_extension.view_partner_simple_form
@@ -4,15 +4,8 @@
4
4
  # Copyright 2023 Tecnativa - Carlos Dauden
5
5
  # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
6
6
  import ast
7
- import logging
8
7
  import re
9
8
 
10
- try:
11
- import astor
12
- except ImportError as err: # pragma: no cover
13
- _logger = logging.getLogger(__name__)
14
- _logger.debug(err)
15
-
16
9
  from lxml import etree
17
10
 
18
11
  from odoo import api, models
@@ -35,7 +28,7 @@ def ast_dict_update(source, update):
35
28
 
36
29
  def ast_key_eq(k1, k2):
37
30
  # python < 3.8 uses ast.Str; python >= 3.8 uses ast.Constant
38
- if type(k1) != type(k2):
31
+ if type(k1) is not type(k2):
39
32
  return False
40
33
  elif isinstance(k1, ast.Str):
41
34
  return k1.s == k2.s
@@ -89,21 +82,21 @@ class IrUiView(models.Model):
89
82
  @api.model
90
83
  def _get_inheritance_handler(self, node):
91
84
  handler = super().apply_inheritance_specs
92
- if hasattr(self, "inheritance_handler_%s" % node.tag):
93
- handler = getattr(self, "inheritance_handler_%s" % node.tag)
85
+ if hasattr(self, f"inheritance_handler_{node.tag}"):
86
+ handler = getattr(self, f"inheritance_handler_{node.tag}")
94
87
  return handler
95
88
 
96
89
  @api.model
97
90
  def _get_inheritance_handler_attributes(self, node):
98
91
  handler = super().apply_inheritance_specs
99
- if hasattr(self, "inheritance_handler_attributes_%s" % node.get("operation")):
92
+ if hasattr(self, f"_inheritance_handler_attributes_{node.get('operation')}"):
100
93
  handler = getattr(
101
- self, "inheritance_handler_attributes_%s" % node.get("operation")
94
+ self, f"_inheritance_handler_attributes_{node.get('operation')}"
102
95
  )
103
96
  return handler
104
97
 
105
98
  @api.model
106
- def inheritance_handler_attributes_update(self, source, specs):
99
+ def _inheritance_handler_attributes_update(self, source, specs):
107
100
  """Implement dict `update` operation on the attribute node.
108
101
 
109
102
  .. code-block:: xml
@@ -130,15 +123,11 @@ class IrUiView(models.Model):
130
123
  # Update node ast dict
131
124
  source_ast = ast_dict_update(source_ast, update_ast)
132
125
  # Dump the ast back to source
133
- # TODO: once odoo requires python >= 3.9; use `ast.unparse` instead
134
- node.attrib[attr_name] = astor.to_source(
135
- source_ast,
136
- pretty_source=lambda s: "".join(s).strip(),
137
- )
126
+ node.attrib[attr_name] = ast.unparse(source_ast).strip()
138
127
  return source
139
128
 
140
129
  @api.model
141
- def inheritance_handler_attributes_text_add(self, source, specs):
130
+ def _inheritance_handler_attributes_text_add(self, source, specs):
142
131
  """Implement
143
132
  <$node position="attributes">
144
133
  <attribute name="$attribute" operation="text_add">
@@ -155,7 +144,7 @@ class IrUiView(models.Model):
155
144
  return source
156
145
 
157
146
  @api.model
158
- def inheritance_handler_attributes_domain_add(self, source, specs):
147
+ def _inheritance_handler_attributes_domain_add(self, source, specs):
159
148
  """Implement
160
149
  <$node position="attributes">
161
150
  <attribute name="$attribute" operation="domain_add"
@@ -171,16 +160,16 @@ class IrUiView(models.Model):
171
160
  old_value = node.get(attribute_name) or ""
172
161
  if old_value:
173
162
  old_domain = ast.literal_eval(
174
- self.var2str_domain_text(old_value.strip())
163
+ self._var2str_domain_text(old_value.strip())
175
164
  )
176
165
  new_domain = ast.literal_eval(
177
- self.var2str_domain_text(attribute_node.text.strip())
166
+ self._var2str_domain_text(attribute_node.text.strip())
178
167
  )
179
168
  if join_operator == "OR":
180
169
  new_value = str(expression.OR([old_domain, new_domain]))
181
170
  else:
182
171
  new_value = str(expression.AND([old_domain, new_domain]))
183
- new_value = self.str2var_domain_text(new_value)
172
+ new_value = self._str2var_domain_text(new_value)
184
173
  old_value = "".join(old_value.splitlines())
185
174
  else:
186
175
  # We must ensure that the domain definition has not line breaks because
@@ -192,7 +181,7 @@ class IrUiView(models.Model):
192
181
  return source
193
182
 
194
183
  @api.model
195
- def var2str_domain_text(self, domain_str):
184
+ def _var2str_domain_text(self, domain_str):
196
185
  """Replaces var names with str names to allow eval without defined vars"""
197
186
  # Replace fields in 2 steps because 1 step returns "parent_sufix"."var_sufix"
198
187
  regex_parent = re.compile(r"parent\.(\b\w+\b)")
@@ -203,7 +192,7 @@ class IrUiView(models.Model):
203
192
  return re.sub(regex, r"'\1_is_a_var_to_replace'", domain_str)
204
193
 
205
194
  @api.model
206
- def str2var_domain_text(self, domain_str):
195
+ def _str2var_domain_text(self, domain_str):
207
196
  """Revert var2str_domain_text cleaning apostrophes and suffix in vars"""
208
197
  pattern = re.compile(r"'(parent\.[^']+)_is_a_var_to_replace'")
209
198
  domain_str = pattern.sub(r"\1", domain_str)
@@ -3,4 +3,7 @@
3
3
  - [Tecnativa](https://www.tecnativa.com):
4
4
  - Sergio Teruel
5
5
  - Carlos Dauden
6
+ - [Trobz](https://www.trobz.com):
7
+ - Nhan Tran \<<nhant@trobz.com>\>
6
8
  - Iván Todorovich \<<ivan.todorovich@camptocamp.com>\>
9
+ - Frederic Grall \<<fgr@apik.cloud>>
@@ -367,9 +367,9 @@ ul.auto-toc {
367
367
  !! This file is generated by oca-gen-addon-readme !!
368
368
  !! changes will be overwritten. !!
369
369
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:27191b04e1a7392892f0450c00e69e35976d78ed35b380c30359a4316f44f950
370
+ !! source digest: sha256:7d139c75ecf0e269f19de0443b9a28f4e56833de6af60ecff96f40a589297f5c
371
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
- <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/17.0/base_view_inheritance_extension"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-base_view_inheritance_extension"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-tools&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/18.0/base_view_inheritance_extension"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_view_inheritance_extension"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
373
  <p>This module was written to make it simple to add custom operators for
374
374
  view inheritance.</p>
375
375
  <p><strong>Table of contents</strong></p>
@@ -426,7 +426,7 @@ conditional changes</strong></p>
426
426
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>.
427
427
  In case of trouble, please check there if your issue has already been reported.
428
428
  If you spotted it first, help us to smash it by providing a detailed and welcomed
429
- <a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_view_inheritance_extension%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
429
+ <a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_view_inheritance_extension%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
430
430
  <p>Do not contact contributors directly about support or help with technical issues.</p>
431
431
  </div>
432
432
  <div class="section" id="credits">
@@ -447,7 +447,12 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
447
447
  <li>Carlos Dauden</li>
448
448
  </ul>
449
449
  </li>
450
+ <li><a class="reference external" href="https://www.trobz.com">Trobz</a>:<ul>
451
+ <li>Nhan Tran &lt;<a class="reference external" href="mailto:nhant&#64;trobz.com">nhant&#64;trobz.com</a>&gt;</li>
452
+ </ul>
453
+ </li>
450
454
  <li>Iván Todorovich &lt;<a class="reference external" href="mailto:ivan.todorovich&#64;camptocamp.com">ivan.todorovich&#64;camptocamp.com</a>&gt;</li>
455
+ <li>Frederic Grall &lt;<a class="reference external" href="mailto:fgr&#64;apik.cloud">fgr&#64;apik.cloud</a>&gt;</li>
451
456
  </ul>
452
457
  </div>
453
458
  <div class="section" id="maintainers">
@@ -459,7 +464,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
459
464
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
460
465
  mission is to support the collaborative development of Odoo features and
461
466
  promote its widespread use.</p>
462
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/17.0/base_view_inheritance_extension">OCA/server-tools</a> project on GitHub.</p>
467
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/18.0/base_view_inheritance_extension">OCA/server-tools</a> project on GitHub.</p>
463
468
  <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
464
469
  </div>
465
470
  </div>
@@ -16,7 +16,7 @@ class TestBaseViewInheritanceExtension(TransactionCase):
16
16
 
17
17
  def test_base_view_inheritance_extension(self):
18
18
  view_id = self.env.ref("base.view_partner_simple_form").id
19
- arch, view = self.env["res.partner"]._get_view(view_id=view_id)
19
+ arch, _ = self.env["res.partner"]._get_view(view_id=view_id)
20
20
  # Verify normal attributes work
21
21
  self.assertEqual(arch.xpath("//form")[0].get("string"), "Partner form")
22
22
  # Verify our extra context key worked
@@ -104,120 +104,78 @@ class TestBaseViewInheritanceExtension(TransactionCase):
104
104
  ]
105
105
  self.assertEqual(
106
106
  res.xpath('//field[@name="invoice_line_ids"]')[0].attrib["context"],
107
- "{%s}" % ", ".join(expected_items),
107
+ "{%s}" % ", ".join(expected_items), # noqa: UP031
108
108
  )
109
109
 
110
- def test_update_attrs_new_key(self):
111
- """Test that we can add new keys to an existing dict"""
110
+ def test_text_add_operation(self):
112
111
  source = etree.fromstring(
113
112
  """
114
113
  <form>
115
- <field
116
- name="ref"
117
- attrs="{'invisible': [('state', '=', 'draft')]}"
118
- />
114
+ <field name="customer_id" string="Client"/>
119
115
  </form>
120
116
  """
121
117
  )
118
+
122
119
  specs = etree.fromstring(
123
120
  """
124
- <field name="ref" position="attributes">
125
- <attribute name="attrs" operation="update">
126
- {
127
- "required": [("state", "!=", "draft")],
128
- }
129
- </attribute>
121
+ <field name="customer_id" position="attributes">
122
+ <attribute name="string"
123
+ operation="text_add">{old_value} Customer</attribute>
130
124
  </field>
131
125
  """
132
126
  )
127
+
133
128
  res = self.env["ir.ui.view"].apply_inheritance_specs(source, specs)
134
129
  self.assertEqual(
135
- res.xpath('//field[@name="ref"]')[0].attrib["attrs"],
136
- "{'invisible': [('state', '=', 'draft')], "
137
- "'required': [('state', '!=', 'draft')]}",
130
+ res.xpath('//field[@name="customer_id"]')[0].attrib["string"],
131
+ "Client Customer",
138
132
  )
139
133
 
140
- def test_update_attrs_replace(self):
141
- """Test that we can replace an existing dict key"""
134
+ def test_update_operation_not_a_dict(self):
135
+ """We should get an error if we try to update a dict with a non-dict spec"""
142
136
  source = etree.fromstring(
143
137
  """
144
138
  <form>
145
- <field
146
- name="ref"
147
- attrs="{
148
- 'invisible': [('state', '=', 'draft')],
149
- 'required': [('state', '=', False)],
150
- }"
151
- />
139
+ <field name="ref" />
152
140
  </form>
153
141
  """
154
142
  )
155
143
  specs = etree.fromstring(
156
144
  """
157
145
  <field name="ref" position="attributes">
158
- <attribute name="attrs" operation="update">
159
- {
160
- "required": [('state', '!=', 'draft')],
161
- }
146
+ <attribute name="context" operation="update">
147
+ ["not", "a", "dict"]
162
148
  </attribute>
163
149
  </field>
164
150
  """
165
151
  )
166
- res = self.env["ir.ui.view"].apply_inheritance_specs(source, specs)
167
- self.assertEqual(
168
- res.xpath('//field[@name="ref"]')[0].attrib["attrs"],
169
- "{'invisible': [('state', '=', 'draft')], "
170
- "'required': [('state', '!=', 'draft')]}",
171
- )
152
+ with self.assertRaisesRegex(
153
+ TypeError, "Operation for attribute `context` is not a dict"
154
+ ):
155
+ self.env["ir.ui.view"].apply_inheritance_specs(source, specs)
172
156
 
173
- def test_update_empty_source_dict(self):
174
- """Test that we can add new keys by creating the dict if it's missing"""
157
+ def test_domain_add_operation(self):
175
158
  source = etree.fromstring(
176
159
  """
177
160
  <form>
178
- <field name="ref" />
161
+ <field name="child_ids" domain="[('state', '=', 'confirm')]" />
179
162
  </form>
180
163
  """
181
164
  )
182
165
  specs = etree.fromstring(
183
166
  """
184
- <field name="ref" position="attributes">
185
- <attribute name="attrs" operation="update">
186
- {
187
- "required": [('state', '!=', 'draft')],
188
- }
167
+ <field name="child_ids" position="attributes">
168
+ <attribute name="domain" operation="domain_add">
169
+ [('state', '!=', 'draft')]
189
170
  </attribute>
190
171
  </field>
191
172
  """
192
173
  )
193
174
  res = self.env["ir.ui.view"].apply_inheritance_specs(source, specs)
194
175
  self.assertEqual(
195
- res.xpath('//field[@name="ref"]')[0].attrib["attrs"],
196
- "{'required': [('state', '!=', 'draft')]}",
197
- )
198
-
199
- def test_update_operation_not_a_dict(self):
200
- """We should get an error if we try to update a dict with a non-dict spec"""
201
- source = etree.fromstring(
202
- """
203
- <form>
204
- <field name="ref" />
205
- </form>
206
- """
176
+ res.xpath('//field[@name="child_ids"]')[0].attrib["domain"],
177
+ "['&', ('state', '=', 'confirm'), ('state', '!=', 'draft')]",
207
178
  )
208
- specs = etree.fromstring(
209
- """
210
- <field name="ref" position="attributes">
211
- <attribute name="attrs" operation="update">
212
- ["not", "a", "dict"]
213
- </attribute>
214
- </field>
215
- """
216
- )
217
- with self.assertRaisesRegex(
218
- TypeError, "Operation for attribute `attrs` is not a dict"
219
- ):
220
- self.env["ir.ui.view"].apply_inheritance_specs(source, specs)
221
179
 
222
180
  def test_update_source_not_a_dict(self):
223
181
  """We should get an error if we try to update a non-dict attribute"""
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-base_view_inheritance_extension
3
- Version: 17.0.1.0.2
3
+ Version: 18.0.1.0.0.3
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: astor
6
- Requires-Dist: odoo>=17.0a,<17.1dev
6
+ Requires-Dist: odoo==18.0.*
7
7
  Summary: Adds more operators for view inheritance
8
8
  Home-page: https://github.com/OCA/server-tools
9
9
  License: LGPL-3
@@ -11,7 +11,7 @@ Author: Therp BV,Odoo Community Association (OCA)
11
11
  Author-email: support@odoo-community.org
12
12
  Classifier: Programming Language :: Python
13
13
  Classifier: Framework :: Odoo
14
- Classifier: Framework :: Odoo :: 17.0
14
+ Classifier: Framework :: Odoo :: 18.0
15
15
  Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
16
16
  Classifier: Development Status :: 6 - Mature
17
17
 
@@ -24,7 +24,7 @@ Extended view inheritance
24
24
  !! This file is generated by oca-gen-addon-readme !!
25
25
  !! changes will be overwritten. !!
26
26
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
- !! source digest: sha256:27191b04e1a7392892f0450c00e69e35976d78ed35b380c30359a4316f44f950
27
+ !! source digest: sha256:7d139c75ecf0e269f19de0443b9a28f4e56833de6af60ecff96f40a589297f5c
28
28
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29
29
 
30
30
  .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
@@ -34,13 +34,13 @@ Extended view inheritance
34
34
  :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
35
35
  :alt: License: LGPL-3
36
36
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
37
- :target: https://github.com/OCA/server-tools/tree/17.0/base_view_inheritance_extension
37
+ :target: https://github.com/OCA/server-tools/tree/18.0/base_view_inheritance_extension
38
38
  :alt: OCA/server-tools
39
39
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
40
- :target: https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-base_view_inheritance_extension
40
+ :target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-base_view_inheritance_extension
41
41
  :alt: Translate me on Weblate
42
42
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
43
- :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=17.0
43
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0
44
44
  :alt: Try me on Runboat
45
45
 
46
46
  |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -92,7 +92,7 @@ conditional changes**
92
92
  Known issues / Roadmap
93
93
  ======================
94
94
 
95
- - Support an ``eval`` attribute for our new node types.
95
+ - Support an ``eval`` attribute for our new node types.
96
96
 
97
97
  Bug Tracker
98
98
  ===========
@@ -100,7 +100,7 @@ Bug Tracker
100
100
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
101
101
  In case of trouble, please check there if your issue has already been reported.
102
102
  If you spotted it first, help us to smash it by providing a detailed and welcomed
103
- `feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_view_inheritance_extension%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
103
+ `feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20base_view_inheritance_extension%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
104
104
 
105
105
  Do not contact contributors directly about support or help with technical issues.
106
106
 
@@ -115,14 +115,19 @@ Authors
115
115
  Contributors
116
116
  ------------
117
117
 
118
- - Holger Brunn <hbrunn@therp.nl>
119
- - Ronald Portier <rportier@therp.nl>
120
- - `Tecnativa <https://www.tecnativa.com>`__:
118
+ - Holger Brunn <hbrunn@therp.nl>
119
+ - Ronald Portier <rportier@therp.nl>
120
+ - `Tecnativa <https://www.tecnativa.com>`__:
121
121
 
122
- - Sergio Teruel
123
- - Carlos Dauden
122
+ - Sergio Teruel
123
+ - Carlos Dauden
124
124
 
125
- - Iván Todorovich <ivan.todorovich@camptocamp.com>
125
+ - `Trobz <https://www.trobz.com>`__:
126
+
127
+ - Nhan Tran <nhant@trobz.com>
128
+
129
+ - Iván Todorovich <ivan.todorovich@camptocamp.com>
130
+ - Frederic Grall <fgr@apik.cloud>
126
131
 
127
132
  Maintainers
128
133
  -----------
@@ -137,6 +142,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
137
142
  mission is to support the collaborative development of Odoo features and
138
143
  promote its widespread use.
139
144
 
140
- This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/17.0/base_view_inheritance_extension>`_ project on GitHub.
145
+ This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/base_view_inheritance_extension>`_ project on GitHub.
141
146
 
142
147
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -1,27 +1,27 @@
1
- odoo/addons/base_view_inheritance_extension/README.rst,sha256=4f9c3AUIYyU6HlzveQViR_fduzh1XRfJ9_axgA3S9J8,4035
1
+ odoo/addons/base_view_inheritance_extension/README.rst,sha256=X2Fnbaf8KLCeInFLm5WHp-S-G0O2B7INHqYxcfN5SbA,4131
2
2
  odoo/addons/base_view_inheritance_extension/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
3
- odoo/addons/base_view_inheritance_extension/__manifest__.py,sha256=2apL8GYv42xbelusDybcD351TJJIfSP57z4W2Se-7fI,616
3
+ odoo/addons/base_view_inheritance_extension/__manifest__.py,sha256=2kT7coafGnnR0wsB5tb-nMnb7wMku13V3at4v4_qXQ8,616
4
4
  odoo/addons/base_view_inheritance_extension/demo/ir_ui_view.xml,sha256=MHPVOGOM6XnNOTsq0ylz1B5r0sPJpRKHLan3K2mZ6sA,1200
5
- odoo/addons/base_view_inheritance_extension/i18n/base_view_inheritance_extension.pot,sha256=B5ae18bfXVMomBlVh0Bf5Su6Q5urtlT2bKWa0Rav7UE,850
5
+ odoo/addons/base_view_inheritance_extension/i18n/base_view_inheritance_extension.pot,sha256=40BeQ2H1XXvtcdjxUnWllckEHGQ7Bwn7NyY1LhkvjAI,850
6
6
  odoo/addons/base_view_inheritance_extension/i18n/ca.po,sha256=xFKkpPiT_RVTTR0H7ZzB2PW6M7aDhRzYhdiCoiRq6mY,1262
7
7
  odoo/addons/base_view_inheritance_extension/i18n/de.po,sha256=MqXxL9L4jJ31fu7jIIqteOvyyznVG-NMTyOsalYrXdk,1183
8
8
  odoo/addons/base_view_inheritance_extension/i18n/es.po,sha256=HtkLoCT-62M6WbiuAEdE_OCTd8L9wzmiDGcufzH8hsM,1315
9
9
  odoo/addons/base_view_inheritance_extension/i18n/es_AR.po,sha256=RNEkhvgpvIDVNEKusHQnz2RfuYQoKR4yr11LSQounhc,1107
10
- odoo/addons/base_view_inheritance_extension/i18n/hr.po,sha256=kp7iynDUebWHuV8GJfY0nHrzwg_Y8mVyhPvzy8EcOqs,1296
10
+ odoo/addons/base_view_inheritance_extension/i18n/hr.po,sha256=ck_ReXm2FHKpVv_O9p8t5lfEVl7FOLH86JFNoq6A-8U,1296
11
11
  odoo/addons/base_view_inheritance_extension/i18n/it.po,sha256=UWxqdWqJePuJaQNGgQEJJgK3ucC3uc63P1H5ZhShFrk,1303
12
- odoo/addons/base_view_inheritance_extension/i18n/sl.po,sha256=EY6zKcR8nRRsfpjrKK2_CVqFXnUVPjSBOAkI4-voRYw,1265
12
+ odoo/addons/base_view_inheritance_extension/i18n/sl.po,sha256=EVtfVKmHdMlk4WjuaMN_xiaiR3vR9KLK0Rvke9fnang,1265
13
13
  odoo/addons/base_view_inheritance_extension/i18n/tr.po,sha256=xaYd2V2mHhQIeLqUpsE4VL3mHbT0DQVNbT9_jCXLc0I,1272
14
14
  odoo/addons/base_view_inheritance_extension/models/__init__.py,sha256=SjKfc8ocbCImvP5DpGQbS0hWmQRYPjtzJdyio6TPII0,25
15
- odoo/addons/base_view_inheritance_extension/models/ir_ui_view.py,sha256=VHSQYgX_NFf8lwA47ddzQ9n7Wje_pwD4gGB0hESK1hk,8239
16
- odoo/addons/base_view_inheritance_extension/readme/CONTRIBUTORS.md,sha256=AplbG1Uhen3Vibr66YJ5c3DidJ2dCK6dWORzEOc_De8,212
15
+ odoo/addons/base_view_inheritance_extension/models/ir_ui_view.py,sha256=3WXq_1WKxxQhEwpKOsIlalkICNEKopXV6Y4RZKm2PHQ,7928
16
+ odoo/addons/base_view_inheritance_extension/readme/CONTRIBUTORS.md,sha256=p9NQX_0BmuvidOJpkxO_NiDS6L19JI3lfxeHfuyG7Fs,319
17
17
  odoo/addons/base_view_inheritance_extension/readme/DESCRIPTION.md,sha256=TC-vXmaSQ5oo7nNl5jxSyurQiz2597hDzQirRGw73BI,88
18
18
  odoo/addons/base_view_inheritance_extension/readme/ROADMAP.md,sha256=79XqQ49EvpKp11-P-rimu8Mwklpwor3rkWKFPym9YbA,54
19
19
  odoo/addons/base_view_inheritance_extension/readme/USAGE.md,sha256=g7ZkBJmm4ldDD-tkQjlzW7WpvssmBi23Dj2KCUuxlug,748
20
20
  odoo/addons/base_view_inheritance_extension/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
21
- odoo/addons/base_view_inheritance_extension/static/description/index.html,sha256=y-5kfFT27fbXeOOE4JhfLC4bW-R-6IlFByhTjFehla8,15519
21
+ odoo/addons/base_view_inheritance_extension/static/description/index.html,sha256=GjjChKJTuqy3YAKBhyDn86fC-LD-h69UpnND9no8Pjg,15842
22
22
  odoo/addons/base_view_inheritance_extension/tests/__init__.py,sha256=kTcGsgnWhpM7vII3sEdNX5XVxDHHqRc5KdrxInG6GSw,51
23
- odoo/addons/base_view_inheritance_extension/tests/test_base_view_inheritance_extension.py,sha256=53qfa3zOJGfmzq282dgX_3kCBDEwT8Wrv5vTP2AwHxw,8635
24
- odoo_addon_base_view_inheritance_extension-17.0.1.0.2.dist-info/METADATA,sha256=D3x-Z0-Hvm2Q0rmA2QQNA6vnNpP_wy_-STNs5YQ6gKg,4653
25
- odoo_addon_base_view_inheritance_extension-17.0.1.0.2.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
26
- odoo_addon_base_view_inheritance_extension-17.0.1.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
27
- odoo_addon_base_view_inheritance_extension-17.0.1.0.2.dist-info/RECORD,,
23
+ odoo/addons/base_view_inheritance_extension/tests/test_base_view_inheritance_extension.py,sha256=7EDc_2z-Cr3v8MFYGj2crWL7kVWc7cvGI2FgY5HVBvY,7185
24
+ odoo_addon_base_view_inheritance_extension-18.0.1.0.0.3.dist-info/METADATA,sha256=wWiIWv5YNSpfPGYN7KtS8igIiqFiunwk9XPDJN3YToo,4743
25
+ odoo_addon_base_view_inheritance_extension-18.0.1.0.0.3.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
26
+ odoo_addon_base_view_inheritance_extension-18.0.1.0.0.3.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
27
+ odoo_addon_base_view_inheritance_extension-18.0.1.0.0.3.dist-info/RECORD,,