Files
odoo_source/addons/test_base_automation/security/ir.model.access.csv
T
Raphael Collet 1de5dc4b96 [FIX] base_automation: recursive computed field cause too many calls to flush
The use-case that motivated this fix is the deletion of a project task
with many subtasks.  The field 'project_id' on tasks is recursively
computed, and some automated action must be executed when its value
corresponds to a given project.

The issue occurs when the domain of automated actions is evaluated by
method search(), because the latter flushes the fields to search on,
which are also the ones being recomputed.  Combined with the fact that
recursive fields are not computed in batch, this leads to a huge amount
of recursive calls between the automated action and flush().

The execution of task.unlink() looks like this:
- mark 'project_id' to compute on subtasks
- delete task
- flush()
  - recompute 'project_id' on subtask1
    - call compute on subtask1
    - in action, search([('id', 'in', subtask1.ids), ('project_id', '=', pid)])
      - flush(['id', 'project_id'])
        - recompute 'project_id' on subtask2
          - call compute on subtask2
          - in action, search([('id', 'in', subtask2.ids), ('project_id', '=', pid)])
            - flush(['id', 'project_id'])
              - recompute 'project_id' on subtask3
                - call compute on subtask3
                - in action, search([('id', 'in', subtask3.ids), ('project_id', '=', pid)])
                  - flush(['id', 'project_id'])
                    - recompute 'project_id' on subtask4
                      ...

closes odoo/odoo#80141

X-original-commit: e2788b580ef15ef3083ac919737a46d850143832
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-11-19 19:36:49 +00:00

768 B

1idnamemodel_id:idgroup_id:idperm_readperm_writeperm_createperm_unlink
2access_base_automation_lead_testaccess_base_automation_lead_testmodel_base_automation_lead_testbase.group_system1111
3access_base_automation_line_testaccess_base_automation_line_testmodel_base_automation_line_testbase.group_system1111
4access_base_automation_link_testaccess_base_automation_link_testmodel_base_automation_link_test1111
5access_base_automation_linked_testaccess_base_automation_linked_testmodel_base_automation_linked_test1111
6access_test_base_automation_projectaccess_test_base_automation_projectmodel_test_base_automation_project1111
7access_test_base_automation_taskaccess_test_base_automation_taskmodel_test_base_automation_task1111