Skip to content
Snippets Groups Projects
Commit 97ffffbe authored by bve-odoo's avatar bve-odoo
Browse files

[FIX] web_editor: better error message when missing filename field


closes #112101

Signed-off-by: default avatarRémy Voet <ryv@odoo.com>
parent ee1a7176
No related branches found
No related tags found
No related merge requests found
......@@ -193,7 +193,7 @@ class Web_Editor(http.Controller):
@http.route('/web_editor/stars', type='json', auth='user')
def update_stars(self, res_model, res_id, filename, starsId, rating):
record = request.env[res_model].browse(res_id)
value = getattr(record, filename, False)
value = filename in record._fields and record[filename]
htmlelem = etree.fromstring("<div>%s</div>" % value, etree.HTMLParser())
stars_widget = htmlelem.find(".//span[@id='checkId-%s']" % starsId)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment