From ded08e23fde519d210bd9cdd7c5f237c7a77c5e4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 27 Sep 2024 16:42:07 +0200 Subject: [PATCH] [ADD] stock_barcodes_gs1_expiry_simple Add new glue module between stock_barcodes_gs1 and product_expiry_simple --- .../addons/stock_barcodes_gs1_expiry_simple | 1 + .../stock_barcodes_gs1_expiry_simple/setup.py | 6 + stock_barcodes_gs1_expiry_simple/README.rst | 86 ++++ stock_barcodes_gs1_expiry_simple/__init__.py | 1 + .../__manifest__.py | 21 + stock_barcodes_gs1_expiry_simple/i18n/fr.po | 28 ++ .../i18n/stock_barcodes_gs1_expiry_simple.pot | 28 ++ .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 3 + .../static/description/index.html | 426 ++++++++++++++++++ .../wizards/__init__.py | 1 + .../wizards/stock_barcodes_read.py | 26 ++ .../wizards/stock_barcodes_read_view.xml | 34 ++ 13 files changed, 662 insertions(+) create mode 120000 setup/stock_barcodes_gs1_expiry_simple/odoo/addons/stock_barcodes_gs1_expiry_simple create mode 100644 setup/stock_barcodes_gs1_expiry_simple/setup.py create mode 100644 stock_barcodes_gs1_expiry_simple/README.rst create mode 100644 stock_barcodes_gs1_expiry_simple/__init__.py create mode 100644 stock_barcodes_gs1_expiry_simple/__manifest__.py create mode 100644 stock_barcodes_gs1_expiry_simple/i18n/fr.po create mode 100644 stock_barcodes_gs1_expiry_simple/i18n/stock_barcodes_gs1_expiry_simple.pot create mode 100644 stock_barcodes_gs1_expiry_simple/readme/CONTRIBUTORS.rst create mode 100644 stock_barcodes_gs1_expiry_simple/readme/DESCRIPTION.rst create mode 100644 stock_barcodes_gs1_expiry_simple/static/description/index.html create mode 100644 stock_barcodes_gs1_expiry_simple/wizards/__init__.py create mode 100644 stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read.py create mode 100644 stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read_view.xml diff --git a/setup/stock_barcodes_gs1_expiry_simple/odoo/addons/stock_barcodes_gs1_expiry_simple b/setup/stock_barcodes_gs1_expiry_simple/odoo/addons/stock_barcodes_gs1_expiry_simple new file mode 120000 index 000000000000..7d54ddcd28bb --- /dev/null +++ b/setup/stock_barcodes_gs1_expiry_simple/odoo/addons/stock_barcodes_gs1_expiry_simple @@ -0,0 +1 @@ +../../../../stock_barcodes_gs1_expiry_simple \ No newline at end of file diff --git a/setup/stock_barcodes_gs1_expiry_simple/setup.py b/setup/stock_barcodes_gs1_expiry_simple/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/stock_barcodes_gs1_expiry_simple/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_barcodes_gs1_expiry_simple/README.rst b/stock_barcodes_gs1_expiry_simple/README.rst new file mode 100644 index 000000000000..66bdcebf4f30 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/README.rst @@ -0,0 +1,86 @@ +================================ +Stock Barcodes GS1 Expiry Simple +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:5c171195d23d6343af3d2e558b5eee0907b5b7e74172ff0336759f956ea533e3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png + :target: https://odoo-community.org/page/development-status + :alt: Mature +.. |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--barcode-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-barcode/tree/16.0/stock_barcodes_gs1_expiry_simple + :alt: OCA/stock-logistics-barcode +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-barcode-16-0/stock-logistics-barcode-16-0-stock_barcodes_gs1_expiry_simple + :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-barcode&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is a glue module between the module **stock_barcodes** from `github.com/OCA/stock-logistics-barcode `_ and the module **product_expiry_simple** from `github.com/OCA/stock-logistics-workflow `_. + +The OCA module **product_expiry_simple** is an equivalent of the official module **product_expiry** that add a single date field on lots for the expiry date (instead of adding 4 datetime fields). + +**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 +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* Alexis de Lattre + +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-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via + +Current `maintainer `__: + +|maintainer-alexis-via| + +This module is part of the `OCA/stock-logistics-barcode `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_barcodes_gs1_expiry_simple/__init__.py b/stock_barcodes_gs1_expiry_simple/__init__.py new file mode 100644 index 000000000000..5cb1c49143f5 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/__init__.py @@ -0,0 +1 @@ +from . import wizards diff --git a/stock_barcodes_gs1_expiry_simple/__manifest__.py b/stock_barcodes_gs1_expiry_simple/__manifest__.py new file mode 100644 index 000000000000..55a6baef4c79 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2024 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Stock Barcodes GS1 Expiry Simple", + "version": "16.0.1.0.0", + "category": "Warehouse", + "license": "AGPL-3", + "summary": "Glue module between stock_barcodes_gs1 and product_expiry_simple", + "author": "Akretion,Odoo Community Association (OCA)", + "maintainers": ["alexis-via"], + "development_status": "Mature", + "website": "https://github.com/OCA/stock-logistics-barcode", + "depends": ["stock_barcodes_gs1", "product_expiry_simple"], + "data": [ + "wizards/stock_barcodes_read_view.xml", + ], + "installable": True, + "auto_install": True, +} diff --git a/stock_barcodes_gs1_expiry_simple/i18n/fr.po b/stock_barcodes_gs1_expiry_simple/i18n/fr.po new file mode 100644 index 000000000000..310aaa835f42 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/i18n/fr.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_barcodes_gs1_expiry_simple +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-27 14:39+0000\n" +"PO-Revision-Date: 2024-09-27 14:39+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: stock_barcodes_gs1_expiry_simple +#: model:ir.model.fields,field_description:stock_barcodes_gs1_expiry_simple.field_wiz_stock_barcodes_read__expiry_date +#: model:ir.model.fields,field_description:stock_barcodes_gs1_expiry_simple.field_wiz_stock_barcodes_read_inventory__expiry_date +#: model:ir.model.fields,field_description:stock_barcodes_gs1_expiry_simple.field_wiz_stock_barcodes_read_picking__expiry_date +msgid "Expiry Date" +msgstr "Date de péremption" + +#. module: stock_barcodes_gs1_expiry_simple +#: model:ir.model,name:stock_barcodes_gs1_expiry_simple.model_wiz_stock_barcodes_read +msgid "Wizard to read barcode" +msgstr "Assistant de lecture de code-barre" diff --git a/stock_barcodes_gs1_expiry_simple/i18n/stock_barcodes_gs1_expiry_simple.pot b/stock_barcodes_gs1_expiry_simple/i18n/stock_barcodes_gs1_expiry_simple.pot new file mode 100644 index 000000000000..31b4d6ed6443 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/i18n/stock_barcodes_gs1_expiry_simple.pot @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_barcodes_gs1_expiry_simple +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-27 14:39+0000\n" +"PO-Revision-Date: 2024-09-27 14:39+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: stock_barcodes_gs1_expiry_simple +#: model:ir.model.fields,field_description:stock_barcodes_gs1_expiry_simple.field_wiz_stock_barcodes_read__expiry_date +#: model:ir.model.fields,field_description:stock_barcodes_gs1_expiry_simple.field_wiz_stock_barcodes_read_inventory__expiry_date +#: model:ir.model.fields,field_description:stock_barcodes_gs1_expiry_simple.field_wiz_stock_barcodes_read_picking__expiry_date +msgid "Expiry Date" +msgstr "" + +#. module: stock_barcodes_gs1_expiry_simple +#: model:ir.model,name:stock_barcodes_gs1_expiry_simple.model_wiz_stock_barcodes_read +msgid "Wizard to read barcode" +msgstr "" diff --git a/stock_barcodes_gs1_expiry_simple/readme/CONTRIBUTORS.rst b/stock_barcodes_gs1_expiry_simple/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..ff65d68ce6d7 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Alexis de Lattre diff --git a/stock_barcodes_gs1_expiry_simple/readme/DESCRIPTION.rst b/stock_barcodes_gs1_expiry_simple/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..b60350b705a2 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module is a glue module between the module **stock_barcodes** from `github.com/OCA/stock-logistics-barcode `_ and the module **product_expiry_simple** from `github.com/OCA/stock-logistics-workflow `_. + +The OCA module **product_expiry_simple** is an equivalent of the official module **product_expiry** that add a single date field on lots for the expiry date (instead of adding 4 datetime fields). diff --git a/stock_barcodes_gs1_expiry_simple/static/description/index.html b/stock_barcodes_gs1_expiry_simple/static/description/index.html new file mode 100644 index 000000000000..81138a5b13a6 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/static/description/index.html @@ -0,0 +1,426 @@ + + + + + +Stock Barcodes GS1 Expiry Simple + + + +
+

