Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
dc2505de by Cédric Krier at 2023-08-10T15:05:23+02:00
Simplify foreign key search in ModelSQL delete
- - - - -
5383374e by Cédric Krier at 2023-08-10T15:07:37+02:00
Reuse get_related_records to search restricted foreign keys
- - - - -
fefe53f7 by Cédric Krier at 2023-08-10T16:42:36+02:00
Clean self references before deleting records

When deleting a full branch of a tree, if the number of records deleted is
higher than IN_MAX, the foreign key constraint may prevent the deletion
because the group of records deleted may still be referencing a record in the
next group to delete.
To prevent this failure, we must first clean the values of the column with
foreign key referencing the same table. We use the table id as value instead
of NULL in case the column is not nullable.
- - - - -


3 changed files:

- trytond/trytond/model/modelsql.py
- trytond/trytond/tests/modelsql.py
- trytond/trytond/tests/test_modelsql.py


View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/fa3490f723210281a2bca35d4b7fcf6d050d5af0...fefe53f7af7703809975277d63d635341f4c533b

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/fa3490f723210281a2bca35d4b7fcf6d050d5af0...fefe53f7af7703809975277d63d635341f4c533b
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to