Skip to content

Commit

Permalink
[MIG] product_expiry_simple to v16
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Nov 23, 2023
1 parent 343a0dc commit fd7953e
Show file tree
Hide file tree
Showing 21 changed files with 924 additions and 118 deletions.
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ odoo_test_flavor: Both
odoo_version: 16.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
rebel_module_groups: []
rebel_module_groups:
- product_expiry_simple
repo_description: 'TODO: add repo description.'
repo_name: stock-logistics-workflow
repo_slug: stock-logistics-workflow
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ jobs:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
include: "product_expiry_simple"
name: test OCB with product_expiry_simple
makepot: "true"
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
exclude: "product_expiry_simple"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
exclude: "product_expiry_simple"
name: test with OCB
makepot: "true"
services:
Expand All @@ -49,6 +55,9 @@ jobs:
POSTGRES_DB: odoo
ports:
- 5432:5432
env:
INCLUDE: "${{ matrix.include }}"
EXCLUDE: "${{ matrix.exclude }}"
steps:
- uses: actions/checkout@v3
with:
Expand Down
93 changes: 62 additions & 31 deletions product_expiry_simple/README.rst
Original file line number Diff line number Diff line change
@@ -1,63 +1,94 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=====================
Product Expiry Simple
=====================

This module is similar to the official `product_expiry <https://www.odoo.com/apps/modules/11.0/product_expiry/>`_ module that adds support for *Expiry Dates* on products, but it is both simpler and better:

* Only one *Expiry Date* field instead of 4 fields (End of Life Date, Best before Date, Removal Date, Alert Date)!
* Use date field instead of datetime field for *Expiry Date*
* No automatic computing of Expiry Date based on a delay configured on product because it is not used most of the time (for manufacturing companies, the rules that control expiry dates are usually more complex than that ; for reseller companies, they have to copy the expiry date written on the good when they receive it in their warehouse)
* List views of production lots and quants have a color depending on expiry date: green if expiry date is in the future, red if it is in the past.
* Ability to show stats about expiry dates on quants pivot table (because, with this module, the *Expiry Date* is a related stored field on stock.quant).
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:69f3f7a87a6693fcb7bc65777b3469b94a5f4160655370a69cebcdcbdace12c0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.0/product_expiry_simple
: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-16-0/stock-logistics-workflow-16-0-product_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-workflow&target_branch=16.0
:alt: Try me on Runboat

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

This module is similar to the official `product_expiry <https://github.com/odoo/odoo/tree/16.0/addons/product_expiry>`_ module that adds support for *Expiry Dates* on products, but it is both simpler and better:

* Only one *Expiry Date* field instead of 4 fields (Expiration Date, Best before Date, Removal Date, Alert Date)!
* Use date field instead of datetime field for *Expiry Date*.
* No automatic computing of Expiry Date based on a delay configured on product because it is not used most of the time (for manufacturing companies, the rules that control expiry dates are usually more complex than that ; for reseller companies, they have to copy the expiry date written on the good when they receive it in their warehouse).

This modules keeps the main feature of the official *product_expiry* module: the support of FEFO (First Expiry First Out).

I decided to develop this module because, after implementing *product_expiry* at several companies, I noticed that I spent more time inheriting the official *product_expiry* module to make always the same kind of changes that re-developping a simpler and better alternative.

Configuration
=============

No configuration needed.

Usage
=====
**Table of contents**

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/154/11.0
.. 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 smashing it by providing a detailed and welcomed feedback.
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:%20product_expiry_simple%0Aversion:%2016.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
~~~~~~~

* Akretion
* Jarsa Sistemas

Contributors
------------
~~~~~~~~~~~~

* Alexis de Lattre <[email protected]>
* Alan Ramos <[email protected]>

Maintainer
----------
Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via

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

|maintainer-alexis-via|

