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

[15.0][FIX] project_timeline: Allow to install this module with project_enterprise #1447

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

Conversation

alan196
Copy link
Contributor

@alan196 alan196 commented Mar 13, 2025

This PR fixes an issue added in commit 3689f1d

When the module project_timeline is installed in a database with the module project_enterprise, it raises the following error:

psycopg2.errors.DuplicateColumn: column "planned_date_end" specified more than once

This is because the field planned_date_end is defined in both modules.

This PR checks if the field is already defined in the query before adding it.

Fixes #1433

@alan196
Copy link
Contributor Author

alan196 commented Mar 13, 2025

@HugoCLU @carlos-lopez-tecnativa Could you help me to review 🙏

@@ -11,18 +11,33 @@ class ReportProjectTaskUser(models.Model):
planned_date_end = fields.Datetime(readonly=True)

def _select(self):
res = super()._select()
if "planned_date_end" in res:
Copy link
Member

Choose a reason for hiding this comment

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

This is too broad. You may have other field planned_date_end_custom and do matching.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already make the change @pedrobaeza could you help me to review if this is the change you requested 🙏

…erprise

This PR fixes an issue added in commit

OCA@3689f1d

When the module project_timeline is installed in a database with the module
project_enterprise, it raises the following error:

psycopg2.errors.DuplicateColumn: column "planned_date_end" specified more than once

This is because the field planned_date_end is defined in both modules.

This PR change the field name from planned_date_end to planned_date_end_custom in order
to avoid the conflict.
@alan196 alan196 force-pushed the 15.0-fix-planned-date-end branch from 81b7b4e to afa63a3 Compare March 13, 2025 19:55
@pedrobaeza pedrobaeza added this to the 15.0 milestone Mar 13, 2025
@pedrobaeza
Copy link
Member

No, that was not what I requested. What I requested is that you make the if sentence more explicit, including quotes, comma or something, to make it match only when the exact column name is found, not in other case.

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

Successfully merging this pull request may close these issues.

2 participants