Skip to Content
Menu
This question has been flagged
1500 Views

When i add a product in Sales/Quotation, i get the error below.

This started happening after i added a new field in Quotation Form (using Studio). I removed that particular field, but now i can't make quotations.

Erro:

Odoo Server Error

Traceback (most recent call last):

File "/home/odoo/src/odoo/13.0/odoo/http.py", line 619, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/home/odoo/src/odoo/13.0/odoo/http.py", line 309, in _handle_exception

raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

File "/home/odoo/src/odoo/13.0/odoo/tools/pycompat.py", line 14, in reraise

raise value

File "/home/odoo/src/odoo/13.0/odoo/http.py", line 664, in dispatch

result = self._call_function(**self.params)

File "/home/odoo/src/odoo/13.0/odoo/http.py", line 345, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/home/odoo/src/odoo/13.0/odoo/service/model.py", line 93, in wrapper

return f(dbname, *args, **kwargs)

File "/home/odoo/src/odoo/13.0/odoo/http.py", line 338, in checked_call

result = self.endpoint(*a, **kw)

File "/home/odoo/src/odoo/13.0/odoo/http.py", line 909, in __call__

return self.method(*args, **kw)

File "/home/odoo/src/odoo/13.0/odoo/http.py", line 510, in response_wrap

response = f(*args, **kw)

File "/home/odoo/src/odoo/13.0/addons/web/controllers/main.py", line 1319, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/home/odoo/src/odoo/13.0/addons/web/controllers/main.py", line 1311, in _call_kw

return call_kw(request.env[model], method, args, kwargs)

File "/home/odoo/src/odoo/13.0/odoo/api.py", line 396, in call_kw

model.flush()

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 5368, in flush

self.recompute()

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 5770, in recompute

process(next(iter(fields_to_compute)))

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 5753, in process

recs.mapped(field.name)

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 5185, in mapped

recs = recs._mapped_func(operator.itemgetter(name))

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 5144, in _mapped_func

vals = [func(rec) for rec in self]

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 5144, in <listcomp>

vals = [func(rec) for rec in self]

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 5589, in __getitem__

return self._fields[key].__get__(self, type(self))

File "/home/odoo/src/odoo/13.0/odoo/fields.py", line 2228, in __get__

return super().__get__(records, owner)

File "/home/odoo/src/odoo/13.0/odoo/fields.py", line 973, in __get__

self.compute_value(recs)

File "/home/odoo/src/odoo/13.0/odoo/fields.py", line 1087, in compute_value

records._compute_field_value(self)

File "/home/odoo/src/odoo/13.0/odoo/models.py", line 3907, in _compute_field_value

field.compute(self)

File "/home/odoo/src/odoo/13.0/odoo/addons/base/models/ir_model.py", line 33, in <lambda>

func = lambda self: safe_eval(text, SAFE_EVAL_BASE, {'self': self}, mode="exec")

File "/home/odoo/src/odoo/13.0/odoo/tools/safe_eval.py", line 347, in safe_eval

c = test_expr(expr, _SAFE_OPCODES, mode=mode)

File "/home/odoo/src/odoo/13.0/odoo/tools/safe_eval.py", line 212, in test_expr

assert_valid_codeobj(allowed_codes, code_obj, expr)

File "/home/odoo/src/odoo/13.0/odoo/tools/safe_eval.py", line 188, in assert_valid_codeobj

raise ValueError("forbidden opcode(s) in %r: %s" % (expr, ', '.join(opname[x] for x in codes)))

ValueError: forbidden opcode(s) in 'class ProductWithBom(models.Model):\r\n\r\n _inherit = "product.product"\r\n\r\n bom = fields.One2many( \r\n comodel_name=\'mrp.bom\',\r\n inverse_name=\'product_id\',\r\n string="Bill of material")': LOAD_BUILD_CLASS


Avatar
Discard