forked from OCA/stock-logistics-workflow
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1399 from OCA/18.0
Syncing from upstream OCA/stock-logistics-workflow (18.0)
- Loading branch information
Showing
19 changed files
with
853 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Matthieu Méquignon \<<[email protected]>\> | ||
- Do Anh Duy \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.