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

[15.0][MIG] stock_packaging_calculator #1327

Merged
merged 41 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c5c0a63
Add stock_packaging_calculator
simahawk May 26, 2020
d893e45
stock_packaging_calculator: make product uom the minimal unit
simahawk Jun 8, 2020
97ea806
[UPD] Update stock_packaging_calculator.pot
oca-travis Jun 8, 2020
e0249f9
stock_packaging_calculator: return dict instead of tuple
simahawk Jun 8, 2020
9b48b27
[UPD] README.rst
OCA-git-bot Jun 8, 2020
4dd8a45
[ADD] icon.png
OCA-git-bot Jun 8, 2020
93bf5e3
stock_packaging_calculator: add contained packaging compute
simahawk Jun 8, 2020
7539376
[UPD] README.rst
OCA-git-bot Jun 9, 2020
cb0eb5f
stock_packaging_calculator 13.0.1.1.0
OCA-git-bot Jun 9, 2020
e5d336f
stock_packaging_calculator: make contained mapping computed
simahawk Jun 9, 2020
1cf5fde
[UPD] Update stock_packaging_calculator.pot
oca-travis Jun 22, 2020
a1f94a0
stock_packaging_calculator 13.0.1.2.0
OCA-git-bot Jun 22, 2020
a560a7e
stock_packaging_calculator: add support for packaging filter
simahawk Jun 30, 2020
267a39c
stock_packaging_calculator: add support for custom packaging name
simahawk Jun 30, 2020
25e2fa6
stock_packaging_calculator 13.0.1.3.0
OCA-git-bot Jul 1, 2020
f671228
Re-license stock_packaging_calculator w/ LGPL
simahawk Jul 15, 2020
edcfbaf
stock_packaging_calculator 13.0.1.4.0
OCA-git-bot Jul 16, 2020
6a3bb8d
[IMP][stock_packaging_calculator] Add key is_unit for in the packagin…
Tonow-c2c Jul 6, 2020
0b1eaf9
stock_packaging_calculator: Add hook on packaging values
grindtildeath Jul 16, 2020
c4b0237
stock_packaging_calculator 13.0.1.5.0
simahawk Jul 17, 2020
415fff5
packaging_calculator: fix sorting
simahawk Aug 3, 2020
19092f8
packaging_calculator: allow custom value handler
simahawk Aug 3, 2020
0102fec
stock_packaging_calculator 13.0.1.6.0
OCA-git-bot Aug 11, 2020
b086eb7
[IMP] stock_packaging_calculator: black, isort, prettier
sebastienbeau Jan 6, 2021
77bc739
[MIG] stock_packaging_calculator: Migration to 14.0
sebastienbeau Jan 6, 2021
6591a22
[UPD] Update stock_packaging_calculator.pot
oca-travis Feb 5, 2021
0ec650a
[UPD] README.rst
OCA-git-bot Feb 5, 2021
2eae0e4
stock_packaging_calculator 14.0.1.0.1
OCA-git-bot Feb 5, 2021
11c8f3f
s_packaging_calculator: include barcode
simahawk May 11, 2021
2e6fddc
s_packaging_calculator: ease override of packaging name
simahawk May 28, 2021
2d52fe8
s_packaging_calculator: add product_qty_by_packaging_as_str
simahawk May 28, 2021
dcfe9b9
s_packaging_calculator: add handy mixin
simahawk May 28, 2021
77c2b38
s_packaging_calculator: contained mapping depends on lang
simahawk Jun 3, 2021
ee59672
s_packaging_calculator: include units when units only on demand
simahawk Jun 11, 2021
a30d36e
s_packaging_calculator: improve test util
simahawk Jul 15, 2021
6bfe0ee
[UPD] Update stock_packaging_calculator.pot
oca-travis Jun 7, 2021
b83cb97
[IMP] stock_packaging_calculator: black, isort, prettier
Sep 14, 2021
725307e
[UPD] Update stock_packaging_calculator.pot
oca-travis Sep 21, 2021
57f81a2
stock_packaging_calculator 14.0.1.1.0
OCA-git-bot Sep 21, 2021
9ded9ef
[IMP] stock_packaging_calculator: black, isort, prettier
ChrisOForgeFlow Dec 13, 2021
9c005ae
[15.0][MIG] stock_packaging_calculator
ChrisOForgeFlow Dec 13, 2021
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
6 changes: 6 additions & 0 deletions setup/stock_packaging_calculator/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
127 changes: 127 additions & 0 deletions stock_packaging_calculator/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
==========================
Stock packaging calculator
==========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_packaging_calculator
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_packaging_calculator
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/14.0
:alt: Try me on Runbot

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

