Skip to content

[MIG] project_sequence: migrate to v15 #1114

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

Merged
merged 14 commits into from
May 15, 2023

Conversation

yajo
Copy link
Member

@yajo yajo commented May 15, 2023

Standard migration.

@moduon MT-2822

OCA-git-bot and others added 14 commits May 15, 2023 09:04
When a project has a name, still the sequence is a very important field to be displayed. I move it below the project name.

@moduon MT-1506
`hr_timesheet` creates an analytic account by default. The method it uses to create it expects a preexisting name. But since we're making name not required, we're breaking other module's expectations.

To fix this problem, now the name sync is done before writing or creating records, and not after.

To make sure the problem doesn't happen anymore, we keep the `NOT NULL` requirement on project names. We just do it with a manual SQL constraint. This extra protection ensures compatibility with any other modules that expect always a value on the name.

Any possibly misconfigured sequence could produce sequence duplicates. I also add protection against that.

In tests, the project sequence was wrongly reset to 11 only once. Turns out that it survives the test savepoint, so I now reset it before each test instead. Tests are more reliable now. Besides, I added some more.

@moduon MT-1506

wip

wip
These projects shouldn't display "False - Project name" in their display names.

@moduon MT-1506
To change the project display name pattern, follow these steps:

1. Go to *Project > Configuration > Settings*.
2. Edit the *Project display name pattern* field.

   The default format is ``%(sequence_code)s - %(name)s``. You can use those
   same placeholders to customize the pattern.

@moduon MT-1506
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-14.0/project-14.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_sequence/
@yajo yajo self-assigned this May 15, 2023
@yajo yajo added the migration label May 15, 2023
@yajo yajo added this to the 15.0 milestone May 15, 2023
@yajo
Copy link
Member Author

yajo commented May 15, 2023

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-1114-by-yajo-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit c51edff into OCA:15.0 May 15, 2023
@OCA-git-bot
Copy link
Contributor

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

@yajo yajo deleted the 15.0-mig-project_sequence branch May 15, 2023 09:55
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.

3 participants