[14.0][OU-FIX] sale_timesheet: Add timesheet_product_id column only if it does not exist - #5945
[14.0][OU-FIX] sale_timesheet: Add timesheet_product_id column only if it does not exist#5945celm1990 wants to merge 1 commit into
Conversation
…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.
|
Hi @pedrobaeza, @StefanRijnhart, @MiquelRForgeFlow, |
pedrobaeza
left a comment
There was a problem hiding this comment.
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.
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?