Friday, December 1, 2023
2 changes · 17.0
Resolved issues and error corrections
This update fixes a critical error that occurs when registering consumed materials in manufacturing quality checks. The system was using an outdated field name that no longer exists, causing the process to fail. By updating to the correct field name, users can now successfully complete quality point checks during manufacturing operations.
Original PR description
This traceback occurs when `stock.move.line` record is created with `qty_done`. To reproduce this issue: 1) Install `mrp_workorder` 2) Create two products `(A, B)` 3) Create a new `bill of material`…
This traceback occurs when `stock.move.line` record is created with `qty_done`.
To reproduce this issue:
1) Install `mrp_workorder`
2) Create two products `(A, B)`
3) Create a new `bill of material` with component as product `B`
and product as `A`
4) Add an `operation` and from the `operation` click on `show instruction` button
5) Create a new `quality.point` record with type as `Register Consumed Materials`
6) give `component_id` value as product `B`
7) Now create a new `Manufacturing Order` with the above created `BOM`
8) Conform the record and click on `Open shop Floor` button from `work order`
9) Click on the `Quality Point` record and click `Continue Consumption` button
Sentry Traceback:-
```
ValueError: Invalid field 'qty_done' on model 'stock.move.line'
File "odoo/http.py", line 2157, in __call__
response = request._serve_db()
File "odoo/http.py", line 1732, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1759, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1960, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 235, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 207, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 722, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 24, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 20, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 466, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "home/odoo/src/enterprise/17.0/mrp_workorder/models/quality.py", line 351, in action_next
return self._next()
File "home/odoo/src/enterprise/17.0/quality_mrp_workorder/models/quality.py", line 38, in _next
result = super()._next(continue_production=continue_production)
File "home/odoo/src/enterprise/17.0/mrp_workorder/models/quality.py", line 510, in _next
line = self.env['stock.move.line'].create(self._create_extra_move_lines())
File "<decorator-gen-412>", line 2, in create
File "odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "home/odoo/src/enterprise/17.0/quality_control/models/stock_move_line.py", line 30, in create
lines = super().create(vals_list)
File "<decorator-gen-248>", line 2, in create
File "odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "addons/stock_account/models/stock_move_line.py", line 17, in create
move_lines = super(StockMoveLine, self).create(vals_list)
File "<decorator-gen-387>", line 2, in create
File "odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "addons/mrp/models/stock_move.py", line 43, in create
res = super(StockMoveLine, self).create(values)
File "<decorator-gen-225>", line 2, in create
File "odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "addons/stock/models/stock_move_line.py", line 305, in create
mls = super().create(vals_list)
File "<decorator-gen-12>", line 2, in create
File "odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "odoo/models.py", line 4538, in create
raise ValueError("Invalid field %r on model %r" % (key, self._name))
```
From this PR (https://github.com/odoo/odoo/pull/137864) `qty_done` field is removed from `stock.move.line` model.
When a record is being created with the `qty_done` field a traceback occurs.
After applying this commit will resolve the issue by replacing `qty_done` with
`quantity` field.
sentry-4636904734The Knowledge app was crashing with memory errors when users had many articles with large images. This fix optimizes how the app loads the article list by reducing unnecessary data retrieval, allowing the Knowledge app to work smoothly even with extensive article libraries.
Original PR description
### Current behavior: The knowledge page's tree fails to load on the client's database, making the knowledge app unusable. ### Expected behavior: The tree loads correctly, allowing users to create…
### Current behavior: The knowledge page's tree fails to load on the client's database, making the knowledge app unusable. ### Expected behavior: The tree loads correctly, allowing users to create and navigate knowledge articles. ### Steps to reproduce: - Create a large number of articles in the knowledge section. - Include multiple base64-encoded images in the body of these articles. - After some time, the tree fails to load, throwing a memory error. ### Reason for the problem: During tree construction, the ORM retrieves visible articles without pagination, which can create an excessive memory usage. The default prefetching loads all fields, including the body field, which can be large like in this case (1.2Gb). We can see that in memray, the cache is at 1.6Gb when the tree is fetched:  ### Fix: Remove the prefetching of the body field in knowledge.article. This optimization speeds up the query and eliminates the possible memory error with a lot of large body. ### Reference: opw-3572719 Forward-Port-Of: odoo/enterprise#51786 Forward-Port-Of: odoo/enterprise#51340