Skip to content
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

[16.0][MIG] partner_event: Migration to version 16.0 #345

Merged
merged 27 commits into from
Oct 7, 2023

Conversation

carolinafernandez-tecnativa
Copy link

@carolinafernandez-tecnativa carolinafernandez-tecnativa commented Oct 4, 2023

@Tecnativa

TT45235

@pedrobaeza @chienandalu

P.D: Close PR #322

@pedrobaeza
Copy link
Member

/ocabot migration partner_event

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Oct 4, 2023
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 4, 2023
16 tasks
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to cherry-pick the PR as it was, or better, start from scratch the procedure to get everything, including new translations.

partner_event/__manifest__.py Outdated Show resolved Hide resolved
Copy link

@fcvalgar fcvalgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional Review

LGTM, thank you @carolinafernandez-tecnativa

image

image

@carolinafernandez-tecnativa
Copy link
Author

WIP cherry-pick

antespi and others added 19 commits October 5, 2023 10:16
These fields were stored. That usually is good, but if you add partners to an event from the wizard, it means each `res.partner` record gets its `registration_count` field updated.

When you update any record, fields `write_uid` and `write_date` are updated too.

Now imagine you want to add 4000 partners to an event. That would take time. If in the mean time any other user updates the `res.partner` record (along with their `write_UID` and `WRITE_DATE` fields), you would get this error:

```
openerp.sql_db: bad query: UPDATE "res_partner" SET "registration_count"=3,"write_uid"=5,"write_date"=(now() at time zone 'UTC') WHERE id IN (25578)
Traceback (most recent call last):
  File "/opt/odoo/common/openerp/v8/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
TransactionRollbackError: could not serialize access due to concurrent update
CONTEXT:  SQL statement "SELECT 1 FROM ONLY "public"."res_users" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x"
```

By removing the `store=True` parameter, you simply avoid those concurrent updates and do not block other users.

But this changes the database structure, so remember to update your database!
If adding 1000 partners, we save now 999 queries.

(cherry picked from commit 89853ef)
Currently translated at 100.0% (24 of 24 strings)

Translation: event-12.0/event-12.0-partner_event
Translate-URL: https://translation.odoo-community.org/projects/event-12-0/event-12-0-partner_event/es/
@carolinafernandez-tecnativa carolinafernandez-tecnativa force-pushed the 16.0-mig-partner_event branch 3 times, most recently from 41ae0f2 to 9c188de Compare October 5, 2023 13:29
@carolinafernandez-tecnativa
Copy link
Author

@pedrobaeza @chienandalu could you please check it now? Thnks!

@pedrobaeza
Copy link
Member

Administrative commits squashing is missing.

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from @pedrobaeza comments 👍

pedrobaeza and others added 6 commits October 6, 2023 05:55
…oint

For speeding up the process. Specially the removal of the savepoints
makes that Postgres don't go slow as hell. Check
https://www.cybertec-postgresql.com/en/subtransactions-and-performance-in-postgresql/
for some rationale. The problem happens even releasing the previous
savepoints.

As this module is very old, the reason for doing it this way and skip
registrations with error is not fully known, but the view mentions about
registration duplication, so let's avoid it and handle later other
possible exceptions.

TT26694
When we confirm a sale order, the registrations are precreated without
the email info, so we were missing the chance to get the info for the
partner attendant.

Now we compute it on the write as well.

TT45149
@carolinafernandez-tecnativa
Copy link
Author

Administrative commits squashing is missing.

Done!

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-345-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 76a3c4f into OCA:16.0 Oct 7, 2023
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 52a3051. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.