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][FIX] project_sequence: Force generate sequence_code when creating project from list view #1303

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

joscanog
Copy link

When creating a project from the list view, the sequence_code was not generated. These changes fix that problem.

@OCA-git-bot
Copy link
Contributor

Hi @yajo, @anddago78,
some modules you are maintaining are being modified, check this out!

@@ -72,7 +72,7 @@ def create(self, vals_list):
# It is important to set sequence_code before calling super() because
# other modules such as hr_timesheet expect the name to always have a value
for vals in vals_list:
if "sequence_code" not in vals:
if vals.get("sequence_code", False):
Copy link
Sponsor

Choose a reason for hiding this comment

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

That's the opposite of the current behavior with no other check.
IMHO, the code should be like this:

Suggested change
if vals.get("sequence_code", False):
sequence_code = vals.get("sequence_code", False)
if not sequence_code:

As in views, sequence_code is present but with a "" value.

@joscanog

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @rousseldenis

@joscanog joscanog force-pushed the 16.0-fix-project_sequence branch 3 times, most recently from 06d3f96 to 9b61aef Compare June 18, 2024 15:50
Copy link

@MiguelPoyatos MiguelPoyatos left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@rlizana rlizana left a comment

Choose a reason for hiding this comment

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

LGTM

@rousseldenis rousseldenis added this to the 16.0 milestone Jun 24, 2024
@rousseldenis
Copy link
Sponsor

@joscanog Could you squash commits that you think can be merged together?

@joscanog
Copy link
Author

@joscanog Could you squash commits that you think can be merged together?

Thanks @rousseldenis. I've just done the squash.

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.

None yet

5 participants