Skip to content

Comments

[19.0][MIG] product_dimension: Migration to 19.0.#2089

Open
hieulucky111 wants to merge 61 commits intoOCA:19.0from
komit-consulting:19.0-mig-product_dimension
Open

[19.0][MIG] product_dimension: Migration to 19.0.#2089
hieulucky111 wants to merge 61 commits intoOCA:19.0from
komit-consulting:19.0-mig-product_dimension

Conversation

@hieulucky111
Copy link

No description provided.

lepistone and others added 30 commits October 1, 2025 16:21
osv -> orm

test computation of volume in same UOM

add test with conversion from cm

refactor, new API, generic UOM computation

fix wording in readme

do not use camelcase for Models

put dimensions in their own group

Otherwise they are shown as weights.

fill in placeholders in README

README is actually rst, not md

use a new-api onchange, update tests, refactor

Also, spell "height" correctly.
REF remove executable permission

ADD missing tag images

Conflicts:
	product_dimension/__openerp__.py
FIX remove oldname in field height

ADD onchange calculate volume on product template
[MIG] Make modules uninstallable

[MIG] Rename manifest files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-12.0/product-attribute-12.0-product_dimension
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_dimension/
Currently translated at 100.0% (8 of 8 strings)

Translation: product-attribute-12.0/product-attribute-12.0-product_dimension
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_dimension/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-12.0/product-attribute-12.0-product_dimension
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_dimension/
Currently translated at 100.0% (11 of 11 strings)

Translation: product-attribute-12.0/product-attribute-12.0-product_dimension
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_dimension/pt/
Currently translated at 100.0% (11 of 11 strings)

Translation: product-attribute-13.0/product-attribute-13.0-product_dimension
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_dimension/de/
Currently translated at 100.0% (11 of 11 strings)

Translation: product-attribute-13.0/product-attribute-13.0-product_dimension
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_dimension/fr/
@pedrobaeza
Copy link
Member

/ocabot migration product_dimension

@rousseldenis
Copy link
Contributor

/ocabot migration product_dimension

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Oct 6, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 6, 2025
72 tasks
"uom.uom",
"Dimensional UoM",
help="UoM for length, height, width",
default=lambda self: self.env.ref("uom.product_uom_meter"),

Choose a reason for hiding this comment

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

@hieulucky111 I think this default isn't working as intended since it's overriding the unit I choose when creating a product manually. I'm unsure if this is the case for previous versions though.

Also, this is more of a personal doubt. Since UoM categories no longer exist in v19 should we try and filter the available uoms for this field somehow? Odoo's approach in some settings fields is just to hardcode a couple of UoM for each category though I don't quite like it.
https://github.com/odoo/odoo/blob/9900375bc0bac2754150fd8cd6a1e45ecad8da83/addons/product/models/res_config_settings.py#L14

Copy link
Author

Choose a reason for hiding this comment

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

Hello @ferran-S73
I’ve rechecked the behavior in both versions 18 and 19. When creating a new Product Template and selecting a Dimension UoM, the selected UoM disappears after saving. (Same issue in both versions)

Regarding the UoM filter, we could use a System Parameter to store the list of available UoM names. However, I don’t think that’s necessary for now.

Copy link
Member

Choose a reason for hiding this comment

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

It's likely that this issue can be solved by aligning with how Odoo does this for weight, by storing the UoM on the product template (https://github.com/odoo/odoo/blob/27b3d2fc055c586f4d53c92f5a7a93301d7d7d17/addons/product/models/product_template.py#L110-L113).

Copy link
Author

Choose a reason for hiding this comment

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

hello @StefanRijnhart, do you see this as a critical blocker, or can we treat it as a future enhancement?
Personally, I think we can address this in a later.

Copy link
Member

Choose a reason for hiding this comment

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

I'd say it's pretty serious if this module provides a field that is not stored when creating a new record even if the user has selected a value for it. The product.template model is now more prominent than back when this (old) module was first introduced, so the impact of the bug has gotten bigger even if the bug has existed in past versions.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, i will improve this soon.

Copy link
Author

Choose a reason for hiding this comment

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

hello @StefanRijnhart, i have applied your suggestion. I also move the default UoM from product.product to product.template. (Because variant creation will set again the value of product template).
Thank you.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the update! Checking runboat, I still seem to be able to reproduce the original issue. Did it work for you while testing locally?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it works for me before pushing the updated code. Maybe we need to upgrade again module?

Copy link
Member

Choose a reason for hiding this comment

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

Weird. The failure to store the dimensional uom when creating product templates is easily reproced in a test, it turns out. The solution is also easy: apparently, a similar issue occurs with the other fields in this module, and this is fixed with the override on _prepare_variant_values. Fix proposed onto your branch in komit-consulting#1. You can squash it into your own commit.

Copy link
Contributor

@Vang-NguyenPhu Vang-NguyenPhu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Reyes4711-S73 Reyes4711-S73 left a comment

Choose a reason for hiding this comment

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

LGTM

@Reyes4711-S73
Copy link
Contributor

@OCA/product-maintainers Please, can you merge this PR?

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@mav-adhoc
Copy link

LGTM

Copy link
Contributor

@BhaveshHeliconia BhaveshHeliconia left a comment

Choose a reason for hiding this comment

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

LGTM!

@JordiMForgeFlow
Copy link
Contributor

@rousseldenis could you merge this one? :)

@StefanRijnhart
Copy link
Member

Is there no interest in fixing #2089 (review)?

Copy link

@Camille0907 Camille0907 left a comment

Choose a reason for hiding this comment

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

Migration LGTM, thank you 🙂

@Camille0907
Copy link

@OCA/product-maintainers Hello, is there anything missing, before we can get the PR merged ? 🙂

@hieulucky111 hieulucky111 force-pushed the 19.0-mig-product_dimension branch from ce7c56b to 2ff7c80 Compare January 30, 2026 09:54
@JordiMForgeFlow
Copy link
Contributor

@rousseldenis could this one be merged?

@StefanRijnhart
Copy link
Member

@JordiMForgeFlow Let's wait until #2089 (review) is fixed. We found the solution now.

gediminasvenc added a commit to linserv/product-attribute that referenced this pull request Feb 20, 2026
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.