Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] stock_quant_package_dimension: Migration to 18.0 #1872 #44

Open
wants to merge 54 commits into
base: 18.0
Choose a base branch
from

Conversation

arantxa-s73
Copy link

Module migrated to version 18.0

Depends on:

grindtildeath and others added 30 commits February 11, 2025 13:13
When a packaging is auto-assigned on a package, it should not
override any previously set dimensions.

When

* if a user changes the packaging from the UI, all the dimensions are
  overridden from the packaging (even if they are zero) which match the
  general behavior of onchanges
* if the packaging is changed through the "auto assign" mechanism
  (_auto_assign_packaging in context), only the package fields != 0 are
  set from the packaging, as we don't want to silently erase previously
  set dimensions

In the second case, the packaging dimensions act as "default values" for
the dimensions. Example: an hardware scale sets the weight, the other
dimensions (width, height, ...) are completed from the packaging).
Add estimated_pack_weight_kg to stock.quant.package
First, we add a new 'estimated_pack_weight' on the package in
'stock_quant_package_dimension' module which is similar to the
'weight' field implemented in the standard 'delivery' module: it is
done on purpose to not depend on 'delivery'. This weight is thus
computed from product weight.

Second, we re-implement this field in
'stock_quant_package_dimension_total_weight_from_packaging' module
(auto_install) which make use of the weight computation mechanism from
'product_total_weight_from_packaging'. The weight here is computed from
the packaging weight.
francesco-ooops and others added 24 commits February 11, 2025 13:13
Currently translated at 58.3% (14 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/it/
Currently translated at 100.0% (24 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/es/
…efault

As the original field is a computed one with a default, Odoo generates
warning about that default if defined on a related field.

So, override the compute method instead.
Currently translated at 58.3% (14 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/it/
Currently translated at 58.3% (14 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/it/
Currently translated at 100.0% (24 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/
Currently translated at 100.0% (24 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/it/
Currently translated at 100.0% (24 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/es/
Currently translated at 100.0% (24 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/it/
Currently translated at 100.0% (24 of 24 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_package_dimension/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: stock-logistics-workflow-17.0/stock-logistics-workflow-17.0-stock_quant_package_dimension
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_quant_package_dimension/
Copy link

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

Thanks for the migration.

Comment on lines +125 to +126
"weight": "pack_weight",
"length_uom_id": "length_uom_id",

Choose a reason for hiding this comment

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

Can you also copy the volume?
In a separate commit.
To be compliant with OCA/product-attribute#1696

@jbaudoux
Copy link

/ocabot migration stock_quant_package_dimension

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Feb 11, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Feb 11, 2025
2 tasks
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.