Commit e8ca86d
committed
[IMP] util/records: enforce
The implementation of the python inheritance mechanism between the base class
`ir.actions.actions` and its child classes (eg. `ir.actions.act_window`) does
not allow the creation of foreign keys when `ir.actions.actions` is a M2O field
of another model; what leads to the not execution of some constraints, one of
them being the `ondelete='cascade'` constraint, which is set in PSQL level.
That said, when a `ir.actions.actions` record is deleted, if it is being
referenced as a M2O field by another model (eg. `ir.filters`), records from this
second model won't be affected, what leads to undesired behaviour: a
MissingError in the UI, indicating that the action was deleted.
Such behaviour of not creating foreign keys and thus constraints is specific to
`ir.actions.actions`.
This commit remedies this specific case, removing records with a M2O field to
`ir.actions.actions` with `ondelete=cascade` when the action referenced in such
field is removed using `upgrade-util`.cascade removal for actions1 parent 3787631 commit e8ca86d
1 file changed
+52
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
312 | 360 | | |
313 | 361 | | |
314 | 362 | | |
| |||
351 | 399 | | |
352 | 400 | | |
353 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
354 | 406 | | |
355 | 407 | | |
356 | 408 | | |
357 | | - | |
358 | 409 | | |
359 | 410 | | |
360 | 411 | | |
| |||
0 commit comments