From fe6e6e43c10e93dfe72bc6d513655db55162a08a Mon Sep 17 00:00:00 2001 From: "nel@tinyerp.com" <> Date: Mon, 14 Jun 2010 13:29:30 +0200 Subject: [PATCH] [ADD] product_expiry bzr revid: nel@tinyerp.com-20100614112930-nsefgdaw3cety5a6 --- addons/product_expiry/__init__.py | 25 +++ addons/product_expiry/__terp__.py | 39 ++++ addons/product_expiry/i18n/ca.po | 180 ++++++++++++++++++ addons/product_expiry/i18n/es.po | 180 ++++++++++++++++++ addons/product_expiry/i18n/fr.po | 178 +++++++++++++++++ addons/product_expiry/i18n/fr_FR.po | 159 ++++++++++++++++ addons/product_expiry/i18n/product_expiry.pot | 154 +++++++++++++++ addons/product_expiry/product_expiry.py | 79 ++++++++ addons/product_expiry/product_expiry_demo.xml | 128 +++++++++++++ addons/product_expiry/product_expiry_view.xml | 39 ++++ addons/product_expiry/report/__init__.py | 25 +++ addons/product_expiry/report/report_stock.py | 121 ++++++++++++ .../report/report_stock_view.xml | 103 ++++++++++ addons/product_expiry/wizard/__init__.py | 1 + addons/product_expiry/wizard/stock_partial.py | 64 +++++++ 15 files changed, 1475 insertions(+) create mode 100644 addons/product_expiry/__init__.py create mode 100644 addons/product_expiry/__terp__.py create mode 100644 addons/product_expiry/i18n/ca.po create mode 100644 addons/product_expiry/i18n/es.po create mode 100644 addons/product_expiry/i18n/fr.po create mode 100644 addons/product_expiry/i18n/fr_FR.po create mode 100644 addons/product_expiry/i18n/product_expiry.pot create mode 100644 addons/product_expiry/product_expiry.py create mode 100644 addons/product_expiry/product_expiry_demo.xml create mode 100644 addons/product_expiry/product_expiry_view.xml create mode 100644 addons/product_expiry/report/__init__.py create mode 100644 addons/product_expiry/report/report_stock.py create mode 100644 addons/product_expiry/report/report_stock_view.xml create mode 100644 addons/product_expiry/wizard/__init__.py create mode 100644 addons/product_expiry/wizard/stock_partial.py diff --git a/addons/product_expiry/__init__.py b/addons/product_expiry/__init__.py new file mode 100644 index 00000000000..3b5500415c2 --- /dev/null +++ b/addons/product_expiry/__init__.py @@ -0,0 +1,25 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import product_expiry +import wizard +import report +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product_expiry/__terp__.py b/addons/product_expiry/__terp__.py new file mode 100644 index 00000000000..1983088a484 --- /dev/null +++ b/addons/product_expiry/__terp__.py @@ -0,0 +1,39 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name" : "Products date of expiry", + "version" : "1.0", + "author" : "Tiny", + "category" : "Enterprise Specific Modules/Food Industries", + "depends" : ["base", "account", "product", "stock"], + "init_xml" : [], + "demo_xml" : ["product_expiry_demo.xml"], + "description": '''Track different dates on products and production lots: + - end of life + - best before date + - removal date + - alert date +Used, for example, in food industries.''', + "update_xml" : ["product_expiry_view.xml", "report/report_stock_view.xml"], + "active": False, + "installable": True +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product_expiry/i18n/ca.po b/addons/product_expiry/i18n/ca.po new file mode 100644 index 00000000000..3bffba540b9 --- /dev/null +++ b/addons/product_expiry/i18n/ca.po @@ -0,0 +1,180 @@ +# Catalan translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-06-30 15:09+0000\n" +"PO-Revision-Date: 2010-01-10 22:56+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: product_expiry +#: field:product.product,life_time:0 +msgid "Product lifetime" +msgstr "Cicle de vida producte" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_from_product_template +msgid "Ham" +msgstr "Pernil" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_lait_product_template +msgid "Cow milk" +msgstr "Llet de vaca" + +#. module: product_expiry +#: model:ir.module.module,shortdesc:product_expiry.module_meta_information +msgid "Products date of expiry" +msgstr "Data de caducitat de productes" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "" +"Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" +"Error: La UdM per defecte i la UdM de compra han d'estar en la mateixa " +"categoria." + +#. module: product_expiry +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML no vàlid per a la definició de la vista!" + +#. module: product_expiry +#: help:stock.production.lot,life_date:0 +msgid "The date the lot may become dangerous and should not be consumed." +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,removal_date:0 +msgid "Removal Date" +msgstr "" + +#. module: product_expiry +#: model:ir.module.module,description:product_expiry.module_meta_information +msgid "" +"Track different dates on products and production lots:\n" +" - end of life\n" +" - best before date\n" +" - removal date\n" +" - alert date\n" +"Used, for example, in food industries." +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_pain_product_template +msgid "Bread" +msgstr "Pa" + +#. module: product_expiry +#: model:product.uom,name:product_expiry.product_uom_ltr +#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol +msgid "LTR" +msgstr "" + +#. module: product_expiry +#: view:product.product:0 +#: view:stock.production.lot:0 +msgid "Dates" +msgstr "Dates" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "Error: UOS must be in a different category than the UOM" +msgstr "Error: La UdV ha d'estar en una categoria diferent que la UdM." + +#. module: product_expiry +#: field:stock.production.lot,life_date:0 +msgid "End of Life Date" +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,use_date:0 +msgid "Best before Date" +msgstr "" + +#. module: product_expiry +#: help:stock.production.lot,use_date:0 +msgid "The date the lot starts deteriorating without becoming dangerous." +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_jambon_product_template +msgid "French cheese Camenbert" +msgstr "Formatge Camembert francès" + +#. module: product_expiry +#: help:product.product,removal_time:0 +msgid "The number of days before a production lot should be removed." +msgstr "" + +#. module: product_expiry +#: field:product.product,use_time:0 +msgid "Product usetime" +msgstr "Temps d'ús producte" + +#. module: product_expiry +#: field:stock.production.lot,alert_date:0 +msgid "Alert Date" +msgstr "" + +#. module: product_expiry +#: field:product.product,removal_time:0 +msgid "Product removal time" +msgstr "Data eliminació producte" + +#. module: product_expiry +#: help:product.product,use_time:0 +msgid "" +"The number of days before a production lot starts deteriorating without " +"becoming dangerous." +msgstr "" + +#. module: product_expiry +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Error: Codi EAN erroni" + +#. module: product_expiry +#: help:product.product,life_time:0 +msgid "" +"The number of days before a production lot may become dangerous and should " +"not be consumed." +msgstr "" + +#. module: product_expiry +#: help:stock.production.lot,removal_date:0 +msgid "The date the lot should be removed." +msgstr "" + +#. module: product_expiry +#: field:product.product,alert_time:0 +msgid "Product alert time" +msgstr "Data alerta producte" + +#~ msgid "Alert date" +#~ msgstr "Data alarma" + +#~ msgid "" +#~ "Track different dates on products and lots. Used, for exampel, in food " +#~ "industries: expiry date, alert date, date of removal, eso." +#~ msgstr "" +#~ "Gestiona diferents dates per a productes i lots. Utilitzat, per exemple, en " +#~ "la indústria alimentària: Data de caducitat, data d'alarma, data " +#~ "d'eliminació, ..." + +#~ msgid "DLUO" +#~ msgstr "Data caducitat" + +#~ msgid "Removal date" +#~ msgstr "Data eliminació" diff --git a/addons/product_expiry/i18n/es.po b/addons/product_expiry/i18n/es.po new file mode 100644 index 00000000000..c0b8140f48b --- /dev/null +++ b/addons/product_expiry/i18n/es.po @@ -0,0 +1,180 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-06-30 15:09+0000\n" +"PO-Revision-Date: 2010-04-29 04:43+0000\n" +"Last-Translator: Rhubeni Lopes de Andrade \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: product_expiry +#: field:product.product,life_time:0 +msgid "Product lifetime" +msgstr "Ciclo de vida producto" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_from_product_template +msgid "Ham" +msgstr "Jamón" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_lait_product_template +msgid "Cow milk" +msgstr "Leche de vaca" + +#. module: product_expiry +#: model:ir.module.module,shortdesc:product_expiry.module_meta_information +msgid "Products date of expiry" +msgstr "Fecha de caducidad de productos" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "" +"Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" +"Error: La UdM por defecto y la UdM de compra deben estar en la misma " +"categoría." + +#. module: product_expiry +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "¡XML no válido para la definición de la vista!" + +#. module: product_expiry +#: help:stock.production.lot,life_date:0 +msgid "The date the lot may become dangerous and should not be consumed." +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,removal_date:0 +msgid "Removal Date" +msgstr "" + +#. module: product_expiry +#: model:ir.module.module,description:product_expiry.module_meta_information +msgid "" +"Track different dates on products and production lots:\n" +" - end of life\n" +" - best before date\n" +" - removal date\n" +" - alert date\n" +"Used, for example, in food industries." +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_pain_product_template +msgid "Bread" +msgstr "Pan" + +#. module: product_expiry +#: model:product.uom,name:product_expiry.product_uom_ltr +#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol +msgid "LTR" +msgstr "LTR" + +#. module: product_expiry +#: view:product.product:0 +#: view:stock.production.lot:0 +msgid "Dates" +msgstr "Fechas" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "Error: UOS must be in a different category than the UOM" +msgstr "Error: La UdV debe estar en una categoría diferente que la UdM." + +#. module: product_expiry +#: field:stock.production.lot,life_date:0 +msgid "End of Life Date" +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,use_date:0 +msgid "Best before Date" +msgstr "" + +#. module: product_expiry +#: help:stock.production.lot,use_date:0 +msgid "The date the lot starts deteriorating without becoming dangerous." +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_jambon_product_template +msgid "French cheese Camenbert" +msgstr "Queso Camembert francés" + +#. module: product_expiry +#: help:product.product,removal_time:0 +msgid "The number of days before a production lot should be removed." +msgstr "" + +#. module: product_expiry +#: field:product.product,use_time:0 +msgid "Product usetime" +msgstr "Tiempo de uso producto" + +#. module: product_expiry +#: field:stock.production.lot,alert_date:0 +msgid "Alert Date" +msgstr "" + +#. module: product_expiry +#: field:product.product,removal_time:0 +msgid "Product removal time" +msgstr "Fecha eliminación producto" + +#. module: product_expiry +#: help:product.product,use_time:0 +msgid "" +"The number of days before a production lot starts deteriorating without " +"becoming dangerous." +msgstr "" + +#. module: product_expiry +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Error: Código EAN erróneo" + +#. module: product_expiry +#: help:product.product,life_time:0 +msgid "" +"The number of days before a production lot may become dangerous and should " +"not be consumed." +msgstr "" + +#. module: product_expiry +#: help:stock.production.lot,removal_date:0 +msgid "The date the lot should be removed." +msgstr "" + +#. module: product_expiry +#: field:product.product,alert_time:0 +msgid "Product alert time" +msgstr "Fecha alerta producto" + +#~ msgid "Alert date" +#~ msgstr "Fecha alarma" + +#~ msgid "" +#~ "Track different dates on products and lots. Used, for exampel, in food " +#~ "industries: expiry date, alert date, date of removal, eso." +#~ msgstr "" +#~ "Gestiona distintas fechas para productos y lotes. Utilizado, por ejemplo, en " +#~ "industria alimentaria: Fecha de caducidad, fecha de alarma, fecha de " +#~ "eliminación, ..." + +#~ msgid "DLUO" +#~ msgstr "Fecha caducidad" + +#~ msgid "Removal date" +#~ msgstr "Fecha eliminación" diff --git a/addons/product_expiry/i18n/fr.po b/addons/product_expiry/i18n/fr.po new file mode 100644 index 00000000000..27fa25095b2 --- /dev/null +++ b/addons/product_expiry/i18n/fr.po @@ -0,0 +1,178 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_expiry +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-06-30 15:09+0000\n" +"PO-Revision-Date: 2010-01-04 18:19+0000\n" +"Last-Translator: Fabien (Open ERP) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: product_expiry +#: field:product.product,life_time:0 +msgid "Product lifetime" +msgstr "Durée limite de consommation" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_from_product_template +msgid "Ham" +msgstr "Jambon" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_lait_product_template +msgid "Cow milk" +msgstr "Lait de vache" + +#. module: product_expiry +#: model:ir.module.module,shortdesc:product_expiry.module_meta_information +msgid "Products date of expiry" +msgstr "Dates de péremption des produits" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "" +"Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" +"Erreur: l'unité de mesure par défaut et l'unité de mesure d'achat doivent " +"faire partie de la même catégorie" + +#. module: product_expiry +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML non valide pour l'architecture de la vue" + +#. module: product_expiry +#: help:stock.production.lot,life_date:0 +msgid "The date the lot may become dangerous and should not be consumed." +msgstr "" +"La date à laquelle le lot peut devenir dangereux et ne doit plus être " +"consommé." + +#. module: product_expiry +#: field:stock.production.lot,removal_date:0 +msgid "Removal Date" +msgstr "Date de retrait" + +#. module: product_expiry +#: model:ir.module.module,description:product_expiry.module_meta_information +msgid "" +"Track different dates on products and production lots:\n" +" - end of life\n" +" - best before date\n" +" - removal date\n" +" - alert date\n" +"Used, for example, in food industries." +msgstr "" +"Suit les différentes dates des produits et des lots de production\n" +" - Date limite de consommation\n" +" - DLUO\n" +" - Date de retrait\n" +" - Date d'alerte\n" +"Utilisé par exemple dans les industries alimentaires" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_pain_product_template +msgid "Bread" +msgstr "Pain" + +#. module: product_expiry +#: model:product.uom,name:product_expiry.product_uom_ltr +#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol +msgid "LTR" +msgstr "LTR" + +#. module: product_expiry +#: view:product.product:0 +#: view:stock.production.lot:0 +msgid "Dates" +msgstr "Dates" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "Error: UOS must be in a different category than the UOM" +msgstr "" +"Erreur: l'unité de vente doit appartenir à une catégorie différente que " +"l'unité de mesure" + +#. module: product_expiry +#: field:stock.production.lot,life_date:0 +msgid "End of Life Date" +msgstr "Date limite de consommation" + +#. module: product_expiry +#: field:stock.production.lot,use_date:0 +msgid "Best before Date" +msgstr "Date limite d'utilisation optimale" + +#. module: product_expiry +#: help:stock.production.lot,use_date:0 +msgid "The date the lot starts deteriorating without becoming dangerous." +msgstr "" +"La date à laquelle le lot commencera à se déteriorer sans devenir dangereux." + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_jambon_product_template +msgid "French cheese Camenbert" +msgstr "Fromage Camembert Français" + +#. module: product_expiry +#: help:product.product,removal_time:0 +msgid "The number of days before a production lot should be removed." +msgstr "" +"Le nombre de jours après lesquels un lot de production doit être retiré." + +#. module: product_expiry +#: field:product.product,use_time:0 +msgid "Product usetime" +msgstr "Durée limite d'utilisation optimale" + +#. module: product_expiry +#: field:stock.production.lot,alert_date:0 +msgid "Alert Date" +msgstr "Date d'alerte" + +#. module: product_expiry +#: field:product.product,removal_time:0 +msgid "Product removal time" +msgstr "Durée avant retrait" + +#. module: product_expiry +#: help:product.product,use_time:0 +msgid "" +"The number of days before a production lot starts deteriorating without " +"becoming dangerous." +msgstr "" +"Le nombre de jours après lesquels un lot de production commencera à se " +"déteriorer sans devenir dangereux" + +#. module: product_expiry +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Erreur: code EAN invalide" + +#. module: product_expiry +#: help:product.product,life_time:0 +msgid "" +"The number of days before a production lot may become dangerous and should " +"not be consumed." +msgstr "" +"Nombre de jours après lesquels un lot de production peut devenir dangereux " +"et ne doit plus être consommé." + +#. module: product_expiry +#: help:stock.production.lot,removal_date:0 +msgid "The date the lot should be removed." +msgstr "La date à laquelle le lot doit être retiré." + +#. module: product_expiry +#: field:product.product,alert_time:0 +msgid "Product alert time" +msgstr "Durée avant alerte" diff --git a/addons/product_expiry/i18n/fr_FR.po b/addons/product_expiry/i18n/fr_FR.po new file mode 100644 index 00000000000..3aede86982b --- /dev/null +++ b/addons/product_expiry/i18n/fr_FR.po @@ -0,0 +1,159 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_expiry +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-06-30 15:09:36+0000\n" +"PO-Revision-Date: 2009-06-30 15:09:36+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 +#: field:product.product,life_time:0 +msgid "Product lifetime" +msgstr "Durée limite de consommation" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_from_product_template +msgid "Ham" +msgstr "Jambon" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_lait_product_template +msgid "Cow milk" +msgstr "Lait de vache" + +#. module: product_expiry +#: model:ir.module.module,shortdesc:product_expiry.module_meta_information +msgid "Products date of expiry" +msgstr "Dates de péremption des produits" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "Erreur: l'unité de mesure par défaut et l'unité de mesure d'achat doivent faire partie de la même catégorie" + +#. module: product_expiry +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML non valide pour l'architecture de la vue" + +#. module: product_expiry +#: help:stock.production.lot,life_date:0 +msgid "The date the lot may become dangerous and should not be consumed." +msgstr "La date à laquelle le lot peut devenir dangereux et ne doit plus être consommé." + +#. module: product_expiry +#: field:stock.production.lot,removal_date:0 +msgid "Removal Date" +msgstr "Date de retrait" + +#. module: product_expiry +#: model:ir.module.module,description:product_expiry.module_meta_information +msgid "Track different dates on products and production lots:\n" +" - end of life\n" +" - best before date\n" +" - removal date\n" +" - alert date\n" +"Used, for example, in food industries." +msgstr "Suit les différentes dates des produits et des lots de production\n" +" - Date limite de consommation\n" +" - DLUO\n" +" - Date de retrait\n" +" - Date d'alerte\n" +"Utilisé par exemple dans les industries alimentaires" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_pain_product_template +msgid "Bread" +msgstr "Pain" + +#. module: product_expiry +#: model:product.uom,name:product_expiry.product_uom_ltr +#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol +msgid "LTR" +msgstr "LTR" + +#. module: product_expiry +#: view:product.product:0 +#: view:stock.production.lot:0 +msgid "Dates" +msgstr "Dates" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "Error: UOS must be in a different category than the UOM" +msgstr "Erreur: l'unité de vente doit appartenir à une catégorie différente que l'unité de mesure" + +#. module: product_expiry +#: field:stock.production.lot,life_date:0 +msgid "End of Life Date" +msgstr "Date limite de consommation" + +#. module: product_expiry +#: field:stock.production.lot,use_date:0 +msgid "Best before Date" +msgstr "Date limite d'utilisation optimale" + +#. module: product_expiry +#: help:stock.production.lot,use_date:0 +msgid "The date the lot starts deteriorating without becoming dangerous." +msgstr "La date à laquelle le lot commencera à se déteriorer sans devenir dangereux." + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_jambon_product_template +msgid "French cheese Camenbert" +msgstr "Fromage Camembert Français" + +#. module: product_expiry +#: help:product.product,removal_time:0 +msgid "The number of days before a production lot should be removed." +msgstr "Le nombre de jours après lesquels un lot de production doit être retiré." + +#. module: product_expiry +#: field:product.product,use_time:0 +msgid "Product usetime" +msgstr "Durée limite d'utilisation optimale" + +#. module: product_expiry +#: field:stock.production.lot,alert_date:0 +msgid "Alert Date" +msgstr "Date d'alerte" + +#. module: product_expiry +#: field:product.product,removal_time:0 +msgid "Product removal time" +msgstr "Durée avant retrait" + +#. module: product_expiry +#: help:product.product,use_time:0 +msgid "The number of days before a production lot starts deteriorating without becoming dangerous." +msgstr "Le nombre de jours après lesquels un lot de production commencera à se déteriorer sans devenir dangereux" + +#. module: product_expiry +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "Erreur: code EAN invalide" + +#. module: product_expiry +#: help:product.product,life_time:0 +msgid "The number of days before a production lot may become dangerous and should not be consumed." +msgstr "Nombre de jours après lesquels un lot de production peut devenir dangereux et ne doit plus être consommé." + +#. module: product_expiry +#: help:stock.production.lot,removal_date:0 +msgid "The date the lot should be removed." +msgstr "La date à laquelle le lot doit être retiré." + +#. module: product_expiry +#: field:product.product,alert_time:0 +msgid "Product alert time" +msgstr "Durée avant alerte" + diff --git a/addons/product_expiry/i18n/product_expiry.pot b/addons/product_expiry/i18n/product_expiry.pot new file mode 100644 index 00000000000..d56ff324485 --- /dev/null +++ b/addons/product_expiry/i18n/product_expiry.pot @@ -0,0 +1,154 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_expiry +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-06-30 15:09:08+0000\n" +"PO-Revision-Date: 2009-06-30 15:09:08+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 +#: field:product.product,life_time:0 +msgid "Product lifetime" +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_from_product_template +msgid "Ham" +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_lait_product_template +msgid "Cow milk" +msgstr "" + +#. module: product_expiry +#: model:ir.module.module,shortdesc:product_expiry.module_meta_information +msgid "Products date of expiry" +msgstr "" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: product_expiry +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: product_expiry +#: help:stock.production.lot,life_date:0 +msgid "The date the lot may become dangerous and should not be consumed." +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,removal_date:0 +msgid "Removal Date" +msgstr "" + +#. module: product_expiry +#: model:ir.module.module,description:product_expiry.module_meta_information +msgid "Track different dates on products and production lots:\n" +" - end of life\n" +" - best before date\n" +" - removal date\n" +" - alert date\n" +"Used, for example, in food industries." +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_pain_product_template +msgid "Bread" +msgstr "" + +#. module: product_expiry +#: model:product.uom,name:product_expiry.product_uom_ltr +#: model:product.uom.categ,name:product_expiry.product_uom_categ_vol +msgid "LTR" +msgstr "" + +#. module: product_expiry +#: view:product.product:0 +#: view:stock.production.lot:0 +msgid "Dates" +msgstr "" + +#. module: product_expiry +#: constraint:product.template:0 +msgid "Error: UOS must be in a different category than the UOM" +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,life_date:0 +msgid "End of Life Date" +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,use_date:0 +msgid "Best before Date" +msgstr "" + +#. module: product_expiry +#: help:stock.production.lot,use_date:0 +msgid "The date the lot starts deteriorating without becoming dangerous." +msgstr "" + +#. module: product_expiry +#: model:product.template,name:product_expiry.product_product_jambon_product_template +msgid "French cheese Camenbert" +msgstr "" + +#. module: product_expiry +#: help:product.product,removal_time:0 +msgid "The number of days before a production lot should be removed." +msgstr "" + +#. module: product_expiry +#: field:product.product,use_time:0 +msgid "Product usetime" +msgstr "" + +#. module: product_expiry +#: field:stock.production.lot,alert_date:0 +msgid "Alert Date" +msgstr "" + +#. module: product_expiry +#: field:product.product,removal_time:0 +msgid "Product removal time" +msgstr "" + +#. module: product_expiry +#: help:product.product,use_time:0 +msgid "The number of days before a production lot starts deteriorating without becoming dangerous." +msgstr "" + +#. module: product_expiry +#: constraint:product.product:0 +msgid "Error: Invalid ean code" +msgstr "" + +#. module: product_expiry +#: help:product.product,life_time:0 +msgid "The number of days before a production lot may become dangerous and should not be consumed." +msgstr "" + +#. module: product_expiry +#: help:stock.production.lot,removal_date:0 +msgid "The date the lot should be removed." +msgstr "" + +#. module: product_expiry +#: field:product.product,alert_time:0 +msgid "Product alert time" +msgstr "" + diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py new file mode 100644 index 00000000000..92dc7974bf7 --- /dev/null +++ b/addons/product_expiry/product_expiry.py @@ -0,0 +1,79 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import datetime +from osv import fields, osv +import pooler + +class stock_production_lot(osv.osv): + _name = 'stock.production.lot' + _inherit = 'stock.production.lot' + + def _get_date(dtype): + """Return a function to compute the limit date for this type""" + def calc_date(self, cr, uid, context=None): + """Compute the limit date for a given date""" + if context is None: + context = {} + if not context.get('product_id', False): + date = False + else: + product = pooler.get_pool(cr.dbname).get('product.product').browse( + cr, uid, context['product_id']) + duration = getattr(product, dtype) + # set date to False when no expiry time specified on the product + date = duration and (datetime.datetime.today() + + datetime.timedelta(days=duration)) + return date and date.strftime('%Y-%m-%d') + return calc_date + + _columns = { + 'life_date': fields.date('End of Life Date', + help='The date the lot may become dangerous and should not be consumed.'), + 'use_date': fields.date('Best before Date', + help='The date the lot starts deteriorating without becoming dangerous.'), + 'removal_date': fields.date('Removal Date', + help='The date the lot should be removed.'), + 'alert_date': fields.date('Alert Date'), + } + + _defaults = { + # 'life_date': _get_date('life_time'), + # 'use_date': _get_date('use_time'), + # 'removal_date': _get_date('removal_time'), + # 'alert_date': _get_date('alert_time'), + } +stock_production_lot() + +class product_product(osv.osv): + _inherit = 'product.product' + _name = 'product.product' + _columns = { + 'life_time': fields.integer('Product lifetime', + help='The number of days before a production lot may become dangerous and should not be consumed.'), + 'use_time': fields.integer('Product usetime', + help='The number of days before a production lot starts deteriorating without becoming dangerous.'), + 'removal_time': fields.integer('Product removal time', + help='The number of days before a production lot should be removed.'), + 'alert_time': fields.integer('Product alert time'), + } +product_product() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product_expiry/product_expiry_demo.xml b/addons/product_expiry/product_expiry_demo.xml new file mode 100644 index 00000000000..b5e8adc6b07 --- /dev/null +++ b/addons/product_expiry/product_expiry_demo.xml @@ -0,0 +1,128 @@ + + + + + LTR + + + + LTR + + + + buy + 7.0 + 5.0 + + + + 3 + French cheese Camenbert + 15 + 10 + 6 + 5 + JKB + 3307630302014 + + + + box of 10 + 12 + + 6 + 4 + + 12345678901234 + 10 + 240 + + + + buy + 8.0 + 6.0 + + + + 0.5 + Ham + 30 + 25 + 20 + 19 + FKS + 3307631101876 + + + + Box of 5 + 12 + + 6 + 4 + + 12345678901234 + 10 + 240 + + + + buy + 8.0 + 6.0 + + + + 0.5 + Bread + 30 + 25 + 20 + 19 + PKB + 3307631102323 + + + + Bag of 2 + 6 + + 6 + 4 + + 12345678901234 + 10 + 240 + + + + buy + 8.0 + 6.0 + + + + 0.5 + Cow milk + 30 + 25 + 20 + 19 + LEX + 3307630302045 + + + + Boxes of 1 liter + 4 + + 6 + 4 + + 12345678901234 + 10 + 240 + + + diff --git a/addons/product_expiry/product_expiry_view.xml b/addons/product_expiry/product_expiry_view.xml new file mode 100644 index 00000000000..245a4a2c600 --- /dev/null +++ b/addons/product_expiry/product_expiry_view.xml @@ -0,0 +1,39 @@ + + + + + stock.production.lot.form + stock.production.lot + + form + + + + + + + + + + + + + product.normal.form + product.product + + form + + + + + + + + + + + + + + + diff --git a/addons/product_expiry/report/__init__.py b/addons/product_expiry/report/__init__.py new file mode 100644 index 00000000000..a6006ed47b3 --- /dev/null +++ b/addons/product_expiry/report/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import report_stock + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product_expiry/report/report_stock.py b/addons/product_expiry/report/report_stock.py new file mode 100644 index 00000000000..bef64eaffa6 --- /dev/null +++ b/addons/product_expiry/report/report_stock.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields +from tools.translate import _ +import tools +from tools.sql import drop_view_if_exists + +class stock_report_prodlots(osv.osv): + _name = "stock.report.prodlots1" + _description = "Stock report by production lots" + _auto = False + _columns = { + 'name': fields.float('Quantity', readonly=True), + 'location_id': fields.many2one('stock.location', 'Location', readonly=True, select=True), + 'product_id': fields.many2one('product.product', 'Product', readonly=True, select=True), + 'prodlot_id': fields.many2one('stock.production.lot', 'Production lot', readonly=True, select=True), + 'life_date': fields.date('End of Life Date', + help='The date the lot may become dangerous and should not be consumed.'), + 'use_date': fields.date('Best before Date', + help='The date the lot starts deteriorating without becoming dangerous.'), + 'removal_date': fields.date('Removal Date', + help='The date the lot should be removed.'), + 'alert_date': fields.date('Alert Date'), + + } + + def init(self, cr): + drop_view_if_exists(cr, 'stock_report_prodlots1') + cr.execute(""" + create or replace view stock_report_prodlots1 as ( + select max(id) as id, + location_id, + product_id, + prodlot_id, + life_date, + use_date, + removal_date, + alert_date, + sum(qty) as name + from ( + select -max(sm.id) as id, + sm.location_id, + sm.product_id, + sm.prodlot_id, + spl.life_date, + spl.use_date, + spl.removal_date, + spl.alert_date, + -sum(sm.product_qty /uo.factor) as qty + from stock_move as sm + left join stock_location sl + on (sl.id = sm.location_id) + left join stock_production_lot spl + on (sm.prodlot_id=spl.id) + left join product_uom uo + on (uo.id=sm.product_uom) + where state = 'done' + group by sm.location_id, sm.product_id, sm.product_uom, sm.prodlot_id, + spl.life_date, + spl.use_date, + spl.removal_date, + spl.alert_date + + union all + select max(sm.id) as id, + sm.location_dest_id as location_id, + sm.product_id, + sm.prodlot_id, + spl.life_date, + spl.use_date, + spl.removal_date, + spl.alert_date, + sum(sm.product_qty /uo.factor) as qty + from stock_move as sm + left join stock_location sl + on (sl.id = sm.location_dest_id) + left join stock_production_lot spl + on (sm.prodlot_id=spl.id) + left join product_uom uo + on (uo.id=sm.product_uom) + where sm.state = 'done' + group by sm.location_dest_id, sm.product_id, sm.product_uom, sm.prodlot_id, + spl.life_date, + spl.use_date, + spl.removal_date, + spl.alert_date + + ) as report + group by location_id, product_id, prodlot_id, + life_date, + use_date, + removal_date, + alert_date + )""") + + def unlink(self, cr, uid, ids, context={}): + raise osv.except_osv(_('Error !'), _('You cannot delete any record!')) + + +stock_report_prodlots() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product_expiry/report/report_stock_view.xml b/addons/product_expiry/report/report_stock_view.xml new file mode 100644 index 00000000000..68198e87dd3 --- /dev/null +++ b/addons/product_expiry/report/report_stock_view.xml @@ -0,0 +1,103 @@ + + + + + + stock.report.prodlots.filter + stock.report.prodlots1 + search + + + + + + + + + + + + + + + + + + + + + + + + + + + stock.report.prodlots.view + stock.report.prodlots1 + form + +
+ + + + + + + + + + +
+ + + stock.report.prodlots.view + stock.report.prodlots1 + tree + + + + + + + + + + + + + + + + stock.report.prodlots.view + stock.report.prodlots1 + graph + + + + + + + + + + + Inventory by Location + ir.actions.act_window + stock.report.prodlots1 + form + tree,form + {'full':'1','search_default_internal_locations':1} + + + + + + +
+
diff --git a/addons/product_expiry/wizard/__init__.py b/addons/product_expiry/wizard/__init__.py new file mode 100644 index 00000000000..2b1b55ed6e0 --- /dev/null +++ b/addons/product_expiry/wizard/__init__.py @@ -0,0 +1 @@ +import stock_partial diff --git a/addons/product_expiry/wizard/stock_partial.py b/addons/product_expiry/wizard/stock_partial.py new file mode 100644 index 00000000000..4edb01073e7 --- /dev/null +++ b/addons/product_expiry/wizard/stock_partial.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields, osv +from service import web_services +from tools.misc import UpdateableStr, UpdateableDict +from tools.translate import _ +import netsvc +import pooler +import time +import datetime +import wizard + +class stock_partial_lot_picking(osv.osv_memory): + _inherit = "stock.partial.picking" + _name = "stock.partial.picking" + _description = "Partial Picking" + + def do_partial(self, cr, uid, ids, context): + res = super(stock_partial_lot_picking, self).do_partial(cr, uid, ids, context=context) + prodlot_obj = self.pool.get('stock.production.lot') + pick_obj = self.pool.get('stock.picking') + picking_ids = context.get('active_ids', False) + partial = self.browse(cr, uid, ids[0], context) + for pick in pick_obj.browse(cr, uid, picking_ids): + for m in pick.move_lines: + for pick in pick_obj.browse(cr, uid, picking_ids): + for m in pick.move_lines: + res = {} + if (pick.type == 'in') and m.prodlot_id: + if not m.prodlot_id.life_date: + date_life = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.life_time)) + res['life_date'] = date_life.strftime('%Y-%m-%d') + if not m.prodlot_id.use_date: + date_use = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.use_time)) + res['use_date'] = date_use.strftime('%Y-%m-%d') + if not m.prodlot_id.removal_date: + date_removal = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.removal_time)) + res['removal_date'] = date_removal.strftime('%Y-%m-%d') + if not m.prodlot_id.alert_date: + date_alert = (datetime.datetime.strptime(partial.date, '%Y-%m-%d %H:%M:%S') + datetime.timedelta(days=m.product_id.alert_time)) + res['alert_date'] = date_alert.strftime('%Y-%m-%d') + prodlot_obj.write(cr, uid, [m.prodlot_id.id], res) + return res +stock_partial_lot_picking() +