[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user