Skip to content

Commit

Permalink
Merge pull request #1399 from OCA/18.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/stock-logistics-workflow (18.0)
  • Loading branch information
bt-admin authored Feb 5, 2025
2 parents 6290e39 + efe6649 commit 1005523
Show file tree
Hide file tree
Showing 19 changed files with 853 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ addon | version | maintainers | summary
--- | --- | --- | ---
[sale_order_global_stock_route](sale_order_global_stock_route/) | 18.0.1.0.0 | | Add the possibility to choose one warehouse path for an order
[stock_account_product_run_fifo_hook](stock_account_product_run_fifo_hook/) | 18.0.1.0.1 | | Add more flexibility in the run fifo method.
[stock_dangerous_goods](stock_dangerous_goods/) | 18.0.1.0.0 | [![mmequignon](https://github.com/mmequignon.png?size=30px)](https://github.com/mmequignon) | Adds utility fields to manage dangerous goods
[stock_no_negative](stock_no_negative/) | 18.0.1.0.0 | | Disallow negative stock levels by default
[stock_owner_restriction](stock_owner_restriction/) | 18.0.1.0.0 | | Do not reserve quantity with assigned owner
[stock_picking_auto_create_lot](stock_picking_auto_create_lot/) | 18.0.1.0.0 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Auto create lots for incoming pickings
Expand Down
3 changes: 2 additions & 1 deletion setup/_metapackage/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[project]
name = "odoo-addons-oca-stock-logistics-workflow"
version = "18.0.20250131.1"
version = "18.0.20250204.0"
dependencies = [
"odoo-addon-sale_order_global_stock_route==18.0.*",
"odoo-addon-stock_account_product_run_fifo_hook==18.0.*",
"odoo-addon-stock_dangerous_goods==18.0.*",
"odoo-addon-stock_no_negative==18.0.*",
"odoo-addon-stock_owner_restriction==18.0.*",
"odoo-addon-stock_picking_auto_create_lot==18.0.*",
Expand Down
92 changes: 92 additions & 0 deletions stock_dangerous_goods/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
=====================
Stock Dangerous Goods
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d9eb3b01b33f5e6d4ecacb127a8c964ce26a12f8645cb538474bbfe26729d8e3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_dangerous_goods
:alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_dangerous_goods
: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/stock-logistics-workflow&target_branch=18.0
:alt: Try me on Runboat

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

This is a glue module between stock and l10n_eu_product_adr. This
modules adds a few utility fields about dangerous products.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/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/stock-logistics-workflow/issues/new?body=module:%20stock_dangerous_goods%0Aversion:%2018.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 SA

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

- Matthieu Méquignon <[email protected]>
- Do Anh Duy <[email protected]>

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

The migration of this module from 14.0 to 18.0 was 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.

.. |maintainer-mmequignon| image:: https://github.com/mmequignon.png?size=40px
:target: https://github.com/mmequignon
:alt: mmequignon

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-mmequignon|

This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_dangerous_goods>`_ 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_dangerous_goods/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions stock_dangerous_goods/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "Stock Dangerous Goods",
"summary": "Adds utility fields to manage dangerous goods",
"version": "18.0.1.0.0",
"category": "Inventory",
"website": "https://github.com/OCA/stock-logistics-workflow",
"author": "Camptocamp SA, Odoo Community Association (OCA)",
"maintainers": ["mmequignon"],
"license": "AGPL-3",
"installable": True,
"depends": [
"stock",
# OCA/community-data-files
"l10n_eu_product_adr_dangerous_goods",
],
}
47 changes: 47 additions & 0 deletions stock_dangerous_goods/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_dangerous_goods
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"

#. module: stock_dangerous_goods
#: model:ir.model.fields,field_description:stock_dangerous_goods.field_stock_quant_package__has_lq_products
msgid "Has Lq Products"
msgstr ""

#. module: stock_dangerous_goods
#: model:ir.model.fields,field_description:stock_dangerous_goods.field_product_product__is_lq_product
#: model:ir.model.fields,field_description:stock_dangerous_goods.field_stock_move_line__has_lq_products
msgid "Is Lq Product"
msgstr ""

#. module: stock_dangerous_goods
#: model:ir.model,name:stock_dangerous_goods.model_stock_quant_package
msgid "Packages"
msgstr ""

#. module: stock_dangerous_goods
#: model:ir.model,name:stock_dangerous_goods.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
msgstr ""

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

#. module: stock_dangerous_goods
#: model:ir.model.fields,help:stock_dangerous_goods.field_product_product__is_lq_product
#: model:ir.model.fields,help:stock_dangerous_goods.field_stock_move_line__has_lq_products
msgid "Whether this product is a Limited Quantity product or not"
msgstr ""
46 changes: 46 additions & 0 deletions stock_dangerous_goods/i18n/stock_dangerous_goods.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_dangerous_goods
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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_dangerous_goods
#: model:ir.model.fields,field_description:stock_dangerous_goods.field_stock_quant_package__has_lq_products
msgid "Has Lq Products"
msgstr ""

#. module: stock_dangerous_goods
#: model:ir.model.fields,field_description:stock_dangerous_goods.field_product_product__is_lq_product
#: model:ir.model.fields,field_description:stock_dangerous_goods.field_stock_move_line__has_lq_products
msgid "Is Lq Product"
msgstr ""

#. module: stock_dangerous_goods
#: model:ir.model,name:stock_dangerous_goods.model_stock_quant_package
msgid "Packages"
msgstr ""

#. module: stock_dangerous_goods
#: model:ir.model,name:stock_dangerous_goods.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
msgstr ""

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

#. module: stock_dangerous_goods
#: model:ir.model.fields,help:stock_dangerous_goods.field_product_product__is_lq_product
#: model:ir.model.fields,help:stock_dangerous_goods.field_stock_move_line__has_lq_products
msgid "Whether this product is a Limited Quantity product or not"
msgstr ""
3 changes: 3 additions & 0 deletions stock_dangerous_goods/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import stock_move_line
from . import stock_quant_package
from . import product_product
23 changes: 23 additions & 0 deletions stock_dangerous_goods/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import api, fields, models


class ProductProduct(models.Model):
_inherit = "product.product"

is_lq_product = fields.Boolean(
compute="_compute_is_lq_product",
help="Whether this product is a Limited Quantity product or not",
)

@api.depends("limited_amount_id", "is_dangerous")
def _compute_is_lq_product(self):
limited_amount_lq = self.env.ref(
"l10n_eu_product_adr_dangerous_goods.limited_amount_1"
)
for record in self:
record.is_lq_product = (
record.is_dangerous and record.limited_amount_id == limited_amount_lq
)
10 changes: 10 additions & 0 deletions stock_dangerous_goods/models/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import fields, models


class StockMoveLine(models.Model):
_inherit = "stock.move.line"

has_lq_products = fields.Boolean(related="product_id.is_lq_product")
22 changes: 22 additions & 0 deletions stock_dangerous_goods/models/stock_quant_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import api, fields, models


class StockQuantPackage(models.Model):
_inherit = "stock.quant.package"

has_lq_products = fields.Boolean(compute="_compute_has_lq_products")

@api.depends("quant_ids.product_id.is_lq_product")
def _compute_has_lq_products(self):
for record in self:
record.has_lq_products = record._has_lq_products()

def _has_lq_products(self):
self.ensure_one()
for quant in self.quant_ids:
if quant.product_id.is_lq_product:
return True
return False
3 changes: 3 additions & 0 deletions stock_dangerous_goods/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions stock_dangerous_goods/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Matthieu Méquignon \<<[email protected]>\>
- Do Anh Duy \<<[email protected]>\>
1 change: 1 addition & 0 deletions stock_dangerous_goods/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The migration of this module from 14.0 to 18.0 was financially supported by Camptocamp.
2 changes: 2 additions & 0 deletions stock_dangerous_goods/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a glue module between stock and l10n_eu_product_adr. This
modules adds a few utility fields about dangerous products.
Binary file added stock_dangerous_goods/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1005523

Please sign in to comment.