diff options
| author | Adrian Torres <adt@odoo.com> | 2019-01-10 12:28:38 +0000 |
|---|---|---|
| committer | Adrian Torres <adt@odoo.com> | 2019-01-29 16:17:03 +0000 |
| commit | ee6dc40a607626147429389d8f4746f697fadaa6 (patch) | |
| tree | 9a4f66f0b19cbeac08fdda312241323dbefaf34c /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 9ea1eb7aa5e30e3d37131da6acf1b81421de5049 (diff) | |
[IMP] fields: forbid required m2o ondelete set null
A many2one field that is required means that its column cannot contain
null values, however the default ondelete policy for all m2o fields is
`set null`, which contradicts `required=True`.
This patch will, by default, apply the `restrict` policy to required m2o
fields unless the ondelete attribute is explicitly specified. However,
if the policy specified is `set null`, a ValueError will be raised
whenever the registry registers the field as this makes no sense.
The default ondelete policy remains unchanged for non-required m2o
fields (set null)
closes odoo/odoo#30122
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
