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][IMP] product_secondary_unit: Store factor on the line #1768

Draft
wants to merge 78 commits into
base: 18.0
Choose a base branch
from

Conversation

pfranck
Copy link

@pfranck pfranck commented Nov 12, 2024

For petroleum company they don't use a fixed factor of conversion for all lines but the factor depends per line - (depends on temp3rature) - therefore I store the default factor in the line and we can overwrite it

Depends on: #1767

sergio-teruel and others added 30 commits November 12, 2024 13:20
Currently translated at 100.0% (17 of 17 strings)

Translation: product-attribute-11.0/product-attribute-11.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-11-0/product-attribute-11-0-product_secondary_unit/fr/
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Currently translated at 100.0% (16 of 16 strings)

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

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

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

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

Translation: product-attribute-13.0/product-attribute-13.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_secondary_unit/fr/
…en secondary uom changes

[FIX] product_secondary_unit: Avoid cache missed
oca-ci and others added 24 commits November 12, 2024 13:20
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-16.0/product-attribute-16.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_secondary_unit/
Currently translated at 100.0% (24 of 24 strings)

Translation: product-attribute-16.0/product-attribute-16.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_secondary_unit/pt_BR/
Currently translated at 100.0% (24 of 24 strings)

Translation: product-attribute-16.0/product-attribute-16.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_secondary_unit/es/
The field `secondary_uom_qty` is defined in the mixin class
`product.secondary.unit.mixin` as being computed, but without
precomputation. This makes that when this field is used in
the variable `_secondary_unit_fields` for classes using the
mixing, it ends up as a dependency of other fields that are
computed and do require precomputation. But, not being the
field `secondary_uom_qty` precomputed, it disables the
precomputation of those other fields.

This has an impact when installing the module `sale` along
with the module `product_secondary_unit`, which causes the
module `sale_order_secondary_unit` to be auto-installed. As
a result, the following errors appear in the log, disabling
the precomputation of 11 other fields:

```text
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.product_uom_qty cannot be precomputed as it depends on non-precomputed field sale.order.line.secondary_uom_qty
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.price_unit cannot be precomputed as it depends on non-precomputed field sale.order.line.product_uom_qty
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.discount cannot be precomputed as it depends on non-precomputed field sale.order.line.product_uom_qty
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.price_reduce cannot be precomputed as it depends on non-precomputed field sale.order.line.price_unit
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.price_subtotal cannot be precomputed as it depends on non-precomputed field sale.order.line.product_uom_qty
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.price_tax cannot be precomputed as it depends on non-precomputed field sale.order.line.product_uom_qty
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.price_total cannot be precomputed as it depends on non-precomputed field sale.order.line.product_uom_qty
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.price_reduce_taxexcl cannot be precomputed as it depends on non-precomputed field sale.order.line.price_subtotal
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.price_reduce_taxinc cannot be precomputed as it depends on non-precomputed field sale.order.line.price_total
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.product_packaging_id cannot be precomputed as it depends on non-precomputed field sale.order.line.product_uom_qty
/opt/project/repos/odoo/odoo/fields.py:802: UserWarning: Field sale.order.line.product_packaging_qty cannot be precomputed as it depends on non-precomputed field sale.order.line.product_packaging_id
```

Making `secondary_uom_qty` precomputed solves these warnings.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-16.0/product-attribute-16.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_secondary_unit/
Currently translated at 100.0% (24 of 24 strings)

Translation: product-attribute-16.0/product-attribute-16.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_secondary_unit/it/
Currently translated at 100.0% (24 of 24 strings)

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

Translation: product-attribute-17.0/product-attribute-17.0-product_secondary_unit
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_secondary_unit/
For petroleum company they don't use a fixed factor of conversion for all lines but the factor depends per line - (depends on temp3rature) - therefore I store the default factor in the line and we can overwrite it
@pfranck pfranck changed the title [IMP] product_secondary_unit: Store factor on the line [18.0][IMP] product_secondary_unit: Store factor on the line Nov 13, 2024
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.