Clear error for incomplete property definitions
A property definition without a name now raises the documented ValueError instead of KeyError, so create, write and import can report it.
A property definition without a name now raises the documented ValueError instead of KeyError, so create, write and import can report it.
| Branch | Pull request | Commit |
|---|---|---|
| 18.0 | odoo/odoo#294338 ↗ | b6f90f8012 ↗ |
| 19.0 | odoo/odoo#294641 ↗ | 5557720589 ↗ |
| 20.0 | odoo/odoo#295665 ↗ | b1f8811385 ↗ |
[FIX] orm: validate the required keys of a property definition first `_validate_properties_definition` checks the property name before it checks that the required keys are present, so a definition without `name` raises `KeyError: 'name'` instead of the `ValueError` the method documents, and the "Some key are missing [name]" branch is unreachable. Swapping the two checks lets the callers (`create`, `write`, or the import converter) report the error instead of crashing on it.