Skip to content

[14.0][OU-FIX] sale_timesheet: Add timesheet_product_id column only if it does not exist - #5945

Open
celm1990 wants to merge 1 commit into
OCA:14.0from
celm1990:14.0-ou-fix-sale_timesheet
Open

[14.0][OU-FIX] sale_timesheet: Add timesheet_product_id column only if it does not exist#5945
celm1990 wants to merge 1 commit into
OCA:14.0from
celm1990:14.0-ou-fix-sale_timesheet

Conversation

@celm1990

Copy link
Copy Markdown

In the Enterprise edition, this field is added by the industry_fsm module. To prevent an SQL error when the column already exists, add the IF NOT EXISTS clause.

@pedrobaeza @MiquelRForgeFlow @hbrunn could you please review this?

…oes not exist

In the Enterprise edition, this field is added by the industry_fsm module. To prevent an SQL error when the column already exists, add the IF NOT EXISTS clause.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @pedrobaeza, @StefanRijnhart, @MiquelRForgeFlow,
some modules you are maintaining are being modified, check this out!

@pedrobaeza pedrobaeza added this to the 14.0 milestone Aug 26, 2026

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The link doesn't work, as it's private. I think this is something that should be handled outside OpenUpgrade, as if the column exists, we can't control which value it has and why is there, so adding defensive code in case they exist is not the mission of OpenUpgrade (except the column exists by the own Odoo community in a previous version), but something to be prepared previously.

Imagine you have the column because there's an exotic module installed in your DB adding timesheet_product_id with another value. It would be more tolerable if the UPDATE query still overwrites all the values.

In this case, I would remove the column before passing OU.

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.

3 participants