Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] product_configurator: xml domain #121

Open
AurelijaNorvaisaite opened this issue Apr 8, 2024 · 2 comments
Open

[16.0] product_configurator: xml domain #121

AurelijaNorvaisaite opened this issue Apr 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AurelijaNorvaisaite
Copy link

Module

product_configurator

Describe the bug

Can't create rule from product.
`Traceback (most recent call last):
File "/opt/odoo/odoo/odoo/http.py", line 1633, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo/odoo/http.py", line 1660, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/odoo/http.py", line 1864, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 464, in call_kw
result = _call_kw_model(method, model, args, kwargs)
File "/opt/odoo/odoo/odoo/api.py", line 435, in _call_kw_model
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo/odoo/models.py", line 1617, in name_search
return self.browse(ids).sudo().name_get()
File "/opt/odoo/odoo/odoo/models.py", line 5140, in browse
if not ids:
File "/opt/odoo/odoo/odoo/tools/query.py", line 217, in bool
return bool(self._result)
File "/opt/odoo/odoo/odoo/tools/func.py", line 28, in get
value = self.fget(obj)
File "/opt/odoo/odoo/odoo/tools/query.py", line 210, in _result
self._cr.execute(query_str, params)
File "/opt/odoo/odoo/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
psycopg2.errors.DatatypeMismatch: ARRAY types integer and boolean cannot be matched
LINE 1: ...= true) AND ("product_attribute"."id" in (ARRAY[6,false,ARRA...
^

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPCError@http://localhost:8069/web/assets/1750-aec1d4e/web.assets_backend.min.js:997:274
makeErrorFromResponse@http://localhost:8069/web/assets/1750-aec1d4e/web.assets_backend.min.js:1001:163
jsonrpc/promise</<@http://localhost:8069/web/assets/1750-aec1d4e/web.assets_backend.min.js:1009:34`

To Reproduce

16.0:

Steps to reproduce the behavior:

  1. Go to configurable product -> section Configurator
  2. Create new configuration restriction with new Restriction (don't use existing one, but this issue can be with existing rule too)
  3. Go to restriction and try to create Rule.
  4. If restriction and rule are created from separate menu (not product), works correctly.

Expected behavior
Should be allowed to create Restriction Rule.

Additional context
It happens because of the domain on field declaration and xml file:
domain=lambda self: self._compute_attribute_id_domain()
domain="[('id', 'in', context.get('product_attribute_ids', []))]"
Domains are duplicated and the one in xml is not working.

@AurelijaNorvaisaite AurelijaNorvaisaite added the bug Something isn't working label Apr 8, 2024
@peterromao
Copy link

peterromao commented May 2, 2024

I confirm this bug on Odoo 16.0-20231127 (Community Edition)
Exact same steps to reproduce.
I was going to create the issue but Aurelija Vitkauskiene beat me to it.

I just do not understand how you make it work in point 4. What do you mean by separate menu?

@peterromao
Copy link

I just do not understand how you make it work in point 4. What do you mean by separate menu?

I see now... it's via the Configurator base menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants