-
Notifications
You must be signed in to change notification settings - Fork 60
[FIX] records: use temp table in replacing refs #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
upgradeci retry with always only documents_project_sale in version 18.0 |
What examples do we have of such issue? Isn't this a problem of the caller to replace_records_reference_batch? Or that we should implement something perhaps splitting the id mapping? |
i saw this so far only in documents upgrade when replacing folders with documents here |
cd641d9
to
de159d9
Compare
Can you add a test? |
de159d9
to
7bdd490
Compare
The test depends on odoo/odoo#200509 |
7bdd490
to
324ea17
Compare
324ea17
to
65d35c3
Compare
the community PR is merged and the test is now green |
65d35c3
to
44c3584
Compare
44c3584
to
8ab406a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add tests for the new assert
function to expect they behave correctly in all expected cases.
17335f2
to
49c5b20
Compare
Updated the assert methods, and ended up using a temp table for the assertNotUpdated as well instead of raising a psql exception. |
Two contextmanager methods added to UnitTestCase to assert wether records in the database are updated or not. The assert requires a table name and an optional list of ids. If ids are provided, those specific records will be checked if updated or not. If no ids are provided then the validation will be based on the insert or update of any record of that relation.
For the jsonb company dependent indirect references when replacing record refs, building the query using the original id mapping input can generate a large query based on the number of references being updated, leading to a 'stack depth limit exceeded' error. We can use the mapping saved in the temp table _upgrade_rrr instead.
49c5b20
to
44e4d51
Compare
For the jsonb company dependent indirect references when replacing record refs, building the query using the original id mapping input can generate a large query based on the number of references being updated, leading to a
stack depth limit exceeded
error.We can use the mapping saved in the temp table
_upgrade_rrr
instead.TBG-1752