Stock Barcodes GS1 Expiry Simple

+ + +

Mature License: AGPL-3 OCA/stock-logistics-barcode Translate me on Weblate Try me on Runboat

+

This module is a glue module between the module stock_barcodes from github.com/OCA/stock-logistics-barcode and the module product_expiry_simple from github.com/OCA/stock-logistics-workflow.

+

The OCA module product_expiry_simple is an equivalent of the official module product_expiry that add a single date field on lots for the expiry date (instead of adding 4 datetime fields).

+

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

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

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.

+

Current maintainer:

+

alexis-via

+

This module is part of the OCA/stock-logistics-barcode project on GitHub.

+

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

+
+
+
+ + diff --git a/stock_barcodes_gs1_expiry_simple/wizards/__init__.py b/stock_barcodes_gs1_expiry_simple/wizards/__init__.py new file mode 100644 index 000000000000..eaa7f0aea835 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/wizards/__init__.py @@ -0,0 +1 @@ +from . import stock_barcodes_read diff --git a/stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read.py b/stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read.py new file mode 100644 index 000000000000..7309d65a0196 --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read.py @@ -0,0 +1,26 @@ +# Copyright 2024 Akretion France (https://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class WizStockBarcodesRead(models.AbstractModel): + _inherit = "wiz.stock.barcodes.read" + + expiry_date = fields.Date(readonly=True) + product_use_expiry_date = fields.Boolean(related="product_id.use_expiry_date") + + def _process_ai_17(self, gs1_list): + self.expiry_date = self.barcode + return True + + def _prepare_lot_vals(self): + vals = super()._prepare_lot_vals() + if self.expiry_date: + vals["expiry_date"] = self.expiry_date + return vals + + def action_clean_lot(self): + self.expiry_date = False + return super().action_clean_lot() diff --git a/stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read_view.xml b/stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read_view.xml new file mode 100644 index 000000000000..35c624322bbf --- /dev/null +++ b/stock_barcodes_gs1_expiry_simple/wizards/stock_barcodes_read_view.xml @@ -0,0 +1,34 @@ + + + + + + wiz.stock.barcodes.read + + + + + + +
+ Expiry Date + + +
+
+
+
+ +