From ad176dd059986f0df6c9c4630e7c73a691eb7c37 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 13 Feb 2017 11:34:28 +0100 Subject: [PATCH 01/21] Add module product_expiry_simple --- product_expiry_simple/README.rst | 60 ++++++++++++ product_expiry_simple/__init__.py | 3 + product_expiry_simple/__manifest__.py | 21 ++++ .../data/product_removal.xml | 9 ++ product_expiry_simple/models/__init__.py | 4 + .../models/stock_production_lot.py | 24 +++++ product_expiry_simple/models/stock_quant.py | 24 +++++ product_expiry_simple/views/stock.xml | 96 +++++++++++++++++++ 8 files changed, 241 insertions(+) create mode 100644 product_expiry_simple/README.rst create mode 100644 product_expiry_simple/__init__.py create mode 100644 product_expiry_simple/__manifest__.py create mode 100644 product_expiry_simple/data/product_removal.xml create mode 100644 product_expiry_simple/models/__init__.py create mode 100644 product_expiry_simple/models/stock_production_lot.py create mode 100644 product_expiry_simple/models/stock_quant.py create mode 100644 product_expiry_simple/views/stock.xml diff --git a/product_expiry_simple/README.rst b/product_expiry_simple/README.rst new file mode 100644 index 000000000000..31c253553518 --- /dev/null +++ b/product_expiry_simple/README.rst @@ -0,0 +1,60 @@ +.. 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 `_ module, 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 fields +* 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 lot and quants not have a color depending on Expiry Date +* 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). + +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 +===== + +.. 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/10.0 + +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 smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ + +* Alexis de Lattre + +Maintainer +---------- + +.. 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. diff --git a/product_expiry_simple/__init__.py b/product_expiry_simple/__init__.py new file mode 100644 index 000000000000..21ff7c22f3c0 --- /dev/null +++ b/product_expiry_simple/__init__.py @@ -0,0 +1,3 @@ +# -*- encoding: utf-8 -*- + +from . import models diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py new file mode 100644 index 000000000000..8f962b4112bd --- /dev/null +++ b/product_expiry_simple/__manifest__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Product Expiry Simple', + 'version': '10.0.1.0.0', + 'category': 'Product', + 'license': 'AGPL-3', + 'summary': + 'Simpler and better alternative to the official product_expiry module', + 'author': 'Akretion,Odoo Community Association (OCA)', + 'website': 'http://www.akretion.com', + 'depends': ['stock'], + 'conflicts': ['product_expiry'], + 'data': [ + 'views/stock.xml', + 'data/product_removal.xml', + ], + 'installable': True, +} diff --git a/product_expiry_simple/data/product_removal.xml b/product_expiry_simple/data/product_removal.xml new file mode 100644 index 000000000000..409ec201b324 --- /dev/null +++ b/product_expiry_simple/data/product_removal.xml @@ -0,0 +1,9 @@ + + + + + First Expiry First Out (FEFO) + fefo + + + diff --git a/product_expiry_simple/models/__init__.py b/product_expiry_simple/models/__init__.py new file mode 100644 index 000000000000..613f6b701f9b --- /dev/null +++ b/product_expiry_simple/models/__init__.py @@ -0,0 +1,4 @@ +# -*- encoding: utf-8 -*- + +from . import stock_production_lot +from . import stock_quant diff --git a/product_expiry_simple/models/stock_production_lot.py b/product_expiry_simple/models/stock_production_lot.py new file mode 100644 index 000000000000..5208d35a326d --- /dev/null +++ b/product_expiry_simple/models/stock_production_lot.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api + + +class StockProductionLot(models.Model): + _inherit = 'stock.production.lot' + _rec_name = 'display_name' + + expiry_date = fields.Date(string='Expiry Date') + display_name = fields.Char( + compute='compute_display_name_field', + string='Lot/Serial Number Display', store=True, readonly=True) + + @api.multi + @api.depends('name', 'expiry_date') + def compute_display_name_field(self): + for lot in self: + dname = lot.name + if lot.expiry_date: + dname = '[%s] %s' % (lot.expiry_date, dname) + lot.display_name = dname diff --git a/product_expiry_simple/models/stock_quant.py b/product_expiry_simple/models/stock_quant.py new file mode 100644 index 000000000000..c21709054495 --- /dev/null +++ b/product_expiry_simple/models/stock_quant.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api + + +class StockQuant(models.Model): + _inherit = 'stock.quant' + + expiry_date = fields.Date( + related='lot_id.expiry_date', store=True, readonly=True) + + # method copy/pasted from the official product_expiry module + # © Odoo SA + @api.model + def apply_removal_strategy( + self, location, product, qty, domain, removal_strategy): + if removal_strategy == 'fefo': + order = 'expiry_date, location_id, package_id, lot_id, in_date, id' + return self._quants_get_order( + location, product, qty, domain, order) + return super(StockQuant, self).apply_removal_strategy( + location, product, qty, domain, removal_strategy) diff --git a/product_expiry_simple/views/stock.xml b/product_expiry_simple/views/stock.xml new file mode 100644 index 000000000000..f29b0771cb63 --- /dev/null +++ b/product_expiry_simple/views/stock.xml @@ -0,0 +1,96 @@ + + + + + + + + product_expiry_simple.stock.production.lot.form + stock.production.lot + + + + + + + + + + product_expiry_simple.stock.production.lot.tree + stock.production.lot + + + + + + + expiry_date and expiry_date < current_date + expiry_date and expiry_date >= current_date + + + + + + product_expiry_simple.stock.production.lot.search + stock.production.lot + + + + + + + + + + + + + + + + + + product_expiry_simple.stock.quant.tree + stock.quant + + + + + + + + expiry_date and expiry_date < current_date + expiry_date and expiry_date >= current_date + + + + + + product_expiry_simple.stock.quant.search + stock.quant + + + + + + + + + + + + + + From 8bb8071a711b04efe471c39dd5dfd2ae9f4d5ad9 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 13 Feb 2017 12:25:32 +0100 Subject: [PATCH 02/21] Small search view organisation improvement --- product_expiry_simple/views/stock.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_expiry_simple/views/stock.xml b/product_expiry_simple/views/stock.xml index f29b0771cb63..71853cca59c3 100644 --- a/product_expiry_simple/views/stock.xml +++ b/product_expiry_simple/views/stock.xml @@ -77,7 +77,7 @@ stock.quant - + Date: Mon, 13 Feb 2017 15:59:23 +0100 Subject: [PATCH 03/21] OCA coding standards --- product_expiry_simple/__init__.py | 2 +- product_expiry_simple/models/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product_expiry_simple/__init__.py b/product_expiry_simple/__init__.py index 21ff7c22f3c0..cde864bae21a 100644 --- a/product_expiry_simple/__init__.py +++ b/product_expiry_simple/__init__.py @@ -1,3 +1,3 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- from . import models diff --git a/product_expiry_simple/models/__init__.py b/product_expiry_simple/models/__init__.py index 613f6b701f9b..e1a41aa1b4ce 100644 --- a/product_expiry_simple/models/__init__.py +++ b/product_expiry_simple/models/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- from . import stock_production_lot from . import stock_quant From 9c0099bb4f68c537a0015640a1227da179a08d58 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 13 Feb 2017 16:12:57 +0100 Subject: [PATCH 04/21] Finish port of FEFO code to v10 --- product_expiry_simple/models/stock_quant.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/product_expiry_simple/models/stock_quant.py b/product_expiry_simple/models/stock_quant.py index c21709054495..a5c89bc119c7 100644 --- a/product_expiry_simple/models/stock_quant.py +++ b/product_expiry_simple/models/stock_quant.py @@ -14,11 +14,9 @@ class StockQuant(models.Model): # method copy/pasted from the official product_expiry module # © Odoo SA @api.model - def apply_removal_strategy( - self, location, product, qty, domain, removal_strategy): + def _quants_removal_get_order( + self, removal_strategy): if removal_strategy == 'fefo': - order = 'expiry_date, location_id, package_id, lot_id, in_date, id' - return self._quants_get_order( - location, product, qty, domain, order) - return super(StockQuant, self).apply_removal_strategy( - location, product, qty, domain, removal_strategy) + return 'expiry_date, in_date, id' + return super(StockQuant, self)._quants_removal_get_order( + removal_strategy) From 57ddbfa3f561e6753e45ac2333f80c8699ce8228 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 14 Feb 2017 14:31:30 +0100 Subject: [PATCH 05/21] Add FR translation for product_expiry_simple --- product_expiry_simple/i18n/fr.po | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 product_expiry_simple/i18n/fr.po diff --git a/product_expiry_simple/i18n/fr.po b/product_expiry_simple/i18n/fr.po new file mode 100644 index 000000000000..c77079b9f2d5 --- /dev/null +++ b/product_expiry_simple/i18n/fr.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_expiry_simple +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-14 13:30+0000\n" +"PO-Revision-Date: 2017-02-14 13:30+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:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model: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_production_lot_expiry_date +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model: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_production_lot +msgid "Lot/Serial" +msgstr "Lot/N° série" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Not Expired" +msgstr "Non périmé" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_quant +msgid "Quants" +msgstr "Quants" + From 4346d372af1c9a354f075fd48475b89b7fd083da Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 28 Apr 2017 15:06:58 +0200 Subject: [PATCH 06/21] Improve module description in README --- product_expiry_simple/README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/product_expiry_simple/README.rst b/product_expiry_simple/README.rst index 31c253553518..3f51515ad09e 100644 --- a/product_expiry_simple/README.rst +++ b/product_expiry_simple/README.rst @@ -6,14 +6,16 @@ Product Expiry Simple ===================== -This module is similar to the official `product_expiry `_ module, but it is both simpler and better: +This module is similar to the official `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 fields +* 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 lot and quants not have a color depending on Expiry Date +* 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 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 From f7774dd4cc0fd1d3fb0769e86030f61d25fb9eb1 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 24 Jun 2017 11:50:45 +0200 Subject: [PATCH 07/21] OCA Transbot updated translations from Transifex --- product_expiry_simple/i18n/de.po | 49 ++++++++++++++++++++++++++++ product_expiry_simple/i18n/es.po | 50 +++++++++++++++++++++++++++++ product_expiry_simple/i18n/fr.po | 21 ++++++------ product_expiry_simple/i18n/it.po | 49 ++++++++++++++++++++++++++++ product_expiry_simple/i18n/nl_NL.po | 49 ++++++++++++++++++++++++++++ product_expiry_simple/i18n/sl.po | 49 ++++++++++++++++++++++++++++ 6 files changed, 258 insertions(+), 9 deletions(-) create mode 100644 product_expiry_simple/i18n/de.po create mode 100644 product_expiry_simple/i18n/es.po create mode 100644 product_expiry_simple/i18n/it.po create mode 100644 product_expiry_simple/i18n/nl_NL.po create mode 100644 product_expiry_simple/i18n/sl.po diff --git a/product_expiry_simple/i18n/de.po b/product_expiry_simple/i18n/de.po new file mode 100644 index 000000000000..ef08ab9a4aca --- /dev/null +++ b/product_expiry_simple/i18n/de.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_expiry_simple +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_production_lot_expiry_date +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expiry Date" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_production_lot +msgid "Lot/Serial" +msgstr "Los/Serie" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Not Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_quant +msgid "Quants" +msgstr "" diff --git a/product_expiry_simple/i18n/es.po b/product_expiry_simple/i18n/es.po new file mode 100644 index 000000000000..6763d05ea0e2 --- /dev/null +++ b/product_expiry_simple/i18n/es.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_expiry_simple +# +# Translators: +# OCA Transbot , 2017 +# Pedro M. Baeza , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-18 03:48+0000\n" +"PO-Revision-Date: 2017-12-18 03:48+0000\n" +"Last-Translator: Pedro M. Baeza , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_production_lot_expiry_date +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expiry Date" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_production_lot +msgid "Lot/Serial" +msgstr "Lote/Serie" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Not Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_quant +msgid "Quants" +msgstr "Quants" diff --git a/product_expiry_simple/i18n/fr.po b/product_expiry_simple/i18n/fr.po index c77079b9f2d5..3dbfdef04e95 100644 --- a/product_expiry_simple/i18n/fr.po +++ b/product_expiry_simple/i18n/fr.po @@ -1,19 +1,23 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * product_expiry_simple -# +# * product_expiry_simple +# +# Translators: +# OCA Transbot , 2017 +# Lixon Jean-Yves , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-14 13:30+0000\n" -"PO-Revision-Date: 2017-02-14 13:30+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: Lixon Jean-Yves , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: product_expiry_simple #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -43,5 +47,4 @@ msgstr "Non périmé" #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" -msgstr "Quants" - +msgstr "Quantités" diff --git a/product_expiry_simple/i18n/it.po b/product_expiry_simple/i18n/it.po new file mode 100644 index 000000000000..c7a481f10c1c --- /dev/null +++ b/product_expiry_simple/i18n/it.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_expiry_simple +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_production_lot_expiry_date +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expiry Date" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_production_lot +msgid "Lot/Serial" +msgstr "Lotto/Numero di serie" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Not Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_quant +msgid "Quants" +msgstr "" diff --git a/product_expiry_simple/i18n/nl_NL.po b/product_expiry_simple/i18n/nl_NL.po new file mode 100644 index 000000000000..d109be1c0bda --- /dev/null +++ b/product_expiry_simple/i18n/nl_NL.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_expiry_simple +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-17 01:29+0000\n" +"PO-Revision-Date: 2017-06-17 01:29+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expired" +msgstr "Vervallen" + +#. module: product_expiry_simple +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_production_lot_expiry_date +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expiry Date" +msgstr "Vervaldatum" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_production_lot +msgid "Lot/Serial" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Not Expired" +msgstr "Niet Vervallen" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_quant +msgid "Quants" +msgstr "" diff --git a/product_expiry_simple/i18n/sl.po b/product_expiry_simple/i18n/sl.po new file mode 100644 index 000000000000..0d95c50343a7 --- /dev/null +++ b/product_expiry_simple/i18n/sl.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_expiry_simple +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_production_lot_expiry_date +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expiry Date" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_production_lot +msgid "Lot/Serial" +msgstr "Lot/serijska št." + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Not Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_quant +msgid "Quants" +msgstr "" From 7f1d9ceee35d78dc1c8dd5cc58819c92d9a8417d Mon Sep 17 00:00:00 2001 From: Alan Ramos Date: Thu, 4 Jan 2018 20:14:08 -0600 Subject: [PATCH 08/21] make changes to migrate module to V11 --- product_expiry_simple/README.rst | 5 +- product_expiry_simple/__init__.py | 4 +- product_expiry_simple/__manifest__.py | 17 +- .../data/product_removal.xml | 10 +- product_expiry_simple/i18n/es.po | 29 ++-- product_expiry_simple/models/__init__.py | 5 +- .../models/stock_move_line.py | 19 +++ .../models/stock_production_lot.py | 7 +- product_expiry_simple/models/stock_quant.py | 7 +- product_expiry_simple/views/stock.xml | 161 +++++++++--------- product_expiry_simple/views/stock_picking.xml | 23 +++ 11 files changed, 163 insertions(+), 124 deletions(-) create mode 100644 product_expiry_simple/models/stock_move_line.py create mode 100644 product_expiry_simple/views/stock_picking.xml diff --git a/product_expiry_simple/README.rst b/product_expiry_simple/README.rst index 3f51515ad09e..8996bb3df5b7 100644 --- a/product_expiry_simple/README.rst +++ b/product_expiry_simple/README.rst @@ -6,7 +6,7 @@ Product Expiry Simple ===================== -This module is similar to the official `product_expiry `_ module that adds support for *Expiry Dates* on products, but it is both simpler and better: +This module is similar to the official `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* @@ -28,7 +28,7 @@ Usage .. 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/10.0 + :target: https://runbot.odoo-community.org/runbot/154/11.0 Bug Tracker =========== @@ -45,6 +45,7 @@ Contributors ------------ * Alexis de Lattre +* Alan Ramos Maintainer ---------- diff --git a/product_expiry_simple/__init__.py b/product_expiry_simple/__init__.py index cde864bae21a..8069ec1085a8 100644 --- a/product_expiry_simple/__init__.py +++ b/product_expiry_simple/__init__.py @@ -1,3 +1,5 @@ -# -*- coding: utf-8 -*- +# © 2017 Akretion (Alexis de Lattre ) +# © 2018 Jarsa Sistemas (Alan Ramos ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py index 8f962b4112bd..e71c5ef2bd71 100644 --- a/product_expiry_simple/__manifest__.py +++ b/product_expiry_simple/__manifest__.py @@ -1,21 +1,26 @@ -# -*- coding: utf-8 -*- # © 2017 Akretion (Alexis de Lattre ) +# © 2018 Jarsa Sistemas (Alan Ramos ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Product Expiry Simple', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'category': 'Product', 'license': 'AGPL-3', 'summary': 'Simpler and better alternative to the official product_expiry module', - 'author': 'Akretion,Odoo Community Association (OCA)', + 'author': 'Akretion,Jarsa Sistemas,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com', - 'depends': ['stock'], - 'conflicts': ['product_expiry'], + 'depends': [ + 'stock', + ], + 'conflicts': [ + 'product_expiry' + ], 'data': [ 'views/stock.xml', 'data/product_removal.xml', - ], + 'views/stock_picking.xml', + ], 'installable': True, } diff --git a/product_expiry_simple/data/product_removal.xml b/product_expiry_simple/data/product_removal.xml index 409ec201b324..2115873251c7 100644 --- a/product_expiry_simple/data/product_removal.xml +++ b/product_expiry_simple/data/product_removal.xml @@ -1,9 +1,7 @@ - - - First Expiry First Out (FEFO) - fefo - - + + First Expiry First Out (FEFO) + fefo + diff --git a/product_expiry_simple/i18n/es.po b/product_expiry_simple/i18n/es.po index 6763d05ea0e2..24bea7adad0b 100644 --- a/product_expiry_simple/i18n/es.po +++ b/product_expiry_simple/i18n/es.po @@ -1,29 +1,25 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * product_expiry_simple -# -# Translators: -# OCA Transbot , 2017 -# Pedro M. Baeza , 2017 +# * product_expiry_simple +# msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0+e\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-18 03:48+0000\n" -"PO-Revision-Date: 2017-12-18 03:48+0000\n" -"Last-Translator: Pedro M. Baeza , 2017\n" -"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"POT-Creation-Date: 2018-01-05 02:21+0000\n" +"PO-Revision-Date: 2018-01-05 02:21+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" -"Language: es\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: \n" #. module: product_expiry_simple #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view #: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter msgid "Expired" -msgstr "" +msgstr "Expirado" #. module: product_expiry_simple #: model:ir.model.fields,field_description:product_expiry_simple.field_stock_production_lot_expiry_date @@ -31,20 +27,21 @@ msgstr "" #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view #: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter msgid "Expiry Date" -msgstr "" +msgstr "Fecha de Expiración" #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_production_lot msgid "Lot/Serial" -msgstr "Lote/Serie" +msgstr "Lote/Nº de serie" #. module: product_expiry_simple #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view #: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter msgid "Not Expired" -msgstr "" +msgstr "No Expirado" #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" msgstr "Quants" + diff --git a/product_expiry_simple/models/__init__.py b/product_expiry_simple/models/__init__.py index e1a41aa1b4ce..500de7035f71 100644 --- a/product_expiry_simple/models/__init__.py +++ b/product_expiry_simple/models/__init__.py @@ -1,4 +1,7 @@ -# -*- coding: utf-8 -*- +# © 2017 Akretion (Alexis de Lattre ) +# © 2018 Jarsa Sistemas (Alan Ramos ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import stock_production_lot from . import stock_quant +from . import stock_move_line diff --git a/product_expiry_simple/models/stock_move_line.py b/product_expiry_simple/models/stock_move_line.py new file mode 100644 index 000000000000..3fb2fc782f1e --- /dev/null +++ b/product_expiry_simple/models/stock_move_line.py @@ -0,0 +1,19 @@ +# © 2017 Akretion (Alexis de Lattre ) +# © 2018 Jarsa Sistemas (Sarai Osorio ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api + + +class StockMoveLine(models.Model): + _inherit = 'stock.move.line' + + expiry_date = fields.Date(string='Expiry Date') + + @api.model + def _action_done(self): + super(StockMoveLine, self)._action_done() + for rec in self: + if rec.move_id.picking_type_id.use_create_lots: + if rec.lot_id: + rec.lot_id.write({'expiry_date': rec.expiry_date}) diff --git a/product_expiry_simple/models/stock_production_lot.py b/product_expiry_simple/models/stock_production_lot.py index 5208d35a326d..eb367fd16638 100644 --- a/product_expiry_simple/models/stock_production_lot.py +++ b/product_expiry_simple/models/stock_production_lot.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- # © 2017 Akretion (Alexis de Lattre ) +# © 2018 Jarsa Sistemas (Alan Ramos ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields, api @@ -7,16 +7,15 @@ class StockProductionLot(models.Model): _inherit = 'stock.production.lot' - _rec_name = 'display_name' expiry_date = fields.Date(string='Expiry Date') display_name = fields.Char( - compute='compute_display_name_field', + compute='_compute_display_name', string='Lot/Serial Number Display', store=True, readonly=True) @api.multi @api.depends('name', 'expiry_date') - def compute_display_name_field(self): + def _compute_display_name(self): for lot in self: dname = lot.name if lot.expiry_date: diff --git a/product_expiry_simple/models/stock_quant.py b/product_expiry_simple/models/stock_quant.py index a5c89bc119c7..155e0807e66d 100644 --- a/product_expiry_simple/models/stock_quant.py +++ b/product_expiry_simple/models/stock_quant.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- # © 2017 Akretion (Alexis de Lattre ) +# © 2018 Jarsa Sistemas (Alan Ramos ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields, api @@ -14,9 +14,8 @@ class StockQuant(models.Model): # method copy/pasted from the official product_expiry module # © Odoo SA @api.model - def _quants_removal_get_order( - self, removal_strategy): + def _get_removal_strategy_order(self, removal_strategy): if removal_strategy == 'fefo': return 'expiry_date, in_date, id' - return super(StockQuant, self)._quants_removal_get_order( + return super(StockQuant, self)._get_removal_strategy_order( removal_strategy) diff --git a/product_expiry_simple/views/stock.xml b/product_expiry_simple/views/stock.xml index 71853cca59c3..bc61e05d5396 100644 --- a/product_expiry_simple/views/stock.xml +++ b/product_expiry_simple/views/stock.xml @@ -3,94 +3,87 @@ © 2017 Akretion (Alexis de Lattre ) License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - - - - - product_expiry_simple.stock.production.lot.form - stock.production.lot - - - - + + view.stock.move.line.operation.lot.expiry.tree + stock.move.line + + + + + - - - - - product_expiry_simple.stock.production.lot.tree - stock.production.lot - - - - + + + + product_expiry_simple.stock.production.lot.form + stock.production.lot + + + + + - - expiry_date and expiry_date < current_date - expiry_date and expiry_date >= current_date - - - - - - product_expiry_simple.stock.production.lot.search - stock.production.lot - - - - - + + + product_expiry_simple.stock.production.lot.tree + stock.production.lot + + + + + + + expiry_date and expiry_date < current_date + expiry_date and expiry_date >= current_date + - - - - - - - - - - - - product_expiry_simple.stock.quant.tree - stock.quant - - - - + + + product_expiry_simple.stock.quant.tree + stock.quant + + + + - + + + + expiry_date and expiry_date < current_date + expiry_date and expiry_date >= current_date + + + + + product_expiry_simple.stock.quant.search + stock.quant + + + + + + + + + + - - expiry_date and expiry_date < current_date - expiry_date and expiry_date >= current_date - - - - - - product_expiry_simple.stock.quant.search - stock.quant - - - - - - - - - - - - - + diff --git a/product_expiry_simple/views/stock_picking.xml b/product_expiry_simple/views/stock_picking.xml new file mode 100644 index 000000000000..6e1f82db9eac --- /dev/null +++ b/product_expiry_simple/views/stock_picking.xml @@ -0,0 +1,23 @@ + + + + product_expiry_simple.stock.picking.tree + stock.picking + + + + + + + + + product_expiry_simple.stock.move.operations.tree + stock.move.line + + + + + + + + From bd24a5f9387aaade327c8db07b24c7bd8b843640 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 11 Oct 2018 18:21:01 +0000 Subject: [PATCH 09/21] Update product_expiry_simple.pot --- product_expiry_simple/i18n/de.po | 10 +++- product_expiry_simple/i18n/es.po | 8 ++- product_expiry_simple/i18n/fr.po | 10 +++- product_expiry_simple/i18n/it.po | 10 +++- product_expiry_simple/i18n/nl_NL.po | 13 +++-- .../i18n/product_expiry_simple.pot | 51 +++++++++++++++++++ product_expiry_simple/i18n/sl.po | 13 +++-- 7 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 product_expiry_simple/i18n/product_expiry_simple.pot diff --git a/product_expiry_simple/i18n/de.po b/product_expiry_simple/i18n/de.po index ef08ab9a4aca..073d4392d74e 100644 --- a/product_expiry_simple/i18n/de.po +++ b/product_expiry_simple/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_expiry_simple -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_expiry_simple @@ -25,6 +25,7 @@ msgid "Expired" msgstr "" #. module: product_expiry_simple +#: 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_production_lot_expiry_date #: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -43,6 +44,11 @@ msgstr "Los/Serie" msgid "Not Expired" msgstr "" +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_move_line +msgid "Packing Operation" +msgstr "" + #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" diff --git a/product_expiry_simple/i18n/es.po b/product_expiry_simple/i18n/es.po index 24bea7adad0b..4ec78ae7b22d 100644 --- a/product_expiry_simple/i18n/es.po +++ b/product_expiry_simple/i18n/es.po @@ -10,6 +10,7 @@ msgstr "" "PO-Revision-Date: 2018-01-05 02:21+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" @@ -22,6 +23,7 @@ msgid "Expired" msgstr "Expirado" #. module: product_expiry_simple +#: 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_production_lot_expiry_date #: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -40,8 +42,12 @@ msgstr "Lote/Nº de serie" msgid "Not Expired" msgstr "No Expirado" +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_move_line +msgid "Packing Operation" +msgstr "" + #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" msgstr "Quants" - diff --git a/product_expiry_simple/i18n/fr.po b/product_expiry_simple/i18n/fr.po index 3dbfdef04e95..42f54909f9ac 100644 --- a/product_expiry_simple/i18n/fr.po +++ b/product_expiry_simple/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_expiry_simple -# +# # Translators: # OCA Transbot , 2017 # Lixon Jean-Yves , 2017 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: Lixon Jean-Yves , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: product_expiry_simple @@ -26,6 +26,7 @@ msgid "Expired" msgstr "Périmé" #. module: product_expiry_simple +#: 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_production_lot_expiry_date #: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -44,6 +45,11 @@ msgstr "Lot/N° série" msgid "Not Expired" msgstr "Non périmé" +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_move_line +msgid "Packing Operation" +msgstr "" + #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" diff --git a/product_expiry_simple/i18n/it.po b/product_expiry_simple/i18n/it.po index c7a481f10c1c..65e5e2a2359f 100644 --- a/product_expiry_simple/i18n/it.po +++ b/product_expiry_simple/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_expiry_simple -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_expiry_simple @@ -25,6 +25,7 @@ msgid "Expired" msgstr "" #. module: product_expiry_simple +#: 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_production_lot_expiry_date #: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -43,6 +44,11 @@ msgstr "Lotto/Numero di serie" msgid "Not Expired" msgstr "" +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_move_line +msgid "Packing Operation" +msgstr "" + #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" diff --git a/product_expiry_simple/i18n/nl_NL.po b/product_expiry_simple/i18n/nl_NL.po index d109be1c0bda..9aa97600ba4e 100644 --- a/product_expiry_simple/i18n/nl_NL.po +++ b/product_expiry_simple/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_expiry_simple -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-06-17 01:29+0000\n" "PO-Revision-Date: 2017-06-17 01:29+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_expiry_simple @@ -25,6 +26,7 @@ msgid "Expired" msgstr "Vervallen" #. module: product_expiry_simple +#: 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_production_lot_expiry_date #: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -43,6 +45,11 @@ msgstr "" msgid "Not Expired" msgstr "Niet Vervallen" +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_move_line +msgid "Packing Operation" +msgstr "" + #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" diff --git a/product_expiry_simple/i18n/product_expiry_simple.pot b/product_expiry_simple/i18n/product_expiry_simple.pot new file mode 100644 index 000000000000..bfdb9ee2f0c8 --- /dev/null +++ b/product_expiry_simple/i18n/product_expiry_simple.pot @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_expiry_simple +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.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: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expired" +msgstr "" + +#. module: product_expiry_simple +#: 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_production_lot_expiry_date +#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Expiry Date" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_production_lot +msgid "Lot/Serial" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view +#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter +msgid "Not Expired" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_move_line +msgid "Packing Operation" +msgstr "" + +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_quant +msgid "Quants" +msgstr "" + diff --git a/product_expiry_simple/i18n/sl.po b/product_expiry_simple/i18n/sl.po index 0d95c50343a7..8c34ab04eb41 100644 --- a/product_expiry_simple/i18n/sl.po +++ b/product_expiry_simple/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_expiry_simple -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: product_expiry_simple #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -25,6 +26,7 @@ msgid "Expired" msgstr "" #. module: product_expiry_simple +#: 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_production_lot_expiry_date #: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date #: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view @@ -43,6 +45,11 @@ msgstr "Lot/serijska št." msgid "Not Expired" msgstr "" +#. module: product_expiry_simple +#: model:ir.model,name:product_expiry_simple.model_stock_move_line +msgid "Packing Operation" +msgstr "" + #. module: product_expiry_simple #: model:ir.model,name:product_expiry_simple.model_stock_quant msgid "Quants" From 45d5724343320e70a48b4e66941d5e237ed338e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Mart=C3=ADn=20Zabalza?= Date: Tue, 19 Feb 2019 19:05:14 +0100 Subject: [PATCH 10/21] product_expiry_simple: delete duplicate view --- product_expiry_simple/views/stock.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/product_expiry_simple/views/stock.xml b/product_expiry_simple/views/stock.xml index bc61e05d5396..0fe81fa4536d 100644 --- a/product_expiry_simple/views/stock.xml +++ b/product_expiry_simple/views/stock.xml @@ -4,16 +4,6 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - - view.stock.move.line.operation.lot.expiry.tree - stock.move.line - - - - - - - product_expiry_simple.stock.production.lot.form From 94d7256c71a2deb0178dbd124b7377dfed472586 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 3 Apr 2019 03:26:32 +0000 Subject: [PATCH 11/21] icon.png --- .../static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 product_expiry_simple/static/description/icon.png diff --git a/product_expiry_simple/static/description/icon.png b/product_expiry_simple/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(P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eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 From 9283686374c54d596dd12ac4808d03f5d85f8a3a Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 6 Jun 2019 20:02:20 +0200 Subject: [PATCH 12/21] [MIG] product_expiry_simple from v11 to v12 --- product_expiry_simple/__init__.py | 4 -- product_expiry_simple/__manifest__.py | 7 +-- product_expiry_simple/models/__init__.py | 4 -- .../models/stock_move_line.py | 12 ++--- .../models/stock_production_lot.py | 32 ++++++++---- product_expiry_simple/models/stock_quant.py | 13 ++--- product_expiry_simple/readme/CONTRIBUTORS.rst | 2 + product_expiry_simple/readme/DESCRIPTION.rst | 10 ++++ product_expiry_simple/views/stock.xml | 49 +++++++++++++++++-- product_expiry_simple/views/stock_picking.xml | 12 ++--- 10 files changed, 103 insertions(+), 42 deletions(-) create mode 100644 product_expiry_simple/readme/CONTRIBUTORS.rst create mode 100644 product_expiry_simple/readme/DESCRIPTION.rst diff --git a/product_expiry_simple/__init__.py b/product_expiry_simple/__init__.py index 8069ec1085a8..0650744f6bc6 100644 --- a/product_expiry_simple/__init__.py +++ b/product_expiry_simple/__init__.py @@ -1,5 +1 @@ -# © 2017 Akretion (Alexis de Lattre ) -# © 2018 Jarsa Sistemas (Alan Ramos ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - from . import models diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py index e71c5ef2bd71..4e3f70fd5f43 100644 --- a/product_expiry_simple/__manifest__.py +++ b/product_expiry_simple/__manifest__.py @@ -1,10 +1,11 @@ -# © 2017 Akretion (Alexis de Lattre ) -# © 2018 Jarsa Sistemas (Alan Ramos ) +# Copyright 2017-2019 Akretion France (http://www.akretion.com/) +# Copyright 2018-2019 Jarsa Sistemas (Alan Ramos ) +# @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Product Expiry Simple', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'category': 'Product', 'license': 'AGPL-3', 'summary': diff --git a/product_expiry_simple/models/__init__.py b/product_expiry_simple/models/__init__.py index 500de7035f71..169128dfeabc 100644 --- a/product_expiry_simple/models/__init__.py +++ b/product_expiry_simple/models/__init__.py @@ -1,7 +1,3 @@ -# © 2017 Akretion (Alexis de Lattre ) -# © 2018 Jarsa Sistemas (Alan Ramos ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - from . import stock_production_lot from . import stock_quant from . import stock_move_line diff --git a/product_expiry_simple/models/stock_move_line.py b/product_expiry_simple/models/stock_move_line.py index 3fb2fc782f1e..87f2af8a4218 100644 --- a/product_expiry_simple/models/stock_move_line.py +++ b/product_expiry_simple/models/stock_move_line.py @@ -1,8 +1,9 @@ -# © 2017 Akretion (Alexis de Lattre ) -# © 2018 Jarsa Sistemas (Sarai Osorio ) +# Copyright 2017-2019 Akretion France (http://www.akretion.com/) +# Copyright 2018-2019 Jarsa Sistemas (Sarai Osorio ) +# @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api +from odoo import api, fields, models class StockMoveLine(models.Model): @@ -14,6 +15,5 @@ class StockMoveLine(models.Model): def _action_done(self): super(StockMoveLine, self)._action_done() for rec in self: - if rec.move_id.picking_type_id.use_create_lots: - if rec.lot_id: - rec.lot_id.write({'expiry_date': rec.expiry_date}) + if rec.move_id.picking_type_id.use_create_lots and rec.lot_id: + rec.lot_id.write({'expiry_date': rec.expiry_date}) diff --git a/product_expiry_simple/models/stock_production_lot.py b/product_expiry_simple/models/stock_production_lot.py index eb367fd16638..795383912615 100644 --- a/product_expiry_simple/models/stock_production_lot.py +++ b/product_expiry_simple/models/stock_production_lot.py @@ -1,23 +1,35 @@ -# © 2017 Akretion (Alexis de Lattre ) -# © 2018 Jarsa Sistemas (Alan Ramos ) +# Copyright 2017-2019 Akretion France (http://www.akretion.com/) +# Copyright 2018 Jarsa Sistemas (Alan Ramos ) +# @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api +from odoo import api, fields, models, _ class StockProductionLot(models.Model): _inherit = 'stock.production.lot' expiry_date = fields.Date(string='Expiry Date') - display_name = fields.Char( - compute='_compute_display_name', - string='Lot/Serial Number Display', store=True, readonly=True) + expired = fields.Boolean(compute='_compute_expired') + + def _compute_expired(self): + today = fields.Date.context_today(self) + for lot in self: + expired = False + if lot.expiry_date and lot.expiry_date < today: + expired = True + lot.expired = expired - @api.multi @api.depends('name', 'expiry_date') - def _compute_display_name(self): + def name_get(self): + res = [] + today = fields.Date.context_today(self) for lot in self: dname = lot.name if lot.expiry_date: - dname = '[%s] %s' % (lot.expiry_date, dname) - lot.display_name = dname + if lot.expiry_date < today: + dname = _('[%s Expired] %s') % (lot.expiry_date, dname) + else: + dname = '[%s] %s' % (lot.expiry_date, dname) + res.append((lot.id, dname)) + return res diff --git a/product_expiry_simple/models/stock_quant.py b/product_expiry_simple/models/stock_quant.py index 155e0807e66d..e5bddac2ba97 100644 --- a/product_expiry_simple/models/stock_quant.py +++ b/product_expiry_simple/models/stock_quant.py @@ -1,18 +1,19 @@ -# © 2017 Akretion (Alexis de Lattre ) -# © 2018 Jarsa Sistemas (Alan Ramos ) +# Copyright 2017-2019 Akretion France (http://www.akretion.com/) +# Copyright 2018-2019 Jarsa Sistemas (Alan Ramos ) +# @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api +from odoo import api, fields, models class StockQuant(models.Model): _inherit = 'stock.quant' - expiry_date = fields.Date( - related='lot_id.expiry_date', store=True, readonly=True) + expiry_date = fields.Date(related='lot_id.expiry_date', store=True) + expired = fields.Boolean(related='lot_id.expired') # method copy/pasted from the official product_expiry module - # © Odoo SA + # Copyright Odoo SA @api.model def _get_removal_strategy_order(self, removal_strategy): if removal_strategy == 'fefo': diff --git a/product_expiry_simple/readme/CONTRIBUTORS.rst b/product_expiry_simple/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..29dbd507094c --- /dev/null +++ b/product_expiry_simple/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Alexis de Lattre +* Alan Ramos diff --git a/product_expiry_simple/readme/DESCRIPTION.rst b/product_expiry_simple/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..207085772c64 --- /dev/null +++ b/product_expiry_simple/readme/DESCRIPTION.rst @@ -0,0 +1,10 @@ +This module is similar to the official `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. + +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. diff --git a/product_expiry_simple/views/stock.xml b/product_expiry_simple/views/stock.xml index 0fe81fa4536d..e2b17ea9059a 100644 --- a/product_expiry_simple/views/stock.xml +++ b/product_expiry_simple/views/stock.xml @@ -1,6 +1,7 @@ @@ -13,8 +14,35 @@ + + + + Expired + + + + product_expiry_simple.stock.production.lot.form_simple + stock.production.lot + + + + + + + + + Expired + + + + + product_expiry_simple.stock.production.lot.tree stock.production.lot @@ -37,6 +65,7 @@ + @@ -44,7 +73,21 @@ - + + product_expiry_simple.stock.quant.form + stock.quant + + + + + + Expired + + + + product_expiry_simple.stock.quant.tree stock.quant @@ -66,7 +109,7 @@ stock.quant - + diff --git a/product_expiry_simple/views/stock_picking.xml b/product_expiry_simple/views/stock_picking.xml index 6e1f82db9eac..f86127928298 100644 --- a/product_expiry_simple/views/stock_picking.xml +++ b/product_expiry_simple/views/stock_picking.xml @@ -1,22 +1,22 @@ - + product_expiry_simple.stock.picking.tree stock.picking - - + + - - product_expiry_simple.stock.move.operations.tree + + product_expiry_simple.stock.move.line.tree stock.move.line - + From c08369f7bd771690c882701a609046637c6ecd23 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 16 Sep 2019 15:08:50 +0200 Subject: [PATCH 13/21] Fix bug when both use_create_lots and use_existing_lots are enabled on the picking type Update FR translation --- product_expiry_simple/i18n/fr.po | 56 ------------------- .../models/stock_move_line.py | 6 +- 2 files changed, 5 insertions(+), 57 deletions(-) delete mode 100644 product_expiry_simple/i18n/fr.po diff --git a/product_expiry_simple/i18n/fr.po b/product_expiry_simple/i18n/fr.po deleted file mode 100644 index 42f54909f9ac..000000000000 --- a/product_expiry_simple/i18n/fr.po +++ /dev/null @@ -1,56 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * product_expiry_simple -# -# Translators: -# OCA Transbot , 2017 -# Lixon Jean-Yves , 2017 -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-03 03:55+0000\n" -"PO-Revision-Date: 2017-12-03 03:55+0000\n" -"Last-Translator: Lixon Jean-Yves , 2017\n" -"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" -"Language: fr\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: product_expiry_simple -#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view -#: model: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_move_line_expiry_date -#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_production_lot_expiry_date -#: model:ir.model.fields,field_description:product_expiry_simple.field_stock_quant_expiry_date -#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view -#: model: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_production_lot -msgid "Lot/Serial" -msgstr "Lot/N° série" - -#. module: product_expiry_simple -#: model:ir.ui.view,arch_db:product_expiry_simple.quant_search_view -#: model:ir.ui.view,arch_db:product_expiry_simple.search_product_lot_filter -msgid "Not Expired" -msgstr "Non périmé" - -#. module: product_expiry_simple -#: model:ir.model,name:product_expiry_simple.model_stock_move_line -msgid "Packing Operation" -msgstr "" - -#. module: product_expiry_simple -#: model:ir.model,name:product_expiry_simple.model_stock_quant -msgid "Quants" -msgstr "Quantités" diff --git a/product_expiry_simple/models/stock_move_line.py b/product_expiry_simple/models/stock_move_line.py index 87f2af8a4218..dcf5de035efb 100644 --- a/product_expiry_simple/models/stock_move_line.py +++ b/product_expiry_simple/models/stock_move_line.py @@ -15,5 +15,9 @@ class StockMoveLine(models.Model): def _action_done(self): super(StockMoveLine, self)._action_done() for rec in self: - if rec.move_id.picking_type_id.use_create_lots and rec.lot_id: + pick_type = rec.move_id.picking_type_id + if ( + pick_type.use_create_lots and + not pick_type.use_existing_lots and + rec.lot_id): rec.lot_id.write({'expiry_date': rec.expiry_date}) From 919c57629e8fe4a0553692e635827324f9318a8f Mon Sep 17 00:00:00 2001 From: David Beal Date: Wed, 22 Apr 2020 13:59:06 +0200 Subject: [PATCH 14/21] FIX product_expiry_simple: key in manifest --- product_expiry_simple/__manifest__.py | 2 +- product_expiry_simple/models/stock_move_line.py | 2 +- product_expiry_simple/models/stock_quant.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py index 4e3f70fd5f43..075dfb9d1b8e 100644 --- a/product_expiry_simple/__manifest__.py +++ b/product_expiry_simple/__manifest__.py @@ -15,7 +15,7 @@ 'depends': [ 'stock', ], - 'conflicts': [ + 'excludes': [ 'product_expiry' ], 'data': [ diff --git a/product_expiry_simple/models/stock_move_line.py b/product_expiry_simple/models/stock_move_line.py index dcf5de035efb..b0f52f5d8db1 100644 --- a/product_expiry_simple/models/stock_move_line.py +++ b/product_expiry_simple/models/stock_move_line.py @@ -13,7 +13,7 @@ class StockMoveLine(models.Model): @api.model def _action_done(self): - super(StockMoveLine, self)._action_done() + super()._action_done() for rec in self: pick_type = rec.move_id.picking_type_id if ( diff --git a/product_expiry_simple/models/stock_quant.py b/product_expiry_simple/models/stock_quant.py index e5bddac2ba97..6ba269db25af 100644 --- a/product_expiry_simple/models/stock_quant.py +++ b/product_expiry_simple/models/stock_quant.py @@ -18,5 +18,4 @@ class StockQuant(models.Model): def _get_removal_strategy_order(self, removal_strategy): if removal_strategy == 'fefo': return 'expiry_date, in_date, id' - return super(StockQuant, self)._get_removal_strategy_order( - removal_strategy) + return super()._get_removal_strategy_order(removal_strategy) From d82893c64d08f8bf85cbcbe76d06b04a52988985 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 5 May 2020 21:43:10 +0200 Subject: [PATCH 15/21] product_expiry_simple: add myself as maintainer --- product_expiry_simple/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py index 075dfb9d1b8e..56a1a67afff5 100644 --- a/product_expiry_simple/__manifest__.py +++ b/product_expiry_simple/__manifest__.py @@ -11,6 +11,7 @@ 'summary': 'Simpler and better alternative to the official product_expiry module', 'author': 'Akretion,Jarsa Sistemas,Odoo Community Association (OCA)', + 'maintainers': ['alexis-via'], 'website': 'http://www.akretion.com', 'depends': [ 'stock', From 7059ef1bf4f8c48cb003afc0610354b6cc4badb1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 4 Jun 2020 18:59:41 +0200 Subject: [PATCH 16/21] Upport fix for bug #548 to v12 Fix bad decorator --- product_expiry_simple/models/stock_move_line.py | 5 ++--- product_expiry_simple/views/stock_picking.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/product_expiry_simple/models/stock_move_line.py b/product_expiry_simple/models/stock_move_line.py index b0f52f5d8db1..6b72e3e175ab 100644 --- a/product_expiry_simple/models/stock_move_line.py +++ b/product_expiry_simple/models/stock_move_line.py @@ -3,7 +3,7 @@ # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import fields, models class StockMoveLine(models.Model): @@ -11,10 +11,9 @@ class StockMoveLine(models.Model): expiry_date = fields.Date(string='Expiry Date') - @api.model def _action_done(self): super()._action_done() - for rec in self: + for rec in self.filtered(lambda m: m.exists()): pick_type = rec.move_id.picking_type_id if ( pick_type.use_create_lots and diff --git a/product_expiry_simple/views/stock_picking.xml b/product_expiry_simple/views/stock_picking.xml index f86127928298..199c0357cd0c 100644 --- a/product_expiry_simple/views/stock_picking.xml +++ b/product_expiry_simple/views/stock_picking.xml @@ -6,7 +6,7 @@ - + From 9516b9aacc2512f15a27322e4a6486c7b959bccd Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 26 Nov 2021 09:01:11 +0100 Subject: [PATCH 17/21] [MIG] product_expiry_simple from v12 to v14 --- product_expiry_simple/__manifest__.py | 13 +- .../models/stock_move_line.py | 24 ++-- .../models/stock_production_lot.py | 4 +- product_expiry_simple/models/stock_quant.py | 4 +- product_expiry_simple/readme/DESCRIPTION.rst | 9 +- product_expiry_simple/views/stock.xml | 122 ------------------ .../views/stock_move_line.xml | 24 ++++ product_expiry_simple/views/stock_picking.xml | 23 ---- .../views/stock_production_lot.xml | 51 ++++++++ product_expiry_simple/views/stock_quant.xml | 73 +++++++++++ 10 files changed, 176 insertions(+), 171 deletions(-) delete mode 100644 product_expiry_simple/views/stock.xml create mode 100644 product_expiry_simple/views/stock_move_line.xml delete mode 100644 product_expiry_simple/views/stock_picking.xml create mode 100644 product_expiry_simple/views/stock_production_lot.xml create mode 100644 product_expiry_simple/views/stock_quant.xml diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py index 56a1a67afff5..1b98a7530053 100644 --- a/product_expiry_simple/__manifest__.py +++ b/product_expiry_simple/__manifest__.py @@ -1,18 +1,18 @@ -# Copyright 2017-2019 Akretion France (http://www.akretion.com/) -# Copyright 2018-2019 Jarsa Sistemas (Alan Ramos ) +# Copyright 2017-2021 Akretion France (http://www.akretion.com/) +# Copyright 2018-2021 Jarsa Sistemas (Alan Ramos ) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Product Expiry Simple', - 'version': '12.0.1.0.0', + 'version': '14.0.1.0.0', 'category': 'Product', 'license': 'AGPL-3', 'summary': 'Simpler and better alternative to the official product_expiry module', 'author': 'Akretion,Jarsa Sistemas,Odoo Community Association (OCA)', 'maintainers': ['alexis-via'], - 'website': 'http://www.akretion.com', + 'website': 'http://github.com/OCA/stock-logistics-workflow', 'depends': [ 'stock', ], @@ -20,9 +20,10 @@ 'product_expiry' ], 'data': [ - 'views/stock.xml', 'data/product_removal.xml', - 'views/stock_picking.xml', + 'views/stock_production_lot.xml', + 'views/stock_quant.xml', + 'views/stock_move_line.xml', ], 'installable': True, } diff --git a/product_expiry_simple/models/stock_move_line.py b/product_expiry_simple/models/stock_move_line.py index 6b72e3e175ab..28066826a874 100644 --- a/product_expiry_simple/models/stock_move_line.py +++ b/product_expiry_simple/models/stock_move_line.py @@ -1,5 +1,5 @@ -# Copyright 2017-2019 Akretion France (http://www.akretion.com/) -# Copyright 2018-2019 Jarsa Sistemas (Sarai Osorio ) +# Copyright 2017-2021 Akretion France (http://www.akretion.com/) +# Copyright 2018-2021 Jarsa Sistemas (Sarai Osorio ) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -11,12 +11,14 @@ class StockMoveLine(models.Model): expiry_date = fields.Date(string='Expiry Date') - def _action_done(self): - super()._action_done() - for rec in self.filtered(lambda m: m.exists()): - pick_type = rec.move_id.picking_type_id - if ( - pick_type.use_create_lots and - not pick_type.use_existing_lots and - rec.lot_id): - rec.lot_id.write({'expiry_date': rec.expiry_date}) + # When you read the code of _create_and_assign_production_lot() + # you need the defects of that method: + # 1. it's not possible to inherit the creation of the lot + # 2. it creates one lot per company/product/lot_name + # On that second point, we can consider that, for a particular product, + # lot X will always have the same expiry_date + + def _assign_production_lot(self, lot): + super()._assign_production_lot(lot) + if self[0].expiry_date: + self.lot_id.write({'expiry_date': self[0].expiry_date}) diff --git a/product_expiry_simple/models/stock_production_lot.py b/product_expiry_simple/models/stock_production_lot.py index 795383912615..061bad9b0a6e 100644 --- a/product_expiry_simple/models/stock_production_lot.py +++ b/product_expiry_simple/models/stock_production_lot.py @@ -1,5 +1,5 @@ -# Copyright 2017-2019 Akretion France (http://www.akretion.com/) -# Copyright 2018 Jarsa Sistemas (Alan Ramos ) +# Copyright 2017-2021 Akretion France (http://www.akretion.com/) +# Copyright 2018-2021 Jarsa Sistemas (Alan Ramos ) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/product_expiry_simple/models/stock_quant.py b/product_expiry_simple/models/stock_quant.py index 6ba269db25af..43a2169b7e89 100644 --- a/product_expiry_simple/models/stock_quant.py +++ b/product_expiry_simple/models/stock_quant.py @@ -1,5 +1,5 @@ -# Copyright 2017-2019 Akretion France (http://www.akretion.com/) -# Copyright 2018-2019 Jarsa Sistemas (Alan Ramos ) +# Copyright 2017-2021 Akretion France (http://www.akretion.com/) +# Copyright 2018-2021 Jarsa Sistemas (Alan Ramos ) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/product_expiry_simple/readme/DESCRIPTION.rst b/product_expiry_simple/readme/DESCRIPTION.rst index 207085772c64..d7b8127478a7 100644 --- a/product_expiry_simple/readme/DESCRIPTION.rst +++ b/product_expiry_simple/readme/DESCRIPTION.rst @@ -1,9 +1,8 @@ -This module is similar to the official `product_expiry `_ module that adds support for *Expiry Dates* on products, but it is both simpler and better: +This module is similar to the official `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. +* 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). diff --git a/product_expiry_simple/views/stock.xml b/product_expiry_simple/views/stock.xml deleted file mode 100644 index e2b17ea9059a..000000000000 --- a/product_expiry_simple/views/stock.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - product_expiry_simple.stock.production.lot.form - stock.production.lot - - - - - - - - - Expired - - - - - - product_expiry_simple.stock.production.lot.form_simple - stock.production.lot - - - - - - - - - Expired - - - - - - - product_expiry_simple.stock.production.lot.tree - stock.production.lot - - - - - - - expiry_date and expiry_date < current_date - expiry_date and expiry_date >= current_date - - - - - product_expiry_simple.stock.production.lot.search - stock.production.lot - - - - - - - - - - - - - - - product_expiry_simple.stock.quant.form - stock.quant - - - - - - Expired - - - - - - product_expiry_simple.stock.quant.tree - stock.quant - - - - - - - - expiry_date and expiry_date < current_date - expiry_date and expiry_date >= current_date - - - - - product_expiry_simple.stock.quant.search - stock.quant - - - - - - - - - - - - - diff --git a/product_expiry_simple/views/stock_move_line.xml b/product_expiry_simple/views/stock_move_line.xml new file mode 100644 index 000000000000..33ae1aabdd68 --- /dev/null +++ b/product_expiry_simple/views/stock_move_line.xml @@ -0,0 +1,24 @@ + + + + product_expiry_simple.stock.move.line.tree + stock.move.line + + + + + + + + + product_expiry_simple.stock.move.line.tree + stock.move.line + + + + + + + + + diff --git a/product_expiry_simple/views/stock_picking.xml b/product_expiry_simple/views/stock_picking.xml deleted file mode 100644 index 199c0357cd0c..000000000000 --- a/product_expiry_simple/views/stock_picking.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - product_expiry_simple.stock.picking.tree - stock.picking - - - - - - - - - product_expiry_simple.stock.move.line.tree - stock.move.line - - - - - - - - diff --git a/product_expiry_simple/views/stock_production_lot.xml b/product_expiry_simple/views/stock_production_lot.xml new file mode 100644 index 000000000000..685e0655415a --- /dev/null +++ b/product_expiry_simple/views/stock_production_lot.xml @@ -0,0 +1,51 @@ + + + + + product_expiry_simple.stock.production.lot.form + stock.production.lot + + + + + + + + Expired + + + + + + product_expiry_simple.stock.production.lot.tree + stock.production.lot + + + + + + + expiry_date and expiry_date < current_date + + + + + product_expiry_simple.stock.production.lot.search + stock.production.lot + + + + + + + + + + + + + diff --git a/product_expiry_simple/views/stock_quant.xml b/product_expiry_simple/views/stock_quant.xml new file mode 100644 index 000000000000..a3030507e462 --- /dev/null +++ b/product_expiry_simple/views/stock_quant.xml @@ -0,0 +1,73 @@ + + + + + product_expiry_simple.stock.quant.form + stock.quant + + + + + + Expired + + + + + + product_expiry_simple.stock.quant.tree + stock.quant + + + + + + + + + expiry_date and expiry_date < current_date + + + + + product_expiry_simple.stock.quant.tree.editable + stock.quant + + + + + + + + expiry_date and expiry_date < current_date + + + + + + product_expiry_simple.stock.quant.search + stock.quant + + + + + + + + + + + + + From 50a3a5df2e8ff7d584b4ddf13989622ddd2982a4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 26 Nov 2021 09:06:55 +0100 Subject: [PATCH 18/21] product_expiry_simple: black, isort, etc... Travis: exclude the module because it conflicts with product_expiry --- product_expiry_simple/__manifest__.py | 37 ++++++------- .../models/stock_move_line.py | 6 +-- .../models/stock_production_lot.py | 14 ++--- product_expiry_simple/models/stock_quant.py | 10 ++-- .../views/stock_move_line.xml | 22 ++++++-- .../views/stock_production_lot.xml | 43 ++++++++++----- product_expiry_simple/views/stock_quant.xml | 52 +++++++++++++------ .../odoo/addons/product_expiry_simple | 1 + setup/product_expiry_simple/setup.py | 6 +++ 9 files changed, 123 insertions(+), 68 deletions(-) create mode 120000 setup/product_expiry_simple/odoo/addons/product_expiry_simple create mode 100644 setup/product_expiry_simple/setup.py diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py index 1b98a7530053..c7b07d5e1a19 100644 --- a/product_expiry_simple/__manifest__.py +++ b/product_expiry_simple/__manifest__.py @@ -4,26 +4,23 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Product Expiry Simple', - 'version': '14.0.1.0.0', - 'category': 'Product', - 'license': 'AGPL-3', - 'summary': - 'Simpler and better alternative to the official product_expiry module', - 'author': 'Akretion,Jarsa Sistemas,Odoo Community Association (OCA)', - 'maintainers': ['alexis-via'], - 'website': 'http://github.com/OCA/stock-logistics-workflow', - 'depends': [ - 'stock', + "name": "Product Expiry Simple", + "version": "14.0.1.0.0", + "category": "Product", + "license": "AGPL-3", + "summary": "Simpler and better alternative to the official product_expiry module", + "author": "Akretion,Jarsa Sistemas,Odoo Community Association (OCA)", + "maintainers": ["alexis-via"], + "website": "https://github.com/OCA/stock-logistics-workflow", + "depends": [ + "stock", ], - 'excludes': [ - 'product_expiry' + "excludes": ["product_expiry"], + "data": [ + "data/product_removal.xml", + "views/stock_production_lot.xml", + "views/stock_quant.xml", + "views/stock_move_line.xml", ], - 'data': [ - 'data/product_removal.xml', - 'views/stock_production_lot.xml', - 'views/stock_quant.xml', - 'views/stock_move_line.xml', - ], - 'installable': True, + "installable": True, } diff --git a/product_expiry_simple/models/stock_move_line.py b/product_expiry_simple/models/stock_move_line.py index 28066826a874..d208c8801792 100644 --- a/product_expiry_simple/models/stock_move_line.py +++ b/product_expiry_simple/models/stock_move_line.py @@ -7,9 +7,9 @@ class StockMoveLine(models.Model): - _inherit = 'stock.move.line' + _inherit = "stock.move.line" - expiry_date = fields.Date(string='Expiry Date') + expiry_date = fields.Date(string="Expiry Date") # When you read the code of _create_and_assign_production_lot() # you need the defects of that method: @@ -21,4 +21,4 @@ class StockMoveLine(models.Model): def _assign_production_lot(self, lot): super()._assign_production_lot(lot) if self[0].expiry_date: - self.lot_id.write({'expiry_date': self[0].expiry_date}) + self.lot_id.write({"expiry_date": self[0].expiry_date}) diff --git a/product_expiry_simple/models/stock_production_lot.py b/product_expiry_simple/models/stock_production_lot.py index 061bad9b0a6e..f6ab6f00eb09 100644 --- a/product_expiry_simple/models/stock_production_lot.py +++ b/product_expiry_simple/models/stock_production_lot.py @@ -3,14 +3,14 @@ # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import _, api, fields, models class StockProductionLot(models.Model): - _inherit = 'stock.production.lot' + _inherit = "stock.production.lot" - expiry_date = fields.Date(string='Expiry Date') - expired = fields.Boolean(compute='_compute_expired') + expiry_date = fields.Date(string="Expiry Date") + expired = fields.Boolean(compute="_compute_expired") def _compute_expired(self): today = fields.Date.context_today(self) @@ -20,7 +20,7 @@ def _compute_expired(self): expired = True lot.expired = expired - @api.depends('name', 'expiry_date') + @api.depends("name", "expiry_date") def name_get(self): res = [] today = fields.Date.context_today(self) @@ -28,8 +28,8 @@ def name_get(self): dname = lot.name if lot.expiry_date: if lot.expiry_date < today: - dname = _('[%s Expired] %s') % (lot.expiry_date, dname) + dname = _("[%s Expired] %s") % (lot.expiry_date, dname) else: - dname = '[%s] %s' % (lot.expiry_date, dname) + dname = "[%s] %s" % (lot.expiry_date, dname) res.append((lot.id, dname)) return res diff --git a/product_expiry_simple/models/stock_quant.py b/product_expiry_simple/models/stock_quant.py index 43a2169b7e89..0274b7240d8e 100644 --- a/product_expiry_simple/models/stock_quant.py +++ b/product_expiry_simple/models/stock_quant.py @@ -7,15 +7,15 @@ class StockQuant(models.Model): - _inherit = 'stock.quant' + _inherit = "stock.quant" - expiry_date = fields.Date(related='lot_id.expiry_date', store=True) - expired = fields.Boolean(related='lot_id.expired') + expiry_date = fields.Date(related="lot_id.expiry_date", store=True) + expired = fields.Boolean(related="lot_id.expired") # method copy/pasted from the official product_expiry module # Copyright Odoo SA @api.model def _get_removal_strategy_order(self, removal_strategy): - if removal_strategy == 'fefo': - return 'expiry_date, in_date, id' + if removal_strategy == "fefo": + return "expiry_date, in_date, id" return super()._get_removal_strategy_order(removal_strategy) diff --git a/product_expiry_simple/views/stock_move_line.xml b/product_expiry_simple/views/stock_move_line.xml index 33ae1aabdd68..56f3f8f87ff1 100644 --- a/product_expiry_simple/views/stock_move_line.xml +++ b/product_expiry_simple/views/stock_move_line.xml @@ -1,22 +1,34 @@ - + product_expiry_simple.stock.move.line.tree stock.move.line - + - + product_expiry_simple.stock.move.line.tree stock.move.line - + - + diff --git a/product_expiry_simple/views/stock_production_lot.xml b/product_expiry_simple/views/stock_production_lot.xml index 685e0655415a..b0f6aef2ce94 100644 --- a/product_expiry_simple/views/stock_production_lot.xml +++ b/product_expiry_simple/views/stock_production_lot.xml @@ -1,4 +1,4 @@ - + - - Expired + + Expired @@ -23,34 +26,38 @@ product_expiry_simple.stock.quant.tree stock.quant - + - + - expiry_date and expiry_date < current_date + expiry_date and expiry_date < current_date product_expiry_simple.stock.quant.tree.editable stock.quant - + - + - expiry_date and expiry_date < current_date + expiry_date and expiry_date < current_date @@ -58,15 +65,30 @@ product_expiry_simple.stock.quant.search stock.quant - + - - - + + + - + diff --git a/setup/product_expiry_simple/odoo/addons/product_expiry_simple b/setup/product_expiry_simple/odoo/addons/product_expiry_simple new file mode 120000 index 000000000000..edd445bc8233 --- /dev/null +++ b/setup/product_expiry_simple/odoo/addons/product_expiry_simple @@ -0,0 +1 @@ +../../../../product_expiry_simple \ No newline at end of file diff --git a/setup/product_expiry_simple/setup.py b/setup/product_expiry_simple/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/product_expiry_simple/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From a162dcab951234949b3a6313f2ee5ff617127a34 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 14 Feb 2022 11:52:18 +0100 Subject: [PATCH 19/21] product_expiry_simple: use format_date to show date in lot display_name --- product_expiry_simple/models/stock_production_lot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/product_expiry_simple/models/stock_production_lot.py b/product_expiry_simple/models/stock_production_lot.py index f6ab6f00eb09..70666c209d11 100644 --- a/product_expiry_simple/models/stock_production_lot.py +++ b/product_expiry_simple/models/stock_production_lot.py @@ -4,6 +4,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, fields, models +from odoo.tools.misc import format_date class StockProductionLot(models.Model): @@ -27,9 +28,10 @@ def name_get(self): for lot in self: dname = lot.name if lot.expiry_date: + expiry_date_print = format_date(self.env, lot.expiry_date) if lot.expiry_date < today: - dname = _("[%s Expired] %s") % (lot.expiry_date, dname) + dname = _("[%s Expired] %s") % (expiry_date_print, dname) else: - dname = "[%s] %s" % (lot.expiry_date, dname) + dname = "[%s] %s" % (expiry_date_print, dname) res.append((lot.id, dname)) return res From 4da9160f6450dfca4619f63e0ac087f840f2abce Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 18 Oct 2022 19:26:53 +0200 Subject: [PATCH 20/21] product_expiry_simple: add warning banner on picking --- product_expiry_simple/__manifest__.py | 1 + product_expiry_simple/models/__init__.py | 1 + product_expiry_simple/models/stock_picking.py | 31 +++++++++++++++++++ product_expiry_simple/views/stock_picking.xml | 24 ++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 product_expiry_simple/models/stock_picking.py create mode 100644 product_expiry_simple/views/stock_picking.xml diff --git a/product_expiry_simple/__manifest__.py b/product_expiry_simple/__manifest__.py index c7b07d5e1a19..a215556223b0 100644 --- a/product_expiry_simple/__manifest__.py +++ b/product_expiry_simple/__manifest__.py @@ -21,6 +21,7 @@ "views/stock_production_lot.xml", "views/stock_quant.xml", "views/stock_move_line.xml", + "views/stock_picking.xml", ], "installable": True, } diff --git a/product_expiry_simple/models/__init__.py b/product_expiry_simple/models/__init__.py index 169128dfeabc..0414e2123644 100644 --- a/product_expiry_simple/models/__init__.py +++ b/product_expiry_simple/models/__init__.py @@ -1,3 +1,4 @@ from . import stock_production_lot from . import stock_quant from . import stock_move_line +from . import stock_picking diff --git a/product_expiry_simple/models/stock_picking.py b/product_expiry_simple/models/stock_picking.py new file mode 100644 index 000000000000..d14ce4de5886 --- /dev/null +++ b/product_expiry_simple/models/stock_picking.py @@ -0,0 +1,31 @@ +# Copyright 2022 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class StockPicking(models.Model): + _inherit = 'stock.picking' + + show_expiry_warning = fields.Boolean(compute='_compute_show_expiry_warning') + + @api.depends( + 'state', + 'move_line_ids_without_package.lot_id.expiry_date', + 'move_line_ids_without_package.expiry_date') + def _compute_show_expiry_warning(self): + today = fields.Date.context_today(self) + for picking in self: + show = False + if picking.state in ('confirmed', 'assigned'): + for mline in picking.move_line_ids_without_package: + if mline.lot_id: + if mline.lot_id.expiry_date and mline.lot_id.expiry_date < today: + show = True + break + elif mline.lot_name: + if mline.expiry_date and mline.expiry_date < today: + show = True + break + picking.show_expiry_warning = show diff --git a/product_expiry_simple/views/stock_picking.xml b/product_expiry_simple/views/stock_picking.xml new file mode 100644 index 000000000000..afe9e372f32c --- /dev/null +++ b/product_expiry_simple/views/stock_picking.xml @@ -0,0 +1,24 @@ + + + + + + stock.picking + + + + + + + + + + + From 51ee61ca11e0455d1061421a8cef85c277761d0f Mon Sep 17 00:00:00 2001 From: David Beal Date: Fri, 7 Apr 2023 10:49:55 +0200 Subject: [PATCH 21/21] FIX product_expiry_simple: pre-commit & copier stuff --- .copier-answers.yml | 6 ++++-- .github/workflows/test.yml | 19 +++++++++++++++++++ README.md | 2 +- product_expiry_simple/models/stock_picking.py | 18 +++++++++++------- product_expiry_simple/views/stock_picking.xml | 14 ++++++++------ 5 files changed, 43 insertions(+), 16 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 912a05d44ed6..23134dcde81f 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -14,8 +14,10 @@ include_wkhtmltopdf: false odoo_version: 14.0 org_name: Odoo Community Association (OCA) org_slug: OCA -rebel_module_groups: [] -repo_description: 'TODO: add repo description.' +rebel_module_groups: +- product_expiry_simple +- stock_mass_scrap,stock_move_quick_lot +repo_description: Odoo Stock, Workflow and Organization repo_name: stock-logistics-workflow repo_slug: stock-logistics-workflow repo_website: https://github.com/OCA/stock-logistics-workflow diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 215b84b0f859..9637f633c538 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,9 +36,25 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + include: "product_expiry_simple" makepot: "true" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + include: "product_expiry_simple" + name: test with OCB + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + include: "stock_mass_scrap,stock_move_quick_lot" + makepot: "true" + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + include: "stock_mass_scrap,stock_move_quick_lot" + name: test with OCB + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + exclude: "product_expiry_simple,stock_mass_scrap,stock_move_quick_lot" + makepot: "true" + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + exclude: "product_expiry_simple,stock_mass_scrap,stock_move_quick_lot" name: test with OCB services: postgres: @@ -49,6 +65,9 @@ jobs: POSTGRES_DB: odoo ports: - 5432:5432 + env: + INCLUDE: "${{ matrix.include }}" + EXCLUDE: "${{ matrix.exclude }}" steps: - uses: actions/checkout@v2 with: diff --git a/README.md b/README.md index b6784be3300e..9c3f778e881f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ # stock-logistics-workflow -TODO: add repo description. +Odoo Stock, Workflow and Organization diff --git a/product_expiry_simple/models/stock_picking.py b/product_expiry_simple/models/stock_picking.py index d14ce4de5886..cfb163c2ffd4 100644 --- a/product_expiry_simple/models/stock_picking.py +++ b/product_expiry_simple/models/stock_picking.py @@ -6,22 +6,26 @@ class StockPicking(models.Model): - _inherit = 'stock.picking' + _inherit = "stock.picking" - show_expiry_warning = fields.Boolean(compute='_compute_show_expiry_warning') + show_expiry_warning = fields.Boolean(compute="_compute_show_expiry_warning") @api.depends( - 'state', - 'move_line_ids_without_package.lot_id.expiry_date', - 'move_line_ids_without_package.expiry_date') + "state", + "move_line_ids_without_package.lot_id.expiry_date", + "move_line_ids_without_package.expiry_date", + ) def _compute_show_expiry_warning(self): today = fields.Date.context_today(self) for picking in self: show = False - if picking.state in ('confirmed', 'assigned'): + if picking.state in ("confirmed", "assigned"): for mline in picking.move_line_ids_without_package: if mline.lot_id: - if mline.lot_id.expiry_date and mline.lot_id.expiry_date < today: + if ( + mline.lot_id.expiry_date + and mline.lot_id.expiry_date < today + ): show = True break elif mline.lot_name: diff --git a/product_expiry_simple/views/stock_picking.xml b/product_expiry_simple/views/stock_picking.xml index afe9e372f32c..856298f0ad37 100644 --- a/product_expiry_simple/views/stock_picking.xml +++ b/product_expiry_simple/views/stock_picking.xml @@ -1,21 +1,23 @@ - + - stock.picking - + - + -