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][MOV] product_packaging_type_required becomes product_packaging_level_required #1803

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

Conversation

trisdoan
Copy link
Contributor

@trisdoan trisdoan commented Dec 5, 2024

Note

This change

  • This module's feature was extracted from the original product_packaging_type_required module.
  • Now, packaging level is the one that should be marked as required

@trisdoan trisdoan mentioned this pull request Dec 5, 2024
25 tasks


class PackageType(models.Model):
_inherit = "stock.package.type"
Copy link
Contributor

Choose a reason for hiding this comment

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

With this change:

  • I would rename the file stock_package_type.py
  • Should we also rename the module from product_packaging_type_required to stock_package_type_required, and move it in OCA/stock-logistics-warehouse alongside other stock_package_type_* modules (some in v16)?

cc @jbaudoux @rousseldenis

Copy link
Contributor

Choose a reason for hiding this comment

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

no, see my comment on the PR

@@ -1,29 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

This file can be renamed stock_package_type.xml

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.

It's now package level. This is the one that needs to be marked as required.
Need to rename module to product_packaging_level_required and change models and filenames.

In v16, odoo integrated stock.package.storage.type as stock.package.type. And product.packaging.type has been renamed to stock.packaging.level.

damdam-s and others added 23 commits December 16, 2024 11:01
Currently translated at 100.0% (3 of 3 strings)

Translation: product-attribute-13.0/product-attribute-13.0-product_packaging_type_required
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_packaging_type_required/es/
The limit was useless because never used.
That's also the reason why the cron was working.
Limit is dropped now and the code improved a little bit.
A basic test and logging has been added too.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-14.0/product-attribute-14.0-product_packaging_type_required
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_packaging_type_required/
Currently translated at 100.0% (6 of 6 strings)

Translation: product-attribute-14.0/product-attribute-14.0-product_packaging_type_required
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_packaging_type_required/it/
Currently translated at 100.0% (6 of 6 strings)

Translation: product-attribute-14.0/product-attribute-14.0-product_packaging_type_required
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_packaging_type_required/es/
@trisdoan trisdoan marked this pull request as draft December 16, 2024 04:18
@trisdoan trisdoan force-pushed the 18.0-mig-product_packaging_type_required branch from 7b0f5f5 to d98a495 Compare December 16, 2024 05:05
@trisdoan trisdoan changed the title [18.0][MIG] product_packaging_type_required: Migration to 18.0 [18.0][MOV] product_packaging_type_required: Migration to 18.0 Dec 16, 2024
@trisdoan trisdoan changed the title [18.0][MOV] product_packaging_type_required: Migration to 18.0 [18.0][MOV] product_packaging_type_required becomes product_packaging_level_required Dec 16, 2024
@trisdoan trisdoan marked this pull request as ready for review December 16, 2024 05:14
@trisdoan trisdoan marked this pull request as draft December 16, 2024 05:14
@trisdoan trisdoan force-pushed the 18.0-mig-product_packaging_type_required branch from f477c29 to c6a6f1a Compare December 16, 2024 05:27
@trisdoan trisdoan marked this pull request as ready for review December 16, 2024 05:28
@trisdoan trisdoan requested review from sebalix and jbaudoux December 16, 2024 05:30
@trisdoan
Copy link
Contributor Author

Hello @jbaudoux , @sebalix, I just updated the code, please help to take a look 🙏

@trisdoan trisdoan force-pushed the 18.0-mig-product_packaging_type_required branch from c6a6f1a to afd1d9d Compare December 16, 2024 07:22
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.

I'm not fan of the module name. What about product_packaging_auto_create?

ref="product_packaging_type.model_product_packaging_type"
name="model_id"
/>
<field ref="stock.model_stock_package_type" name="model_id" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be level here also I guess

)
required_packaging_types = self.search([("required", "=", True)])
def cron_check_create_required_packaging_level(self):
"""Create required packaging level for each consumable product if missing."""
Copy link
Contributor

Choose a reason for hiding this comment

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

It's product packing you are creating

class ProductPackagingType(models.Model):
_inherit = "product.packaging.type"
class ProductPackagingLevel(models.Model):
_inherit = "product.packaging.level"

required = fields.Boolean()
Copy link
Contributor

Choose a reason for hiding this comment

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

auto_create_packaging
Help: a cron will create a packaging for each product missing a packaging with this level

@trisdoan trisdoan force-pushed the 18.0-mig-product_packaging_type_required branch from afd1d9d to dc77e6a Compare December 17, 2024 05:30
@trisdoan trisdoan requested a review from jbaudoux December 17, 2024 06:02
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.