Friday, October 18, 2024
2 changes · saas-17.4
Resolved issues and error corrections
This fix prevents table border colors added in dark mode from being saved in a way that looks wrong after switching back to light mode. It helps keep chatter messages visually consistent and avoids environment-dependent test failures between Odoo editions.
Original PR description
Issue: ====== - The border-color of the table is different in light mode and dark mode. - convert_inline_test which have the border-color fails because it depends if we are in enterprise or…
Issue: ====== - The border-color of the table is different in light mode and dark mode. - convert_inline_test which have the border-color fails because it depends if we are in enterprise or community. Issue [1]. Steps to reproduce the issue: ============================= - Go to any record with chatter - Switch dark mode - Add a table - Log it - Switch light mode - The border-color is different than a table added in light mode. Origin of the issue: ==================== We already have a commit [2] that removes the border-colors from the cssRules since it really depends on the mode. After this [3] we forced to apply the border-color from the computed value which will be wrong. Solution: ========= We remove the border-color from the forced styles. [1]: https://runbot.odoo.com/web#id=103155&view_type=form&model=runbot.build.error&menu_id=405&cids=1 [2]: https://github.com/odoo/odoo/commit/16ab970fa33119a4fc1a9c5dd249ca467ff3b2c8 [3]: https://github.com/odoo/odoo/commit/1e654e8f7e0a403a25b595be410614dfc8a69179
This fix prevents an error when users click Done on a newly added work order before saving the manufacturing order. It improves reliability in manufacturing workflows by avoiding a crash and keeping the user action from triggering invalid processing.
Original PR description
When the customer creates the workorder for MO and clicks on the Done button without saving the record, a traceback will appear. Steps to reproduce the error: - Create one MO > Work Orders > Add a…
When the customer creates the workorder for MO and clicks on the Done button
without saving the record, a traceback will appear.
Steps to reproduce the error:
- Create one MO > Work Orders > Add a line > Click on Dropdown > Click on Done
Traceback:
```
IndexError: tuple index out of range
File "odoo/http.py", line 2364, in __call__
response = request._serve_db()
File "odoo/http.py", line 1891, in _serve_db
return self._transactioning(
File "odoo/http.py", line 1954, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 137, in retrying
result = func()
File "odoo/http.py", line 1921, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2168, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 330, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 728, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 35, in call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 517, in call_kw
result = getattr(recs, name)(*args, **kwargs)
File "home/odoo/src/enterprise/18.0/mrp_workorder/models/mrp_workorder.py", line 876, in action_mark_as_done
self.button_finish()
File "home/odoo/src/enterprise/18.0/mrp_workorder/models/mrp_workorder.py", line 303, in button_finish
return super().button_finish()
File "addons/mrp/models/mrp_workorder.py", line 661, in button_finish
workorder.with_context(bypass_duration_calculation=True).write(vals)
File "home/odoo/src/enterprise/18.0/mrp_workorder/models/mrp_workorder.py", line 114, in write
res = super().write(values)
File "addons/mrp/models/mrp_workorder.py", line 475, in write
if workorder == workorder.production_id.workorder_ids[0] and 'date_start' in values:
File "odoo/models.py", line 7004, in __getitem__
return self.browse((self._ids[key],))
```
https://github.com/odoo/odoo/blob/a082495359a2e6a2bf25cc3744eb80fd6899f5d1/addons/mrp/models/mrp_workorder.py#L462 Here, when customer clicks on the Done button without saving the record,
``workorder_ids`` will be empty, so it will lead to the above traceback.
https://github.com/odoo/odoo/blob/a082495359a2e6a2bf25cc3744eb80fd6899f5d1/addons/mrp/static/src/components/wo_list_view_dropdown/wo_list_view_dropdown.js#L52-L61
Here, ``ids`` is ``false`` because the record is not saved yet,
It will call the ``action_mark_as_done`` method with ``false`` ids,
eventually, it will generate the above traceback.
sentry-5973943945
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr