Skip to content

[20.0][MIG] project_sequence - #1810

Open
sudhir-erpharbor wants to merge 38 commits into
OCA:20.0from
sudhir-erpharbor:20.0-mig-project_sequence
Open

sudhir-erpharbor wants to merge 38 commits into
OCA:20.0from
sudhir-erpharbor:20.0-mig-project_sequence

Conversation

@sudhir-erpharbor

Copy link
Copy Markdown

No description provided.

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not strictly required and all odoo source code is using encoding="utf-8" ?>

Please remove this change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It is done by pre-commit only and if I remove it, pre-commit will fail.

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not strictly required and all odoo source code is using encoding="utf-8" ?>

Please remove this change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It is done by pre-commit only and if I remove it, pre-commit will fail.

@sudhir-erpharbor sudhir-erpharbor mentioned this pull request Oct 5, 2026
3 of 43 tasks
@MiquelRForgeFlow

Copy link
Copy Markdown
Contributor

Please cherry-pick #1860.

@oca-cla-bot

oca-cla-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@sudhir-erpharbor
sudhir-erpharbor force-pushed the 20.0-mig-project_sequence branch from 95ae5c0 to be30093 Compare November 2, 2026 06:45
OCA-git-bot and others added 22 commits November 18, 2026 16:56
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

[UPD] Update project_sequence.pot

[UPD] README.rst

project_sequence 14.0.0.1.1
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

[UPD] Update project_sequence.pot

[UPD] README.rst

project_sequence 14.0.0.2.0

Update translation files

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/
@moduon MT-2822

[UPD] Update project_sequence.pot

[UPD] README.rst

project_sequence 15.0.0.2.1
Translated using Weblate (Italian)

Currently translated at 100.0% (9 of 9 strings)

Translation: project-15.0/project-15.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-15-0/project-15-0-project_sequence/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-16.0/project-16.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_sequence/
Currently translated at 100.0% (10 of 10 strings)

Translation: project-16.0/project-16.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_sequence/it/
Currently translated at 100.0% (10 of 10 strings)

Translation: project-16.0/project-16.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_sequence/de/
Currently translated at 100.0% (10 of 10 strings)

Translation: project-16.0/project-16.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_sequence/es/
Currently translated at 90.0% (9 of 10 strings)

Translation: project-16.0/project-16.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_sequence/nl/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-16.0/project-16.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_sequence/
OCA-git-bot and others added 15 commits November 18, 2026 16:56
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-17.0/project-17.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-17-0/project-17-0-project_sequence/
test_sequence_after_creation used Form(project.project) on a fresh
record. Form initialization runs every model onchange to compute
defaults, including sale_project's _onchange_sale_line_id, which reads
reinvoiced_sale_order_id — a field restricted by
sales_team.group_sale_salesman. When sale_project is installed in the
same database, the project-only manager test user has no sale rights
and the onchange raises AccessError, even though the behaviour being
tested has nothing to do with sales.

Replace the Form-based pre-save check with a non-persisted new()
record, which exercises the same invariant ("no sequence_code before
creation") without triggering unrelated onchanges. The post-save
assertions still use create() and remain unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Currently translated at 100.0% (11 of 11 strings)

Translation: project-19.0/project-19.0-project_sequence
Translate-URL: https://translation.odoo-community.org/projects/project-19-0/project-19-0-project_sequence/sl/
@sudhir-erpharbor
sudhir-erpharbor force-pushed the 20.0-mig-project_sequence branch from be30093 to 163941c Compare November 18, 2026 11:26
@sudhir-erpharbor
sudhir-erpharbor force-pushed the 20.0-mig-project_sequence branch from 163941c to 92ba52a Compare November 23, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.