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

closes #112101

Signed-off-by: Rémy Voet <ryv@odoo.com>
This commit is contained in:
bve-odoo
2023-06-09 12:58:02 +00:00
parent ec5403c63a
commit 66dcfc9bcb
+1 -1
View File
@@ -195,7 +195,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)