OCA/product-configurator

Error when adding configuration restrictions on a product

Closed this issue · 2 comments

Recreation:
Configurator -> Configuration Restrictions -> Add a line -> Configure a new Attribute line -> Save
image


Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo/odoo-boti/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/opt/odoo/odoo-boti/odoo/odoo/http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-boti/odoo/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-boti/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo-boti/odoo/odoo/http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo-boti/odoo/odoo/http.py", line 912, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo-boti/odoo/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo-boti/odoo/addons/web/controllers/main.py", line 1389, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/odoo-boti/odoo/addons/web/controllers/main.py", line 1381, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo-boti/odoo/odoo/api.py", line 396, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo-boti/odoo/odoo/api.py", line 383, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/odoo-boti/odoo/addons/base_automation/models/base_automation.py", line 344, in write
write.origin(records, vals, **kw)
File "/opt/odoo/odoo-boti/odoo/addons/sale_timesheet/models/product.py", line 84, in write
return super(ProductTemplate, self).write(vals)
File "/opt/odoo/odoo-boti/odoo/addons/stock_account/models/product.py", line 50, in write
res = super(ProductTemplate, self).write(vals)
File "/opt/odoo/odoo-boti/src/third-party/product_configurator/models/product.py", line 345, in write
return super(ProductTemplate, self).write(vals)
File "/opt/odoo/odoo-boti/odoo/addons/mrp/models/product.py", line 38, in write
return super().write(values)
File "/opt/odoo/odoo-boti/odoo/addons/stock/models/product.py", line 769, in write
return super(ProductTemplate, self).write(vals)
File "/opt/odoo/odoo-boti/odoo/addons/product/models/product_template.py", line 427, in write
res = super(ProductTemplate, self).write(vals)
File "/opt/odoo/odoo-boti/odoo/addons/mail/models/mail_thread.py", line 322, in write
result = super(MailThread, self).write(values)
File "/opt/odoo/odoo-boti/odoo/addons/mail/models/mail_activity.py", line 766, in write
return super(MailActivityMixin, self).write(vals)
File "/opt/odoo/odoo-boti/odoo/odoo/models.py", line 3663, in write
field.write(self, vals[fname])
File "/opt/odoo/odoo-boti/odoo/odoo/fields.py", line 3043, in write
return self.write_batch([(records, value)])
File "/opt/odoo/odoo-boti/odoo/odoo/fields.py", line 3064, in write_batch
return self.write_real(records_commands_list, create)
File "/opt/odoo/odoo-boti/odoo/odoo/fields.py", line 3236, in write_real
flush()
File "/opt/odoo/odoo-boti/odoo/odoo/fields.py", line 3200, in flush
comodel.create(to_create)
File "/opt/odoo/odoo-venv/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/odoo/odoo-boti/odoo/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo-boti/odoo/odoo/addons/base/models/ir_fields.py", line 533, in create
recs = super().create(vals_list)
File "/opt/odoo/odoo-venv/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/odoo/odoo-boti/odoo/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo-boti/odoo/odoo/models.py", line 3868, in create
records = self._create(data_list)
File "/opt/odoo/odoo-boti/odoo/odoo/models.py", line 4026, in _create
field.create([
File "/opt/odoo/odoo-boti/odoo/odoo/fields.py", line 3038, in create
self.write_batch(record_values, True)
File "/opt/odoo/odoo-boti/odoo/odoo/fields.py", line 3064, in write_batch
return self.write_real(records_commands_list, create)
File "/opt/odoo/odoo-boti/odoo/odoo/fields.py", line 3632, in write_real
cr.execute(query, pairs)
File "/opt/odoo/odoo-venv/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/odoo/odoo-boti/odoo/odoo/sql_db.py", line 101, in check
return f(self, *args, **kwargs)
File "/opt/odoo/odoo-boti/odoo/odoo/sql_db.py", line 298, in execute
res = self._obj.execute(query, params)
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/odoo/odoo-boti/odoo/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-boti/odoo/odoo/http.py", line 315, in handle_exception
raise exception.with_traceback(None) from new_cause
psycopg2.errors.UndefinedTable: relation "cfg_line_attr_val_id_rel" does not exist
LINE 1: INSERT INTO cfg_line_attr_val_id_rel (cfg_line_id, attr_val
...
^

I'll look into this, I wasn't able to reproduce the issue on my instance and the error seems to refer to a missing table in the database, perhaps updating the app will rebuild that relationship.

This looks like it is resolved