Open mohs8421 opened 11 months ago
An other example of a completely not helpful message:
2024-06-25[…] 4 WARNING [REDACTED] py.warnings: /home/odoo/src/odoo/odoo/addons/base/models/ir_module.py:178: DeprecationWarning: XML declarations in HTML module descriptions are deprecated since Odoo 17, report_xlsx can just have a UTF8 description with not need for a declaration.
File "/home/odoo/src/odoo/odoo-bin", line 8, in <module>
odoo.cli.main()
File "/home/odoo/src/odoo/odoo/cli/command.py", line 66, in main
o.run(args)
File "/home/odoo/src/odoo/odoo/cli/server.py", line 179, in run
main(args)
File "/home/odoo/src/odoo/odoo/cli/server.py", line 172, in main
rc = odoo.service.server.start(preload=preload, stop=stop)
File "/home/odoo/src/odoo/odoo/service/server.py", line 1413, in start
rc = server.run(preload, stop)
File "/home/odoo/src/odoo/odoo/service/server.py", line 590, in run
rc = preload_registries(preload)
File "/home/odoo/src/odoo/odoo/service/server.py", line 1313, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "<decorator-gen-16>", line 2, in new
File "/home/odoo/src/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/home/odoo/src/odoo/odoo/modules/registry.py", line 113, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/odoo/src/odoo/odoo/modules/loading.py", line 476, in load_modules
processed_modules += load_marked_modules(env, graph,
File "/home/odoo/src/odoo/odoo/modules/loading.py", line 364, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/odoo/src/odoo/odoo/modules/loading.py", line 222, in load_module_graph
module._check()
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_module.py", line 847, in _check
if not module.description_html:
File "/home/odoo/src/odoo/odoo/fields.py", line 1207, in __get__
self.compute_value(recs)
File "/home/odoo/src/odoo/odoo/fields.py", line 1389, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/odoo/models.py", line 4875, in _compute_field_value
fields.determine(field.compute, self)
File "/home/odoo/src/odoo/odoo/fields.py", line 102, in determine
return needle(*args)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_module.py", line 178, in _get_desc
warnings.warn(
There is exactly zero information in all this about the code that is actually in question. One can be glad, that there is a module name mentioned.
When writing code for Odoo, errors happen, but handling errors should be in a way that supports users to overcome these errors.
Impacted versions: 16.0.0
Steps to reproduce:
Current behavior: Odoo does not indicate what was wrong in a xml file, but just errors with an exception Example:
What this error message is trying to tell me is that the reference I used was not found, I assume this is a very common case on a system where many items refer to each other by names.
Expected behavior: Instead of laying out the internals of odoo, it would be better to point out what was wrong in the xml file. Compare this wall of text to a compile error in rust, one of these is mocking you, the other one teaches you and encourages you to improve.
Addition: I should be more specific about how it should behave here. There are 4 Questions every error message should try to answer:
I can see, how especially question 2 might lead to the answer "Well there is a stack trace, it shows where that thing happened", but that might be very misleading, especially when it's about parsing an xml file. In that case the internals of the parsing mechanism do not help understanding what was wrong in the xml file.
Additionally there should be some boundaries. For example between modules and the odoo framework. If there is an error happening in a module it should not leak into the framework, and the framework should always give a reasonable answer to clients. Responses with blank pages should be a thing of the past.