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] product_variant_sale_price: Migration to 18.0 #374

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

Conversation

NICO-SOLUTIONS
Copy link
Member

standard migration

sergio-teruel and others added 30 commits November 20, 2024 11:00
…ate is created

[product_variant_sale_price] Set minimun fix_price among variants to ensure consistency with the price shown in the shop
…ariants

Steps to reproduce:
- create more than one variant
- change fix_price of one variant

Current behavior:
- lst_price of all variants are changed

Expected behavior:
- lst_price of only selected variant is changed
Currently translated at 100,0% (4 of 4 strings)

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

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

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

Translation: product-variant-14.0/product-variant-14.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-14-0/product-variant-14-0-product_variant_sale_price/pt/
Currently translated at 83.3% (5 of 6 strings)

Translation: product-variant-15.0/product-variant-15.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-15-0/product-variant-15-0-product_variant_sale_price/fr/
Currently translated at 100.0% (6 of 6 strings)

Translation: product-variant-15.0/product-variant-15.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-15-0/product-variant-15-0-product_variant_sale_price/ca/
ecino and others added 9 commits November 20, 2024 11:00
Apply suggested changes from FrankC013
Currently translated at 100.0% (6 of 6 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_sale_price/es/
Currently translated at 100.0% (6 of 6 strings)

Translation: product-variant-16.0/product-variant-16.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-16-0/product-variant-16-0-product_variant_sale_price/it/
FIX

[UPD] Update product_variant_sale_price.pot

[BOT] post-merge updates

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-variant-17.0/product-variant-17.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-17-0/product-variant-17-0-product_variant_sale_price/

Translated using Weblate (Italian)

Currently translated at 100.0% (7 of 7 strings)

Translation: product-variant-17.0/product-variant-17.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-17-0/product-variant-17-0-product_variant_sale_price/it/

Translated using Weblate (Spanish)

Currently translated at 100.0% (7 of 7 strings)

Translation: product-variant-17.0/product-variant-17.0-product_variant_sale_price
Translate-URL: https://translation.odoo-community.org/projects/product-variant-17-0/product-variant-17-0-product_variant_sale_price/es/
@NICO-SOLUTIONS NICO-SOLUTIONS marked this pull request as ready for review November 20, 2024 10:33
@NICO-SOLUTIONS NICO-SOLUTIONS mentioned this pull request Nov 20, 2024
3 tasks
@ph-obs
Copy link

ph-obs commented Feb 7, 2025

Hi @NICO-SOLUTIONS. May I ask if you are still working on this, or if ther are any updates?

@NICO-SOLUTIONS
Copy link
Member Author

Hi @NICO-SOLUTIONS. May I ask if you are still working on this, or if ther are any updates?

Feel free to review...

@rousseldenis
Copy link

/ocabot migration product_variant_sale_price

records = super().create(vals)
for i, product_tmpl in enumerate(records):
single_vals = vals[i] if isinstance(vals, list) else vals
product_tmpl._update_fix_price(single_vals)

Choose a reason for hiding this comment

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

IMHO, this should be improved.

Instead, I would have looked at _create_variant_ids() and _prepare_variant_values() in order to avoid too much writes as using variant create() instead.

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@rousseldenis please let me know, if the IMP-commit contains what you were thinking of

@NICO-SOLUTIONS NICO-SOLUTIONS force-pushed the 18.0-mig-product_variant_sale_price branch from b426d0a to 2c008bc Compare February 13, 2025 17:05
…tion

- _create_variant_ids(): Variants receive fix_price directly when created
- write(): Efficiently updates fix_price of variants when `list_price` is changed
- Removes unnecessary _update_fix_price() calls for better performance
@NICO-SOLUTIONS NICO-SOLUTIONS force-pushed the 18.0-mig-product_variant_sale_price branch from 0ea92e0 to 14d1f7f Compare February 14, 2025 09:40
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.