This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/product_expiry_simple>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
9 changes: 5 additions & 4 deletions product_expiry_simple/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2017-2021 Akretion France (http://www.akretion.com/)
# Copyright 2018-2021 Jarsa Sistemas (Alan Ramos <[email protected]>)
# Copyright 2017-2022 Akretion France (http://www.akretion.com/)
# Copyright 2018-2022 Jarsa Sistemas (Alan Ramos <[email protected]>)
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Product Expiry Simple",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Product",
"license": "AGPL-3",
"summary": "Simpler and better alternative to the official product_expiry module",
Expand All @@ -18,7 +18,8 @@
"excludes": ["product_expiry"],
"data": [
"data/product_removal.xml",
"views/stock_production_lot.xml",
"views/product_template.xml",
"views/stock_lot.xml",
"views/stock_quant.xml",
"views/stock_move_line.xml",
"views/stock_picking.xml",
Expand Down
135 changes: 135 additions & 0 deletions product_expiry_simple/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_expiry_simple
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-13 11:44+0000\n"
"PO-Revision-Date: 2022-12-13 11:44+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: product_expiry_simple
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.view_stock_quant_form_editable
msgid ""
"<span class=\"badge badge-danger\" attrs=\"{'invisible': [('expired', '=', "
"False)]}\">Expired</span>"
msgstr "<span class=\"badge badge-danger\" attrs=\"{'invisible': [('expired', '=', False)]}\">Périmé</span>"

#. module: product_expiry_simple
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.view_production_lot_form
msgid ""
"<span class=\"badge text-bg-danger\" attrs=\"{'invisible': [('expired', '=',"
" False)]}\">Expired</span>"
msgstr "<span class=\"badge text-bg-danger\" attrs=\"{'invisible': [('expired', '=', False)]}\">Périmé</span>"

#. module: product_expiry_simple
#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_lot__expired
#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant__expired
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.quant_search_view
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter
msgid "Expired"
msgstr "Périmé"

#. module: product_expiry_simple
#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_lot__expiry_date
#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_move_line__expiry_date
#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant__expiry_date
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.quant_search_view
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter
msgid "Expiry Date"
msgstr "Date de péremption"

#. module: product_expiry_simple
#: model:ir.model,name:product_expiry_simple.model_stock_lot
msgid "Lot/Serial"
msgstr "Lot/N°série"

#. module: product_expiry_simple
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.quant_search_view
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter
msgid "Not Expired"
msgstr "Non périmé"

#. module: product_expiry_simple
#: model_terms:ir.ui.view,arch_db:product_expiry_simple.view_picking_form
msgid "One or several products have <b>expired</b> lots"
msgstr "Un ou plusieurs articles ont des lots <b>périmés</b>"

#. module: product_expiry_simple
#: model:ir.model,name:product_expiry_simple.model_product_template
msgid "Product"
msgstr "Article"

#. module: product_expiry_simple
#: model:ir.model,name:product_expiry_simple.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
msgstr "Mouvements d'article (Ligne de mouvement de stock)"

#. module: product_expiry_simple
#. odoo-python
#: code:addons/product_expiry_simple/models/stock_lot.py:0
#, python-format
msgid ""
"Product {product} doesn't use expiry dates, but an expiry date is set on lot"
" {lot}."
msgstr ""
"L'article {product} n'utilise pas de dates de péremption, mais une date de "
"péremption est renseignée sur le lot {lot}."

#. module: product_expiry_simple
#. odoo-python
#: code:addons/product_expiry_simple/models/stock_lot.py:0
#, python-format
msgid ""
"Product {product} uses expiry dates, but expiry date is missing on lot "
"{lot}."
msgstr ""
"L'article {product} utilise les dates de péremption, mais la date de "
"péremption n'est pas renseignée sur le lot {lot}."

#. module: product_expiry_simple
#: model:ir.model,name:product_expiry_simple.model_stock_quant
msgid "Quants"
msgstr ""

#. module: product_expiry_simple
#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_picking__show_expiry_warning
msgid "Show Expiry Warning"
msgstr "Afficher l'avertissement de péremption"

#. module: product_expiry_simple
#: model:ir.model,name:product_expiry_simple.model_stock_picking
msgid "Transfer"
msgstr "Transfert"

#. module: product_expiry_simple
#: model:ir.model.fields,field_description:product_expiry_simple.field_product_product__use_expiry_date
#: model:ir.model.fields,field_description:product_expiry_simple.field_product_template__use_expiry_date
#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_lot__use_expiry_date
msgid "Use Expiry Date"
msgstr "Utilise des dates de péremption"

#. module: product_expiry_simple
#. odoo-python
#: code:addons/product_expiry_simple/models/product_template.py:0
#, python-format
msgid ""
"You cannot set 'Use Expiry Date' on product '%s' because it is not tracked "
"by lot nor serial number."
msgstr ""
"Vous ne pouvez pas activer 'Utilise des dates de péremption' sur l'article "
"'%s' car il n'est tracé ni par lots ni par N° de série."

#. module: product_expiry_simple
#. odoo-python
#: code:addons/product_expiry_simple/models/stock_lot.py:0
#, python-format
msgid "[%s Expired] %s"
msgstr "[%s Périmé] %s"
Loading

0 comments on commit fd7953e

Please sign in to comment.