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

[17.0] [MIG] product_packaging_level: Migration to 17.0 #1662

Open
wants to merge 31 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
44ef139
[IMP] product_packaging_type: Rename to product_packaging_level
rousseldenis Nov 28, 2022
cfb8720
[IMP] product_packaging_level: Add migration scripts
rousseldenis Nov 28, 2022
74237dc
[IMP] product_packaging_level: Improve README
rousseldenis Sep 18, 2023
06855b2
[UPD] Update product_packaging_level.pot
Sep 18, 2023
e5684e7
oca-github-bot post-merge updates
OCA-git-bot Sep 18, 2023
e593183
[FIX] product_packaging_level: Use correct field in hook
rousseldenis Sep 19, 2023
be8e3bc
oca-github-bot post-merge updates
OCA-git-bot Sep 19, 2023
c783522
Update translation files
weblate Sep 20, 2023
e56a8bb
Translated using Weblate (Spanish)
Ivorra78 Sep 27, 2023
0e089e4
[IMP] product_packaging_level: configure product packaging name
anothingguy Oct 10, 2023
230e5c9
[UPD] Update product_packaging_level.pot
Oct 12, 2023
c5aba95
[BOT] post-merge updates
OCA-git-bot Oct 12, 2023
55f3407
Update translation files
weblate Oct 12, 2023
5131f47
Translated using Weblate (Spanish)
Ivorra78 Oct 12, 2023
3214b64
Added translation using Weblate (Italian)
mymage Oct 29, 2023
228f3f5
Translated using Weblate (Italian)
mymage Oct 29, 2023
f72935c
Translated using Weblate (Italian)
mymage Oct 29, 2023
c550fcf
[16.0][FIX] product_packaging_level: Preserve sequence order
p-tombez Feb 14, 2024
cfec740
[UPD] Update product_packaging_level.pot
Mar 26, 2024
5db3c93
[BOT] post-merge updates
OCA-git-bot Mar 26, 2024
9c29ff0
Update translation files
weblate Mar 26, 2024
e609c0e
Translated using Weblate (Spanish)
Ivorra78 Mar 26, 2024
7d966e8
[IMP]product_packaging_level: recover name_get policy flow
Feb 26, 2024
f49e6cb
[UPD] Update product_packaging_level.pot
Mar 27, 2024
f701d92
[BOT] post-merge updates
OCA-git-bot Mar 27, 2024
584cbc8
Update translation files
weblate Mar 27, 2024
a3b366f
Translated using Weblate (Spanish)
Ivorra78 Mar 27, 2024
dd1447b
Translated using Weblate (Italian)
mymage Apr 2, 2024
3bf188e
Translated using Weblate (Italian)
mymage May 23, 2024
b87a841
[IMP] product_packaging_level: pre-commit auto fixes
bizzappdev Jun 18, 2024
61d8f55
[MIG] product_packaging_level: Migration to 17.0
bizzappdev Jun 18, 2024
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
115 changes: 115 additions & 0 deletions product_packaging_level/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
=======================
Product Packaging Level
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:75e11fae4004a39e651e1162643c5ec763d00d748cec9d0478e483067b24c164
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/17.0/product_packaging_level
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_packaging_level
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module binds a product packaging to a packaging level.

There are usually 3 levels:

- The primary: it is the closest to the product, also called the retail
packaging
- The secondary: it allows to ship the products already in the primary
packaging, like a box
- The tertiary: it allows to ship large quantities in warehousing, like
a pallet

This differentiates from the odoo standard package type that is typing
the packaging in a more precise way and that can serve for put-away
routing in the warehouse.

For example a small box and a large box, or an EPAL pallet and CHEP
pallet.

**Table of contents**

.. contents::
:local:

Usage
=====

To create a new packaging level:

1. Go to *Inventory > Configuration > Products > Product Packaging
Level*.
2. You can create/edit/delete packaging levels

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_packaging_level%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Camptocamp

Contributors
------------

- `Camptocamp <https://www.camptocamp.com>`__

- Damien Crier <[email protected]>
- Hiep (Nguyen Hoang) <[email protected]>
- Hoang Diep <[email protected]>

- Christopher Ormaza <[email protected]>
- Denis Roussel <[email protected]>

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

The development of this module has been financially supported by:

- Camptocamp

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/17.0/product_packaging_level>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions product_packaging_level/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import pre_init_hook
25 changes: 25 additions & 0 deletions product_packaging_level/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2019-2020 Camptocamp (<https://www.camptocamp.com>).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

{
"name": "Product Packaging Level",
"version": "17.0.1.0.0",
"development_status": "Beta",
"category": "Product",
"summary": "This module binds a product packaging to a packaging level",
"author": "Camptocamp, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"license": "LGPL-3",
"depends": ["product", "stock"],
"data": [
"data/product_packaging_level.xml",
"security/ir.model.access.csv",
"views/product_packaging_level_view.xml",
"views/product_packaging_view.xml",
"views/stock_package_type_view.xml",
],
"installable": True,
"auto_install": False,
"external_dependencies": {"python": ["openupgradelib"]},
"pre_init_hook": "pre_init_hook",
}
9 changes: 9 additions & 0 deletions product_packaging_level/data/product_packaging_level.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="product_packaging_level_default" model="product.packaging.level">
<field name="name">Default Level</field>
<field name="code">DEFAULT</field>
<field name="sequence">1</field>
<field name="is_default" eval="True" />
</record>
</odoo>
25 changes: 25 additions & 0 deletions product_packaging_level/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2022 ACSONE SA/NV
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from openupgradelib import openupgrade

from odoo import SUPERUSER_ID, api


def pre_init_hook(env):
if openupgrade.table_exists(env.cr, "product_packaging_type"):
env = api.Environment(env.cr, SUPERUSER_ID, {})

Check warning on line 10 in product_packaging_level/hooks.py

View check run for this annotation

Codecov / codecov/patch

product_packaging_level/hooks.py#L10

Added line #L10 was not covered by tests
# Former version of the module is present
models = [("product.packaging.type", "product.packaging.level")]
openupgrade.rename_models(env.cr, models)
fields = [

Check warning on line 14 in product_packaging_level/hooks.py

View check run for this annotation

Codecov / codecov/patch

product_packaging_level/hooks.py#L12-L14

Added lines #L12 - L14 were not covered by tests
(
"product.packaging",
"product_packaging",
"packaging_type_id",
"packaging_level_id",
)
]
openupgrade.rename_fields(env, fields, no_deep=True)

Check warning on line 22 in product_packaging_level/hooks.py

View check run for this annotation

Codecov / codecov/patch

product_packaging_level/hooks.py#L22

Added line #L22 was not covered by tests

modules = [("product_packaging_type", "product_packaging_level")]
openupgrade.update_module_names(env.cr, modules, merge_modules=True)

Check warning on line 25 in product_packaging_level/hooks.py

View check run for this annotation

Codecov / codecov/patch

product_packaging_level/hooks.py#L24-L25

Added lines #L24 - L25 were not covered by tests
Loading