Skip to content

[18.0][MIG] product_packaging_type_pallet: Migration to 18.0 #1802

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

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions product_packaging_type_pallet/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ Contributors
Trobz

- Dung Tran <[email protected]>
- Tris Doan <[email protected]>

Other credits
-------------

The migration from 14.0 to 18.0 of this module has been financially
supported by:

- Camptocamp

Maintainers
-----------
Expand Down
4 changes: 2 additions & 2 deletions product_packaging_type_pallet/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
{
"name": "Product Packaging Type Pallet",
"summary": "Manage packaging of pallet type",
"version": "14.0.1.0.1",
"version": "18.0.1.0.0",
"category": "Product",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["product_packaging_dimension", "product_packaging_type"],
"depends": ["product_packaging_dimension", "stock"],
"website": "https://github.com/OCA/product-attribute",
"data": ["views/product_packaging.xml", "views/product_packaging_type.xml"],
"installable": True,
Expand Down
6 changes: 3 additions & 3 deletions product_packaging_type_pallet/models/product_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from odoo import fields, models


class ProductPackagingType(models.Model):
_inherit = "product.packaging.type"
Copy link
Contributor

Choose a reason for hiding this comment

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

Because of this, should we rename the module product_packaging_type_pallet to stock_package_type_pallet?
We also have already some stock_package_type_* modules (in v16) hosted in OCA/stock-logistics-warehouse. Should it be moved there?

@jbaudoux @rousseldenis what do you think?

Copy link
Contributor

@jbaudoux jbaudoux Dec 11, 2024

Choose a reason for hiding this comment

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

@sebalix This module is obsolete. It was a dependency of the reception screen but this is being replaced by shopfloor_reception. At least, that's the plan. And we need to make this configurable on the package type https://github.com/OCA/wms/blob/14.0/shopfloor_reception_packaging_dimension/services/reception.py#L26
so that you can configure on pallet that you only want the height without width/length

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

is_pallet = fields.Boolean()


class ProductPackaging(models.Model):
_inherit = "product.packaging"

type_is_pallet = fields.Boolean(related="packaging_type_id.is_pallet")
type_is_pallet = fields.Boolean(related="package_type_id.is_pallet")
layers = fields.Integer()
packs_per_layer = fields.Integer(help="number of boxes/bags on a layer")
1 change: 1 addition & 0 deletions product_packaging_type_pallet/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
Trobz

- Dung Tran \<<[email protected]>\>
- Tris Doan \<<[email protected]>\>
3 changes: 3 additions & 0 deletions product_packaging_type_pallet/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The migration from 14.0 to 18.0 of this module has been financially supported by:

- Camptocamp
14 changes: 12 additions & 2 deletions product_packaging_type_pallet/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ <h1 class="title">Product Packaging Type Pallet</h1>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-5">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -408,10 +409,19 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<p>Trobz</p>
<ul class="simple">
<li>Dung Tran &lt;<a class="reference external" href="mailto:dungtd&#64;trobz.com">dungtd&#64;trobz.com</a>&gt;</li>
<li>Tris Doan &lt;<a class="reference external" href="mailto:tridm&#64;trobz.com">tridm&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-5">Other credits</a></h2>
<p>The migration from 14.0 to 18.0 of this module has been financially
supported by:</p>
<ul class="simple">
<li>Camptocamp</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
21 changes: 4 additions & 17 deletions product_packaging_type_pallet/views/product_packaging.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,16 @@
ref="product_packaging_dimension.product_packaging_form_view_inherit"
/>
<field name="arch" type="xml">
<field name="packaging_length" position="before">
<field name="type_is_pallet" invisible="1" />
</field>
<field name="packaging_length" position="attributes">
<attribute
name="attrs"
>{'invisible': [('type_is_pallet', '=', True)]}</attribute>
<attribute name="invisible">type_is_pallet</attribute>
</field>
<field name="width" position="attributes">
<attribute
name="attrs"
>{'invisible': [('type_is_pallet', '=', True)]}</attribute>
<attribute name="invisible">type_is_pallet</attribute>
</field>
<group name="dimensions" position="after">
<group name="pallet">
<field
name="layers"
attrs="{'invisible': [('type_is_pallet', '=', False)]}"
/>
<field
name="packs_per_layer"
attrs="{'invisible': [('type_is_pallet', '=', False)]}"
/>
<field name="layers" invisible="not type_is_pallet" />
<field name="packs_per_layer" invisible="not type_is_pallet" />
</group>
</group>
</field>
Expand Down
13 changes: 5 additions & 8 deletions product_packaging_type_pallet/views/product_packaging_type.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_product_packaging_type_form_inherit" model="ir.ui.view">
<field name="name">product.packaging.type.form.inherit</field>
<field name="model">product.packaging.type</field>
<field
name="inherit_id"
ref="product_packaging_type.view_product_packaging_type_form"
/>
<field name="name">stock.package.type.form.inherit</field>
<field name="model">stock.package.type</field>
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rename the file stock_package_type.xml accordingly

<field name="inherit_id" ref="stock.stock_package_type_form" />
<field name="arch" type="xml">
<group name="codes" position="inside">
<field name="barcode" position="after">
<field name="is_pallet" />
</group>
</field>
</field>
</record>
</odoo>