diff --git a/l10n_ch_adr_report/README.rst b/l10n_ch_adr_report/README.rst new file mode 100644 index 000000000..ede54bbec --- /dev/null +++ b/l10n_ch_adr_report/README.rst @@ -0,0 +1,97 @@ +========================= +ADR Products Swiss Report +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f413c71599be495d2419b6a665ebe1ae5f63de78610b15d222574d6908ba5c5a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fl10n--switzerland-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-switzerland/tree/18.0/l10n_ch_adr_report + :alt: OCA/l10n-switzerland +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-switzerland-18-0/l10n-switzerland-18-0-l10n_ch_adr_report + :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/l10n-switzerland&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Report for delivery of dangerous goods. We assume that product can be +defined on product and it will be the only dangerous good/(waste) on +product + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp + +Contributors +------------ + +- `Camptocamp `__: + + - Iryna Vyshnevska + - Carlos Serra-Toro + - Iryna Vyshnevska + - Matthieu Méquignon + - Sébastien Alix + - Thierry Ducrest + +- `Trobz `__: + + - Son Ho + - Do Anh Duy + +Other credits +------------- + +The development of this module was financially supported by Camptocamp +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. + +This module is part of the `OCA/l10n-switzerland `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ch_adr_report/__init__.py b/l10n_ch_adr_report/__init__.py new file mode 100644 index 000000000..afe94a82d --- /dev/null +++ b/l10n_ch_adr_report/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +from . import report +from . import models diff --git a/l10n_ch_adr_report/__manifest__.py b/l10n_ch_adr_report/__manifest__.py new file mode 100644 index 000000000..921a247ed --- /dev/null +++ b/l10n_ch_adr_report/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +{ + "name": "ADR Products Swiss Report", + "summary": "Print Delivery report to ADR swiss configuration", + "version": "18.0.1.0.0", + "category": "Product", + "website": "https://github.com/OCA/l10n-switzerland", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": ["l10n_eu_product_adr_dangerous_goods", "stock", "delivery"], + "data": [ + "report/DG_ch_delivery_report.xml", + ], + "assets": { + "web.report_assets_common": [ + "/l10n_ch_adr_report/static/src/scss/adr_report.scss", + ], + }, +} diff --git a/l10n_ch_adr_report/i18n/de.po b/l10n_ch_adr_report/i18n/de.po new file mode 100644 index 000000000..cde103344 --- /dev/null +++ b/l10n_ch_adr_report/i18n/de.po @@ -0,0 +1,176 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_adr_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-08-06 10:55+0000\n" +"PO-Revision-Date: 2020-08-06 10:55+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Address" +msgstr "Adresse" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Article (order according to 5.4.1.1.1 ADR)" +msgstr "Artikel (Reihenfolge gem. 5.4.1.1.1 ADR)" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Calculation 1000 points rule, ADR 1.1.3.6.3" +msgstr "Kalkulation 1000 Punkte Regel, ADR 1.1.3.6.3" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Company name" +msgstr "Unternehmensname" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Contact person" +msgstr "Konatktperson" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Container / packaging" +msgstr "Gebinde / Verpackung" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Content / Pack." +msgstr "Inhalt Verpackung" + +#. module: l10n_ch_adr_report +#: model:ir.model,name:l10n_ch_adr_report.model_report_l10n_ch_adr_report_report_dg_l10n_ch +msgid "Dangerous Delivery Report ADR" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Date" +msgstr "Datum" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Delivery note no." +msgstr "Lieferschein Nr." + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product__display_name +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_ch_adr_report +#: code:addons/l10n_ch_adr_report/models/product_product.py:0 +#, python-format +msgid "Environmentally hazardous" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Factor" +msgstr "Multiplikationsfaktor " + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product__id +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch__id +msgid "ID" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product____last_update +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product__adr_report_class_display_name +msgid "Name, as required for the DG report" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Number" +msgstr "Anzahl" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Points per transportation category" +msgstr "Massenpunkte (MP) pro Beförderungskategorie" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Postcode / town" +msgstr "PLZ / Ort" + +#. module: l10n_ch_adr_report +#: model:ir.model,name:l10n_ch_adr_report.model_product_product +msgid "Product" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +msgid "Received listed goods in good physical condition" +msgstr "Aufgelistete Güter in äusserlich einwandfreiem Zustand erhalten." + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Recipient address" +msgstr "Empfangsadresse" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Sender address" +msgstr "Absederadresse" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +msgid "Signature:" +msgstr "Unterschrift:" + +#. module: l10n_ch_adr_report +#: model:ir.actions.report,name:l10n_ch_adr_report.action_report_dg_l10n_ch +msgid "Swiss Dangerous Goods Report" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Total Points" +msgstr "Total Punkte:" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Total of transported units" +msgstr "Summe der beförderten Mengen " + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Transport category (BK)" +msgstr "Beförderungskategorie (BK)" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Transportation paper" +msgstr "ADR Transportpapier" + +#. module: l10n_ch_adr_report +#: code:addons/l10n_ch_adr_report/models/product_product.py:0 +#, python-format +msgid "UN" +msgstr "" + +#~ msgid "Dangerous Good" +#~ msgstr "Gefahrgut" diff --git a/l10n_ch_adr_report/i18n/fr.pot b/l10n_ch_adr_report/i18n/fr.pot new file mode 100644 index 000000000..a81f5c6b2 --- /dev/null +++ b/l10n_ch_adr_report/i18n/fr.pot @@ -0,0 +1,178 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_adr_report +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-03-23 11:10+0000\n" +"PO-Revision-Date: 2021-03-23 11:10+0000\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: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Address" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Article (order according to 5.4.1.1.1 ADR)" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Calculation 1000 points rule, ADR 1.1.3.6.3" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Company name" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Contact person" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Container / packaging" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Content / Pack." +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields.selection,name:l10n_ch_adr_report.selection__product_template__dangerous_good__dg +msgid "DG" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model,name:l10n_ch_adr_report.model_report_l10n_ch_adr_report_report_dg_l10n_ch +msgid "Dangerous Delivery Report ADR" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product__dangerous_good +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_template__dangerous_good +msgid "Dangerous Good" +msgstr "Produit dangereux" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.product_variant_easy_edit_view +msgid "Dangerous attributes" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Date" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Delivery note no." +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Factor" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch__id +msgid "ID" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields.selection,name:l10n_ch_adr_report.selection__product_template__dangerous_good__lq +msgid "LQ" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Number" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Points per transportation category" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Postcode / town" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model,name:l10n_ch_adr_report.model_product_product +msgid "Product" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model,name:l10n_ch_adr_report.model_product_template +msgid "Product Template" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +msgid "Received listed goods in good physical condition" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Recipient address" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Sender address" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +msgid "Signature:" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.actions.report,name:l10n_ch_adr_report.action_report_dg_l10n_ch +msgid "Swiss Dangerous Goods Report" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Total Points" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Total of transported units" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Transport category (BK)" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Transportation paper" +msgstr "" diff --git a/l10n_ch_adr_report/i18n/l10n_ch_adr_report.pot b/l10n_ch_adr_report/i18n/l10n_ch_adr_report.pot new file mode 100644 index 000000000..92332a3e8 --- /dev/null +++ b/l10n_ch_adr_report/i18n/l10n_ch_adr_report.pot @@ -0,0 +1,170 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ch_adr_report +# +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: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Address" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Article (order according to 5.4.1.1.1 ADR)" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Calculation 1000 points rule, ADR 1.1.3.6.3" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Company name" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Contact person" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Container / packaging" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Content / Pack." +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model,name:l10n_ch_adr_report.model_report_l10n_ch_adr_report_report_dg_l10n_ch +msgid "Dangerous Delivery Report ADR" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Date" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Delivery note no." +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product__display_name +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_ch_adr_report +#: code:addons/l10n_ch_adr_report/models/product_product.py:0 +#, python-format +msgid "Environmentally hazardous" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Factor" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product__id +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch__id +msgid "ID" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product____last_update +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_report_l10n_ch_adr_report_report_dg_l10n_ch____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model.fields,field_description:l10n_ch_adr_report.field_product_product__adr_report_class_display_name +msgid "Name, as required for the DG report" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Number" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Points per transportation category" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Postcode / town" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.model,name:l10n_ch_adr_report.model_product_product +msgid "Product" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +msgid "Received listed goods in good physical condition" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Recipient address" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Sender address" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_footer +msgid "Signature:" +msgstr "" + +#. module: l10n_ch_adr_report +#: model:ir.actions.report,name:l10n_ch_adr_report.action_report_dg_l10n_ch +msgid "Swiss Dangerous Goods Report" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Total Points" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Total of transported units" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_product_block +msgid "Transport category (BK)" +msgstr "" + +#. module: l10n_ch_adr_report +#: model_terms:ir.ui.view,arch_db:l10n_ch_adr_report.report_dg_swiss_partner_block +msgid "Transportation paper" +msgstr "" + +#. module: l10n_ch_adr_report +#: code:addons/l10n_ch_adr_report/models/product_product.py:0 +#, python-format +msgid "UN" +msgstr "" diff --git a/l10n_ch_adr_report/models/__init__.py b/l10n_ch_adr_report/models/__init__.py new file mode 100644 index 000000000..5c74c8c30 --- /dev/null +++ b/l10n_ch_adr_report/models/__init__.py @@ -0,0 +1 @@ +from . import product_product diff --git a/l10n_ch_adr_report/models/product_product.py b/l10n_ch_adr_report/models/product_product.py new file mode 100644 index 000000000..b0bf7d8f4 --- /dev/null +++ b/l10n_ch_adr_report/models/product_product.py @@ -0,0 +1,53 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import fields, models + + +class ProductProduct(models.Model): + _inherit = "product.product" + + adr_report_class_display_name = fields.Char( + "Name, as required for the DG report", + compute="_compute_adr_report_class_display_name", + ) + + def _compute_adr_report_class_display_name(self): + _ = self.env._ + for record in self: + adr_good = record.adr_goods_id + res = _(f"UN {adr_good.un_number}, {adr_good.name}") + if record.nag: + res += _(" {}").format(record.nag) + + if record.label_first: + res += ", {}".format(record._get_name_from_selection("label_first")) + + if record.label_second and record.label_third: + res += ", ({}, {})".format( + record._get_name_from_selection("label_second"), + record._get_name_from_selection("label_third"), + ) + elif record.label_second: + res += ", ({})".format(record._get_name_from_selection("label_second")) + + if record.packaging_group: + res += ", {}".format(record._get_name_from_selection("packaging_group")) + + if adr_good.tunnel_restriction_code: + res += ", ({})".format( + record._get_name_from_selection("adr_tunnel_restriction_code") + ) + + if record.envir_hazardous == "yes": + res += ", {}".format(_("Environmentally hazardous")) + + record.adr_report_class_display_name = res + + def _get_name_from_selection(self, field_name): + selection = self._fields[field_name].selection + if isinstance(selection, list): + temp_dict = dict(selection) + else: + temp_dict = dict(selection(self)) + return temp_dict.get(getattr(self, field_name)) diff --git a/l10n_ch_adr_report/pyproject.toml b/l10n_ch_adr_report/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/l10n_ch_adr_report/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/l10n_ch_adr_report/readme/AUTHORS.rst b/l10n_ch_adr_report/readme/AUTHORS.rst new file mode 100644 index 000000000..68cc39492 --- /dev/null +++ b/l10n_ch_adr_report/readme/AUTHORS.rst @@ -0,0 +1 @@ +* Iryna Vyshnevska diff --git a/l10n_ch_adr_report/readme/CONTRIBUTORS.md b/l10n_ch_adr_report/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..146fa6ad1 --- /dev/null +++ b/l10n_ch_adr_report/readme/CONTRIBUTORS.md @@ -0,0 +1,11 @@ +- [Camptocamp](https://www.camptocamp.com): + - Iryna Vyshnevska \<\> + - Carlos Serra-Toro \<\> + - Iryna Vyshnevska \<\> + - Matthieu Méquignon \<\> + - Sébastien Alix \<\> + - Thierry Ducrest \<\> + +- [Trobz](https://trobz.com): + - Son Ho \<\> + - Do Anh Duy \<\> diff --git a/l10n_ch_adr_report/readme/CREDITS.md b/l10n_ch_adr_report/readme/CREDITS.md new file mode 100644 index 000000000..b3b2c61ac --- /dev/null +++ b/l10n_ch_adr_report/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module was financially supported by Camptocamp +The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp diff --git a/l10n_ch_adr_report/readme/DESCRIPTION.md b/l10n_ch_adr_report/readme/DESCRIPTION.md new file mode 100644 index 000000000..20a038655 --- /dev/null +++ b/l10n_ch_adr_report/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +Report for delivery of dangerous goods. We assume that product can be +defined on product and it will be the only dangerous good/(waste) on +product diff --git a/l10n_ch_adr_report/report/DG_ch_delivery_report.xml b/l10n_ch_adr_report/report/DG_ch_delivery_report.xml new file mode 100644 index 000000000..b801bbdd0 --- /dev/null +++ b/l10n_ch_adr_report/report/DG_ch_delivery_report.xml @@ -0,0 +1,292 @@ + + + + Swiss Dangerous Goods Report + stock.picking + qweb-pdf + l10n_ch_adr_report.report_dg_l10n_ch + l10n_ch_adr_report.report_dg_l10n_ch + + + + + + + + + + + + diff --git a/l10n_ch_adr_report/report/__init__.py b/l10n_ch_adr_report/report/__init__.py new file mode 100644 index 000000000..442f56de8 --- /dev/null +++ b/l10n_ch_adr_report/report/__init__.py @@ -0,0 +1 @@ +from . import dangerous_delivery_report diff --git a/l10n_ch_adr_report/report/dangerous_delivery_report.py b/l10n_ch_adr_report/report/dangerous_delivery_report.py new file mode 100644 index 000000000..0c14f0376 --- /dev/null +++ b/l10n_ch_adr_report/report/dangerous_delivery_report.py @@ -0,0 +1,138 @@ +# Copyright 2019 Iryna Vyshnevska (Camptocamp) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) +from itertools import groupby + +from odoo import models + + +class DangerousDeliverCHADR(models.AbstractModel): + _name = "report.l10n_ch_adr_report.report_dg_l10n_ch" + _description = "Dangerous Delivery Report ADR" + + def _get_report_values(self, docids, data=None): + data = data or {} + docs = self.env["stock.picking"].browse(docids) + dg_data = self.prepare_DG_data(docs) + docargs = { + "doc_ids": docs.ids, + "doc_model": "stock.picking", + "docs": docs, + "data": data.get("form", False), + "DG_data": dg_data, + } + return docargs + + def prepare_DG_data(self, picking_ids): + """ + Result is lines for dangerous products + :return: dict + {'dg_lines':[{ + 'product': product.product(40,), + 'class': 'UN UN Number, ... + 'packaging_type': adr_packing_instruction_ids(6,), + 'qty_amount': 100.0, + 'product_weight': 10.0, + 'column_index': '3', + 'dangerous_amount': 1000.0 + }], + 'total_section':{ + 'total_units': {'0': 0, '1': 0, '2': 1000.0, '3': 0, '4': 0}, + 'factor': {'0': 0.0, '1': 50.0, '2': 3.0, '3': 1.0, '4': 0.0}, + 'mass_points': {'0': 0.0, '1': 0.0, '2': 3000.0, '3': 0.0, '4': 0.0}, + 'total_points': 3000.0, + 'warn': True + } + } + """ + + vals = { + "dg_lines": [], + "total_section": {}, + } + for pick in picking_ids: + if pick.state == "done": + moves = pick.move_ids.filtered(lambda m: m.state == "done") + else: + moves = pick.move_ids + dangerous_moves = self._filter_dangerous_move(moves) + grouped_moves = groupby( + sorted(dangerous_moves, key=lambda m: m.product_id), + lambda r: r.product_id, + ) + vals["dg_lines"] += self._get_DG_move_line_vals(grouped_moves) + + vals["total_section"] = self._compute_points_per_product(vals["dg_lines"]) + vals["total_section"]["total_points"] = self._compute_total_points( + vals["total_section"] + ) + vals["total_section"]["warn"] = self._is_limit_exceeded(vals["total_section"]) + return vals + + def _filter_dangerous_move(self, moves): + """Filter the moves to use for the report.""" + return moves.filtered(lambda move: move.product_id.is_dangerous) + + def _compute_points_per_product(self, vals): + index = {}.fromkeys(["0", "1", "2", "3", "4"], 0.0) + total_vals = { + "total_units": index.copy(), + "factor": index.copy(), + "mass_points": index.copy(), + "total_points": 0.0, + } + self._init_total_vals(total_vals) + + for k in index.keys(): + total_vals["total_units"][k] = self._sum_values(vals, "dangerous_amount", k) + total_vals["mass_points"][k] = self._apply_rounding( + total_vals["total_units"][k] * total_vals["factor"][k] + ) + return total_vals + + def _sum_values(self, vals, field, index): + return sum([item[field] for item in vals if item["column_index"] == index]) + + def _compute_total_points(self, vals): + return self._apply_rounding(sum(vals["mass_points"].values())) + + def _apply_rounding(self, amount): + # should follow precision on product + return round(amount, 1) + + def _is_limit_exceeded(self, vals): + return vals["total_points"] > 1000.0 + + def _init_total_vals(self, vals): + vals["factor"]["0"] = 0.0 + vals["factor"]["1"] = 50.0 + vals["factor"]["2"] = 3.0 + vals["factor"]["3"] = 1.0 + vals["factor"]["4"] = 0.0 + + def _get_DG_move_line_vals(self, moves): + # unit measurement on stock is not considered + result = [] + for product, move_lines in moves: + qty = 0 + for rec in move_lines: + if rec.state == "done": + qty += rec.quantity + else: + qty += rec.product_uom_qty + full_class_name = product.adr_report_class_display_name + ( + f", {qty}, {product.packaging_type_id.name}," + f" {qty * product.content_package}, {product.dg_unit.name}" + ) + result.append( + { + "product": product, + "class": full_class_name, + "packaging_type": product.packaging_type_id, + "qty_amount": qty, + "product_weight": product.content_package, + "column_index": str(product.adr_transport_category), + "dangerous_amount": qty * product.content_package, + } + ) + + return result diff --git a/l10n_ch_adr_report/static/description/icon.png b/l10n_ch_adr_report/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/l10n_ch_adr_report/static/description/icon.png differ diff --git a/l10n_ch_adr_report/static/description/index.html b/l10n_ch_adr_report/static/description/index.html new file mode 100644 index 000000000..8b3634e73 --- /dev/null +++ b/l10n_ch_adr_report/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +ADR Products Swiss Report + + + +
+

ADR Products Swiss Report

+ + +

Beta License: AGPL-3 OCA/l10n-switzerland Translate me on Weblate Try me on Runboat

+

Report for delivery of dangerous goods. We assume that product can be +defined on product and it will be the only dangerous good/(waste) on +product

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module was financially supported by Camptocamp +The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp

+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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/l10n-switzerland project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/l10n_ch_adr_report/static/src/scss/adr_report.scss b/l10n_ch_adr_report/static/src/scss/adr_report.scss new file mode 100644 index 000000000..50d6bdc40 --- /dev/null +++ b/l10n_ch_adr_report/static/src/scss/adr_report.scss @@ -0,0 +1,30 @@ +.dg-report { + .dg_header { + table-layout: fixed; + } + table, + th, + td { + border: 1px solid grey !important; + padding: 0.25rem; + min-width: 50px; + } + table { + margin-bottom: 0; + } + .table-clean { + border: none !important; + td { + border-collapse: collapse; + border: none !important; + } + } + .dg-green { + text-align: center; + background-color: #32e038; + color: white; + } + .dg-red { + background-color: #ff0000; + } +} diff --git a/l10n_ch_adr_report/tests/__init__.py b/l10n_ch_adr_report/tests/__init__.py new file mode 100644 index 000000000..99a3f5a52 --- /dev/null +++ b/l10n_ch_adr_report/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_product diff --git a/l10n_ch_adr_report/tests/test_product_product.py b/l10n_ch_adr_report/tests/test_product_product.py new file mode 100644 index 000000000..f7c7b266f --- /dev/null +++ b/l10n_ch_adr_report/tests/test_product_product.py @@ -0,0 +1,52 @@ +# Copyright 2024 Camptocamp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests import TransactionCase + + +class TestProductProduct(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product_category = cls.env["product.category"].create( + { + "name": "Test Category", + } + ) + cls.adr_goods = cls.env.ref( + "l10n_eu_product_adr.adr_goods_0004_1dot1D_1_P112a/P112b/P112c_1" + ) + cls.product = cls.env["product.product"].create( + { + "name": "Test Product", + "type": "consu", + "list_price": 20.0, + "nag": "N.A.G 1", + "label_first": "1", + "label_second": "2", + "label_third": "3", + "packaging_group": "3", + "envir_hazardous": "yes", + "categ_id": cls.product_category.id, + "adr_goods_id": cls.adr_goods.id, + } + ) + + def test_get_name_from_selection(self): + label_first = self.product._get_name_from_selection("label_first") + self.assertEqual(label_first, "2") + label_second = self.product._get_name_from_selection("label_second") + self.assertEqual(label_second, "2.1") + packaging_group = self.product._get_name_from_selection("packaging_group") + self.assertEqual(packaging_group, "II") + + def test_compute_adr_report_class_display_name(self): + self.product._compute_adr_report_class_display_name() + self.assertTrue(self.product.adr_goods_id) + adr_report_class_display_name = self.product.adr_report_class_display_name + first_item = adr_report_class_display_name.split()[0] + self.assertEqual(first_item, "UN") + items_name = adr_report_class_display_name.split(", ") + self.assertEqual(f"{first_item} {self.adr_goods.un_number}", items_name[0]) + self.assertIn("II", items_name) + self.assertIn("Environmentally hazardous", items_name) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..3acbaee74 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,2 @@ +odoo-addon-l10n_eu_product_adr @ git+https://github.com/oca/community-data-files.git@refs/pull/208/head#subdirectory=l10n_eu_product_adr +odoo-addon-l10n_eu_product_adr_dangerous_goods @ git+https://github.com/oca/community-data-files.git@refs/pull/211/head#subdirectory=l10n_eu_product_adr_dangerous_goods