Skip to content

Conversation

@hbrunn
Copy link
Member

@hbrunn hbrunn commented Dec 26, 2025

@hbrunn
Copy link
Member Author

hbrunn commented Dec 26, 2025

/ocabot migration product

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Dec 26, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Dec 26, 2025
17 tasks
@hbrunn hbrunn force-pushed the 19.0-initialize+openupgrade_framework+base+uom+mail+product branch from 44a5d66 to 7882bd2 Compare December 26, 2025 15:46
@hbrunn hbrunn force-pushed the 19.0-initialize+openupgrade_framework+base+uom+mail+product branch 2 times, most recently from 9366c47 to 7a9d1a8 Compare February 9, 2026 08:28
@hbrunn hbrunn mentioned this pull request Feb 9, 2026
2 tasks
@hbrunn hbrunn force-pushed the 19.0-initialize+openupgrade_framework+base+uom+mail+product branch from 7a9d1a8 to 4fa5139 Compare February 9, 2026 19:46
Comment on lines +73 to +75
FROM product_product, product_template
WHERE
product_supplierinfo.product_id=product_product.id
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
FROM product_product, product_template
WHERE
product_supplierinfo.product_id=product_product.id
FROM product_template
WHERE
product_supplierinfo.product_id IS NOT NULL

Rename product_packaging here to product_uom, and amend with data in post-migration
Set uom_id to dummy UOM to have the ORM set up the not null constraint correctly
"""
openupgrade.rename_tables(env.cr, [("product_packaging", "product_uom")])
Copy link
Contributor

Choose a reason for hiding this comment

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

call rename_models too.

# NOTHING TO DO: virtual field only used for searching

product / product.product / packaging_ids (one2many) : DEL relation: product.packaging
product / product.product / product_uom_ids (one2many) : NEW relation: product.uom
Copy link
Contributor

Choose a reason for hiding this comment

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

why not rename fields too?

openupgrade.delete_records_safely_by_xml_id(
env,
[
"product.constraint_product_packaging_positive_qty",
Copy link
Contributor

Choose a reason for hiding this comment

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

better delete constraints with delete_sql_constraint_safely.

NEW product.category: product.product_category_services (noupdate)
DEL product.category: product.cat_expense (noupdate)
DEL product.category: product.product_category_1 (noupdate)
DEL product.category: product.product_category_all (noupdate)
Copy link
Contributor

Choose a reason for hiding this comment

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

safely remove this one

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.

3 participants