-
-
Notifications
You must be signed in to change notification settings - Fork 711
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
base: 18.0
Are you sure you want to change the base?
[18.0][MOV] product_packaging_type_required becomes product_packaging_level_required #1803
Conversation
|
||
|
||
class PackageType(models.Model): | ||
_inherit = "stock.package.type" |
There was a problem hiding this comment.
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
tostock_package_type_required
, and move it in OCA/stock-logistics-warehouse alongside otherstock_package_type_*
modules (some in v16)?
There was a problem hiding this comment.
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" ?> |
There was a problem hiding this comment.
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
There was a problem hiding this 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
.
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/
7b0f5f5
to
d98a495
Compare
f477c29
to
c6a6f1a
Compare
c6a6f1a
to
afd1d9d
Compare
There was a problem hiding this 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" /> |
There was a problem hiding this comment.
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.""" |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
afd1d9d
to
dc77e6a
Compare
Note
This change