Skip to content

[FIX] repair: Virtual Locations have no Warehouse - #5985

Open
SirPyTech wants to merge 1 commit into
OCA:17.0from
PyTech-SRL:17.0-fix-repair-virtual_location
Open

SirPyTech wants to merge 1 commit into
OCA:17.0from
PyTech-SRL:17.0-fix-repair-virtual_location

Conversation

@SirPyTech

Copy link
Copy Markdown

Fix #5474.

When the Location of a Repair Order is a Virtual Location (no Warehouse), the temporary Location/Type could not be deleted resulting in the error:

psycopg2.errors.NotNullViolation: null value in column "location_dest_id" of relation "repair_order" violates not-null
constraint CONTEXT: SQL statement "UPDATE ONLY "public"."repair_order" SET "location_dest_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "location_dest_id""

Archive and keep the temporary Location/Type if that happens.

When the Location of a Repair Order is a Virtual Location (no Warehouse), the temporary Location/Type could not be deleted resulting in the error:
> psycopg2.errors.NotNullViolation: null value in column "location_dest_id" of relation "repair_order" violates not-null
> constraint CONTEXT:  SQL statement "UPDATE ONLY "public"."repair_order" SET "location_dest_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "location_dest_id""

Archive and keep the temporary Location/Type if that happens.
@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:17.0 labels Sep 15, 2026
@SirPyTech

Copy link
Copy Markdown
Author

@FranciscoBigWings @pleirb you faced the linked issue, would you like to have a look? Thanks!

@HekkiMelody HekkiMelody left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review, LGTM.

Also, tested on a migration that had this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:openupgrade_scripts Module openupgrade_scripts series:17.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants