FixHighlight of Weekly #004

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.

Versions18.019.020.0
AppFramework & technical

Pull requests and commits

BranchPull requestCommit
18.0odoo/odoo#294338 ↗b6f90f8012 ↗
19.0odoo/odoo#294641 ↗5557720589 ↗
20.0odoo/odoo#295665 ↗b1f8811385 ↗

Commit message

[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.

My stack

Pick the versions and apps you run. Weekly digests, this week's table and All changes then show only what concerns you. Saved in this browser.

Versions
Apps
Modules