[Web favicon] gives 500 internal server error when restoring from backup -> (AttributeError: 'res.company' object has no attribute '_get_favicon').
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript, python
Research direction
Start by reading the web_favicon module and the website.layout template identified in the traceback; trace where _get_favicon is defined and how the restored database loads the module. Reproduce the restore on Odoo 18.0 with the module installed, then confirm the database can load without the 500 error.
Written by the indexing model from the issue text.
Description
Module
web_favicon
Describe the bug
I installed the module to test and since then I can't use the gui anymore as it gives a "500: internal server error". Did make a backup but that seems to be corrupted also.
To Reproduce
Affected versions: 18.0
Steps to reproduce the behavior:
- Install the module
- Add a favicon in both the favicon field in company and in website settings
- Make a backup of the database (zip)
- Restore the database (in a clean odoo environment, off course with all addons in the addon directory that were alsop present when making the backup
- Select the database in database manager
- You'll see the 500 page and below error appears in the log
Expected behavior
No Internal server error
Additional context
I tried adding a favicon column in table res_company (directly in the database) but this didn't solve it, unfortunately. As I can't get in the gui I also can't take a look in the technical part of views/models etc where the field is mentioned.
So I have 2 questions:
- Does anyone know where to look so the 500 doesn't appear instantly when selecting the database in the database manager? Either in changing something directly in the database or CLI?
- Might this be a bug in the module (I think so as I tested with an old backup and the same happened
Error traceback
> Traceback (most recent call last):
File "<2011>", line 1931, in template_2011
File "<2011>", line 1309, in template_2011_content
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 2533, in _load_values
return get_value()
^^^^^^^^^^^
File "<2011>", line 1299, in template_2011_t_cache_0_cache
File "<2011>", line 565, in template_2011_t_cache_0
AttributeError: 'res.company' object has no attribute '_get_favicon'The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 2554, in call
response = request._serve_db()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/http.py", line 2081, in _serve_db
return self._transactioning(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/http.py", line 2144, in _transactioning
return service_model.retrying(func, env=self.env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 156, in retrying
result = func()
^^^^^^
File "/usr/lib/python3/dist-packages/odoo/http.py", line 2111, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/http.py", line 2272, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 335, in dispatch
result.flatten()
File "/usr/lib/python3/dist-packages/odoo/tools/facade.py", line 83, in wrap_func
func(self.wrapped, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1418, in flatten
self.response.append(self.render())
^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1410, in render
return request.env["ir.ui.view"]._render_template(self.template, self.qcontext)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 453, in _render_template
return super()._render_template(template, values=values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 2218, in _render_template
return self.env['ir.qweb']._render(template, values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/tools/profiler.py", line 313, in _tracked_method_render
return method_render(self, template, values, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 607, in _render
result = ''.join(rendering)
^^^^^^^^^^^^^^^^^^
File "<185>", line 263, in template_185
File "<185>", line 252, in template_185_content
File "<184>", line 51, in template_184
File "<184>", line 40, in template_184_content
File "<2011>", line 1939, in template_2011
odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
AttributeError: 'res.company' object has no attribute '_get_favicon'
Template: website.layout
Path: /t/html/head/link[3]
Node:
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 30
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OCA/web
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[19.0] web_timeline: ValueError "Invalid field 'date_start:month'" when grouping by a date fieldPossibly taken @stferraro claimed this today. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
[19.0] web_m2x_options: system parameter + m2o options not working properly when no recordsPossibly taken @CristhianAC claimed this 11 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 1 day
-
Migration to version 20.0Possibly taken A pull request linked to this issue is open or already merged. Openhelp wanted no stale work in progress
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 1-2 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
Similar issues
-
bug package:workers-shared
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/workers-sdk#16924 · 1 comment ·
Maintainers usually reply within 1 day
-
dashboard
Difficulty 2/5 Half a day Newbie friendliness 78/100
damodharg6/payledger#9 ·
-
parse: child keys like `007`, `1e3`, `0x1f`, `-1` make the parent an empty array and hide the valueOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area/mobile area/ui good first issue
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
natemoo-re/ultrahtml#102 ·