Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] website : one2many fields when no record is found
To reproduce ============ 1) Website Fronteed > Add a page 2) Drag the form block 4) Add a field 5) for the field type select a one2many field (Reactions for example) an error will be raised. Purpose ======= the issue is caused by the condition : https://github.com/odoo/odoo/blob/bec7d16eb4f4e8b27093ac73cb4e638456c516ef/addons/website/static/src/xml/website_form_editor.xml#L331 where `field.records` is an empty array but `![]` is `false` in Javascript, so we will end up with a field without an input then the `querySelector` in this line : https://github.com/odoo/odoo/blob/44fa95f52eedf9e20b11ffe20209fae499446fe1/addons/website/static/src/snippets/s_website_form/options.js#L1363 will return `null` and trying to get `name` from `null` will occure the error. Specification ============= to solve the issue the condition was corrected and some code was moved for styling reasons. the Selection Field was also changed because it looked the same as One2Many field. opw-2916396 closes odoo#96415 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
- Loading branch information