Basic module providing an helper method to calculate the quantity of product by packaging.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

Imagine you have the following packagings:

* Pallet: 1000 Units
* Big box: 500 Units
* Box: 50 Units

and you have to pick from your warehouse 2860 Units.

Then you can do:

.. code-block::

>>> product.product_qty_by_packaging(2860)

[
{"id": 1, "qty": 2, "name": "Pallet"},
{"id": 2, "qty": 1, "name": "Big box"},
{"id": 3, "qty": 7, "name": "Box"},
{"id": 100, "qty": 10, "name": "Units"},
]

With this you can show a proper message to warehouse operators to quickly pick the quantity they need.

Optionally you can get contained packaging by passing `with_contained` flag:


.. code-block::

>>> product.product_qty_by_packaging(2860, with_contained=True)

[
{"id": 1, "qty": 2, "name": "Pallet", "contained": [{"id": 2, "qty": 2, "name": "Big box"}]},
{"id": 2, "qty": 1, "name": "Big box", "contained": [{"id": 3, "qty": 10, "name": "Box"}]},
{"id": 3, "qty": 7, "name": "Box", "contained": [{"id": 100, "qty": 50, "name": "Units"}]},
{"id": 100, "qty": 10, "name": "Units", "contained": []},},
]

Known issues / Roadmap
======================

TODO

1. Fractional quantities (eg: 0.5 Kg) are lost when counting units
2. Maybe rely on `packaging_uom`

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_packaging_calculator%0Aversion:%2014.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
~~~~~~~~~~~~

* Simone Orsi <[email protected]>
* Christopher Ormaza <[email protected]>

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/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_packaging_calculator>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions stock_packaging_calculator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions stock_packaging_calculator/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 Camptocamp SA
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)
{
"name": "Stock packaging calculator",
"summary": "Compute product quantity to pick by packaging",
"version": "15.0.1.0.0",
"development_status": "Alpha",
"category": "Warehouse Management",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": ["product"],
}
57 changes: 57 additions & 0 deletions stock_packaging_calculator/i18n/stock_packaging_calculator.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_packaging_calculator
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: stock_packaging_calculator
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product__display_name
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_qty_by_packaging_mixin__display_name
msgid "Display Name"
msgstr ""

#. module: stock_packaging_calculator
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product__id
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_qty_by_packaging_mixin__id
msgid "ID"
msgstr ""

#. module: stock_packaging_calculator
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product____last_update
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_qty_by_packaging_mixin____last_update
msgid "Last Modified on"
msgstr ""

#. module: stock_packaging_calculator
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_product__packaging_contained_mapping
msgid "Packaging Contained Mapping"
msgstr ""

#. module: stock_packaging_calculator
#: model:ir.model,name:stock_packaging_calculator.model_product_product
msgid "Product"
msgstr ""

#. module: stock_packaging_calculator
#: model:ir.model,name:stock_packaging_calculator.model_product_qty_by_packaging_mixin
msgid "Product Qty By Packaging (Mixin)"
msgstr ""

#. module: stock_packaging_calculator
#: model:ir.model.fields,field_description:stock_packaging_calculator.field_product_qty_by_packaging_mixin__product_qty_by_packaging_display
msgid "Qty by packaging"
msgstr ""

#. module: stock_packaging_calculator
#: model:ir.model.fields,help:stock_packaging_calculator.field_product_product__packaging_contained_mapping
msgid "Technical field to store contained packaging. "
msgstr ""
2 changes: 2 additions & 0 deletions stock_packaging_calculator/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product
from . import product_qty_by_packaging_mixin
Loading