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] sale_product_set_packaging_qty: Migration to 18.0 #3474

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

Conversation

trisdoan
Copy link
Contributor

@trisdoan trisdoan commented Dec 10, 2024

Note

Changes in 18.0

  • product_packaging was removed since 15.0, in here
  • constraint positive_qty was added since 16.0, in here
    • As consequences,
      • a check "Please select a packaging with a quantity bigger than 0" can be removed
      • test_error_write_qty_but_packaging_zero is not needed any longer

grindtildeath and others added 26 commits December 4, 2024 15:32
Set the digits on product_packaging_qty to be consistent with other
modules.
Currently translated at 100.0% (5 of 5 strings)

Translation: sale-workflow-13.0/sale-workflow-13.0-sale_product_set_packaging_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_product_set_packaging_qty/es/
Currently translated at 50.0% (4 of 8 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_product_set_packaging_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_product_set_packaging_qty/it/
Currently translated at 100.0% (8 of 8 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_product_set_packaging_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_product_set_packaging_qty/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_product_set_packaging_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_product_set_packaging_qty/
Currently translated at 100.0% (8 of 8 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_product_set_packaging_qty
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_product_set_packaging_qty/es/
…set.line

Changing qty on packaging in product form is not reflected on product.set.line record having this package set.
To avoid this situation, we should recompute packaging_qty and update values
on the product.set.line whenever packaging_ids changes on product.
Copy link
Contributor

@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.

Do you agree with the code move @sebalix @sbejaoui @rousseldenis ?
Having a packaging on a product set line should be in product_set base module.

# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
{
"name": "Sale Product Set Packaging Quantity",
Copy link
Contributor

@jbaudoux jbaudoux Dec 30, 2024

Choose a reason for hiding this comment

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

Suggested change
"name": "Sale Product Set Packaging Quantity",
"name": "Sales Product Set Packaging",

Comment on lines +69 to +15
def prepare_sale_order_line_values(self, order, quantity, max_sequence=0):
res = super().prepare_sale_order_line_values(
order, quantity, max_sequence=max_sequence
)
if self.product_packaging_id:
res["product_packaging_id"] = self.product_packaging_id.id
return res
Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion, only this block should be in this module. Having a packaging on a product set line should be in product_set base module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, great idea, let me work on it, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @jbaudoux, I updated the code: packaging logic was moved in OCA/product-attribute#1828

Copy link
Contributor

Choose a reason for hiding this comment

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

@trisdoan You forgot to move the views

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, I moved the view

@trisdoan trisdoan marked this pull request as draft December 31, 2024 04:09
@trisdoan
Copy link
Contributor Author

trisdoan commented Dec 31, 2024

DRAFT: work on jbaudoux's suggestion

@trisdoan trisdoan force-pushed the 18.0-mig-sale_product_set_packaging_qty branch 3 times, most recently from 770c93f to b14d43f Compare December 31, 2024 07:19
@trisdoan trisdoan marked this pull request as ready for review December 31, 2024 07:20
@trisdoan trisdoan requested a review from jbaudoux December 31, 2024 07:21
@trisdoan trisdoan force-pushed the 18.0-mig-sale_product_set_packaging_qty branch from b14d43f to ae06686 Compare December 31, 2024 10:24
Copy link
Contributor

@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.

LGTM

Copy link

@ajaniszewska-dev ajaniszewska-dev left a comment

Choose a reason for hiding this comment

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

LG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.