diff --git a/product_state/README.rst b/product_state/README.rst new file mode 100644 index 00000000000..c55069c4faf --- /dev/null +++ b/product_state/README.rst @@ -0,0 +1,120 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============= +Product State +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:46754da5dcc6fd670fc33b3793012ae8f5f716b433a982d624e4b481c4478cb6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/19.0/product_state + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-19-0/product-attribute-19-0-product_state + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module introduces the state field on product template and allows +simple product life cycle: + +- draft: In Development +- sellable: Normal +- end: End of Lifecycle +- obsolete: Obsolete + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To add a product to a state: + +1. Go to the product itself and edit. +2. You can select the desired status in the list of buttons above the + form. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ACSONE SA/NV + +Contributors +------------ + +- Cedric Pigeon +- Alexandre Saunier +- Nikul Chaudhary +- Eduardo Magdalena (C2i Change 2 improve + http://www.c2i.es) +- Andrii Skrypka +- Denis Roussel +- Riccardo Fresco +- Nils Coenen +- `Trobz `__: + + - Tuan Nguyen + +Other credits +------------- + +The migration of this module from 18.0 to 19.0 was financially supported +by Camptocamp. + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-emagdalenaC2i| image:: https://github.com/emagdalenaC2i.png?size=40px + :target: https://github.com/emagdalenaC2i + :alt: emagdalenaC2i + +Current `maintainer `__: + +|maintainer-emagdalenaC2i| + +This module is part of the `OCA/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_state/__init__.py b/product_state/__init__.py new file mode 100644 index 00000000000..c0ac2c88f72 --- /dev/null +++ b/product_state/__init__.py @@ -0,0 +1,13 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models +from odoo.orm.domains import Domain + + +def post_init_hook(env): + """Add a state on existing products""" + tmpl_obj = env["product.template"].with_context(active_test=False) + tmpl_without_state = tmpl_obj.search(Domain("state", "=", False)) + tmpl_without_state.write({"state": "sellable"}) + tmpl_without_state_id = tmpl_obj.search(Domain("product_state_id", "=", False)) + tmpl_without_state_id._inverse_product_state() diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py new file mode 100644 index 00000000000..025c0a4e1f8 --- /dev/null +++ b/product_state/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Product State", + "summary": """ + Module introducing a state field on product template""", + "author": "ACSONE SA/NV, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/product-attribute", + "category": "Product", + "version": "19.0.1.0.0", + "license": "AGPL-3", + "depends": ["product"], + "data": [ + "data/product_state_data.xml", + "security/product_state_security.xml", + "security/ir.model.access.csv", + "views/product_template_views.xml", + "views/product_state_views.xml", + ], + "application": False, + "maintainers": ["emagdalenaC2i"], + "post_init_hook": "post_init_hook", +} diff --git a/product_state/data/product_state_data.xml b/product_state/data/product_state_data.xml new file mode 100644 index 00000000000..c7adb6834b0 --- /dev/null +++ b/product_state/data/product_state_data.xml @@ -0,0 +1,23 @@ + + + draft + In Development + 10 + + + sellable + Normal + 20 + True + + + end + End of Lifecycle + 30 + + + obsolete + Obsolete + 40 + + diff --git a/product_state/i18n/ca.po b/product_state/i18n/ca.po new file mode 100644 index 00000000000..77a2836a149 --- /dev/null +++ b/product_state/i18n/ca.po @@ -0,0 +1,198 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-04-22 10:05+0000\n" +"Last-Translator: pablontura \n" +"Language-Team: none\n" +"Language: ca\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "Actiu" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "Codi" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "Creat per" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "Creat el" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "Estat per defecte" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "Descripció" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "Nom de visualització" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Final del cicle de vida" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "ID" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "En Desenvolupament" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "Última actualització per" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "Última actualització el" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "Nom" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "Nombre de productes" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Obsolet" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +msgid "Product State" +msgstr "Estat del producte" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "El codi d'estat del producte ha de ser únic." + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +msgid "Product Status" +msgstr "Estat del producte" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "Productes" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "Seleccioneu un estat per a aquest producte" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "Seqüència" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "Estat" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "Codi de l'Estat" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "Nom de l'Estat" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +#, fuzzy +msgid "State Products" +msgstr "Estat dels productes" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "Només hi hauria d'haver un estat per defecte" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "S'utilitza per ordenar els Estats" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificació el" + +#~ msgid "Product States" +#~ msgstr "Estats del producte" + +#, fuzzy, python-format +#~ msgid "The product state code %s could not be found." +#~ msgstr "No s'ha pogut trobar el codi d'estat del producte %s." + +#~ msgid "Product Template" +#~ msgstr "Plantilla de producte" diff --git a/product_state/i18n/de.po b/product_state/i18n/de.po new file mode 100644 index 00000000000..86abcdcf4b7 --- /dev/null +++ b/product_state/i18n/de.po @@ -0,0 +1,199 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +# Translators: +# Niki Waibel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-17 02:38+0000\n" +"PO-Revision-Date: 2020-07-22 14:19+0000\n" +"Last-Translator: c2cdidier \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" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "Code" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "Erstellt durch" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "Erstellt am" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "Beschreibung" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "Anzeigename" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Ende des Lebenszyklus" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "ID" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "In Entwicklung" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "Letzte Änderung durch" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "Zuletzt aktualisiert am" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "Name" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "Anzahl der Produkte" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Veraltet" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +msgid "Product State" +msgstr "Produkt Zustand" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "Produkt Zustandscode muss eindeutig sein." + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +msgid "Product Status" +msgstr "Produkt-Status" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "Produkte" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "Wählen Sie einen Zustand für dieses Produkt" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "Sequenz" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "Zustand" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "Zustandscode" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "Zustandsname" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "Produkte Zustand" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "Dient zu Sortierung der Zustände" + +#~ msgid "Last Modified on" +#~ msgstr "Letzte Änderung am" + +#~ msgid "Product States" +#~ msgstr "Produkt-Zustände" + +#~ msgid "Product Template" +#~ msgstr "Produktvorlage" + +#~ msgid "product.state" +#~ msgstr "Produktzustand" diff --git a/product_state/i18n/es.po b/product_state/i18n/es.po new file mode 100644 index 00000000000..fe4d0e14326 --- /dev/null +++ b/product_state/i18n/es.po @@ -0,0 +1,204 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +# Translators: +# Pedro M. Baeza , 2018 +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-29 08:49+0000\n" +"PO-Revision-Date: 2023-10-12 15:36+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "Activo" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "Código" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "Estado por defecto" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "Descripción" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Fin del ciclo de vida" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "En desarrollo" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "Última Actualización el" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "Nombre" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "Número de productos" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Obsoleto" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "Producto" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +msgid "Product State" +msgstr "Estado del producto" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "El código de estado del producto debe ser único." + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +msgid "Product Status" +msgstr "Plantilla de producto" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "Productos" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "Selecciona un estado para este producto" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "Secuencia" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "Estado" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "Código de estado" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "Nombre del estado" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "Productos estatales" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "Sólo debería haber un estado predeterminado" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "Usado para pedir a los estados" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" + +#~ msgid "Product States" +#~ msgstr "Estados del producto" + +#, python-format +#~ msgid "The product state code %s could not be found." +#~ msgstr "No se ha encontrado el código de estado del producto %s." + +#~ msgid "Product Template" +#~ msgstr "Plantilla de producto" + +#~ msgid "product.state" +#~ msgstr "producto.estado" diff --git a/product_state/i18n/fr.po b/product_state/i18n/fr.po new file mode 100644 index 00000000000..0ba5a27b6e0 --- /dev/null +++ b/product_state/i18n/fr.po @@ -0,0 +1,200 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +# Translators: +# OCA Transbot , 2017 +# guillaume bauer , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-29 02:55+0000\n" +"PO-Revision-Date: 2025-09-09 11:48+0000\n" +"Last-Translator: David Beal \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" +"X-Generator: Weblate 5.10.4\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "Code" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "Etat par défaut" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "Description" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Fin de vie" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "ID" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "R & D" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "Dernière modification par" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "Dernière modification le" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "Nom" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "Nombre d'articles" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Obsolète" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +msgid "Product State" +msgstr "Etat de l'article" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "Le code d'état de l'article doit être unique." + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +msgid "Product Status" +msgstr "Statut de l'article" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "Articles" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "Sélectionner un état pour cet article" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "Séquence" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "Statut" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "Code du statut" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "Nom du statut" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "Statut des articles" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "Utilisé pour trier les statuts" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification le" + +#~ msgid "Product States" +#~ msgstr "Etats de l'article" + +#~ msgid "Product Template" +#~ msgstr "Modèle de l'article" + +#~ msgid "product.state" +#~ msgstr "Statut de l'article" diff --git a/product_state/i18n/hr.po b/product_state/i18n/hr.po new file mode 100644 index 00000000000..3d482b28c96 --- /dev/null +++ b/product_state/i18n/hr.po @@ -0,0 +1,202 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +# Translators: +# Bole , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-29 08:49+0000\n" +"PO-Revision-Date: 2018-01-29 08:49+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Kraj životnog ciklusa" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "U razvoju" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normalno" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Zastarjelo" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +#, fuzzy +msgid "Product State" +msgstr "Predložak proizvoda" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "" + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +#, fuzzy +msgid "Product Status" +msgstr "Predložak proizvoda" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +#, fuzzy +msgid "State" +msgstr "Status" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +#, fuzzy +msgid "State Products" +msgstr "Status" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#, fuzzy +#~ msgid "Product States" +#~ msgstr "Predložak proizvoda" + +#~ msgid "Product Template" +#~ msgstr "Predložak proizvoda" + +#, fuzzy +#~ msgid "product.state" +#~ msgstr "Predložak proizvoda" diff --git a/product_state/i18n/it.po b/product_state/i18n/it.po new file mode 100644 index 00000000000..9b9884bb254 --- /dev/null +++ b/product_state/i18n/it.po @@ -0,0 +1,194 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-02-03 22:06+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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" +"X-Generator: Weblate 5.6.2\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "Attivo" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "Codice" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "Stato predefinito" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "Descrizione" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Fine ciclo di vita" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "ID" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "in sviluppo" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "Nome" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normale" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "Numero di prodotti" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Obsoleto" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "Prodotto" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +msgid "Product State" +msgstr "Stato prodotto" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "Codice di stato prodotto deve essere unico." + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "Gestore stato prodotto" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +msgid "Product Status" +msgstr "Stato prodotto" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "Prodotti" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "Selezionare uno stato per questo prodotto" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "Sequenza" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "Stato" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "Codice stato" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "Nome stato" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "Prodotti stato" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "Il codice di stato prodotto %(product_state)s non è stato trovato." + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "Ci deve essere un solo stato predefinito" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "Usato per ordinare gli stati" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" + +#~ msgid "Product States" +#~ msgstr "Stati prodotto" + +#, python-format +#~ msgid "The product state code %s could not be found." +#~ msgstr "Il codice di stato prodotto %s non è stato trovato." diff --git a/product_state/i18n/nl.po b/product_state/i18n/nl.po new file mode 100644 index 00000000000..92880bc91e1 --- /dev/null +++ b/product_state/i18n/nl.po @@ -0,0 +1,193 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-11-20 22:18+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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" +"X-Generator: Weblate 5.10.4\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "Actief" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "Code" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "Aangemaakt door" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "Aangemaakt op" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "Standaard status" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "Omschrijving" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "Weergavenaam" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Einde levenscyclus" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "ID" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "In ontwikkeling" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "Laatst bijgewerkt door" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "Laatst bijgewerkt op" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "Naam" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normaal" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "Aantal producten" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Verouderd" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "Product" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +msgid "Product State" +msgstr "Product Status" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "Product Status Code moet uniek zijn." + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "Product Status Beheerder" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +msgid "Product Status" +msgstr "Product Status" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "Producten" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "Selecteer een status voor dit product" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "Volgorde" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "Status" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "Statuscode" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "Statusnaam" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "Status Producten" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "De product status code %(product_state)s kon niet gevonden worden." + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "Er mag slechts één standaard status zijn" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "Gebruikt om de statussen te ordenen" + +#~ msgid "Last Modified on" +#~ msgstr "Laatst gewijzigd op" + +#~ msgid "Product States" +#~ msgstr "Product status" + +#~ msgid "Product Template" +#~ msgstr "Productsjabloon" diff --git a/product_state/i18n/nl_NL.po b/product_state/i18n/nl_NL.po new file mode 100644 index 00000000000..bc56f9cc813 --- /dev/null +++ b/product_state/i18n/nl_NL.po @@ -0,0 +1,200 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-27 04:44+0000\n" +"PO-Revision-Date: 2017-05-27 04:44+0000\n" +"Last-Translator: Peter Hageman , 2017\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" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +#, fuzzy +msgid "Product State" +msgstr "Productsjabloon" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "" + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +#, fuzzy +msgid "Product Status" +msgstr "Productsjabloon" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#, fuzzy +#~ msgid "Product States" +#~ msgstr "Productsjabloon" + +#~ msgid "Product Template" +#~ msgstr "Productsjabloon" + +#, fuzzy +#~ msgid "product.state" +#~ msgstr "Productsjabloon" diff --git a/product_state/i18n/product_state.pot b/product_state/i18n/product_state.pot new file mode 100644 index 00000000000..1e88d5da686 --- /dev/null +++ b/product_state/i18n/product_state.pot @@ -0,0 +1,181 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +msgid "Product State" +msgstr "" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "" + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +msgid "Product Status" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" diff --git a/product_state/i18n/pt.po b/product_state/i18n/pt.po new file mode 100644 index 00000000000..98af70474fd --- /dev/null +++ b/product_state/i18n/pt.po @@ -0,0 +1,199 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-23 14:13+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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" +"X-Generator: Weblate 3.10\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "Fim de Ciclo de Vida" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "Em Desenvolvimento" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "Obsoleto" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +#, fuzzy +msgid "Product State" +msgstr "Modelo de Produto" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "" + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +#, fuzzy +msgid "Product Status" +msgstr "Modelo de Produto" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +#, fuzzy +msgid "State" +msgstr "Estado" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +#, fuzzy +msgid "State Products" +msgstr "Estado" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#, fuzzy +#~ msgid "Product States" +#~ msgstr "Modelo de Produto" + +#~ msgid "Product Template" +#~ msgstr "Modelo de Produto" + +#, fuzzy +#~ msgid "product.state" +#~ msgstr "Modelo de Produto" diff --git a/product_state/i18n/sl.po b/product_state/i18n/sl.po new file mode 100644 index 00000000000..3d466c62cb4 --- /dev/null +++ b/product_state/i18n/sl.po @@ -0,0 +1,200 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-27 03:49+0000\n" +"PO-Revision-Date: 2018-01-27 03:49+0000\n" +"Last-Translator: OCA Transbot , 2018\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" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3);\n" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__active +msgid "Active" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Code" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid +msgid "Created by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__create_date +msgid "Created on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__default +msgid "Default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__description +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "Description" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__display_name +msgid "Display Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_end +msgid "End of Lifecycle" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__id +msgid "ID" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_draft +msgid "In Development" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__name +msgid "Name" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_sellable +msgid "Normal" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__products_count +msgid "Number of products" +msgstr "" + +#. module: product_state +#: model:product.state,name:product_state.product_state_obsolete +msgid "Obsolete" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_single_product_state +#: model:ir.model,name:product_state.model_product_state +#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view +#, fuzzy +msgid "Product State" +msgstr "Predloga proizvoda" + +#. module: product_state +#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique +msgid "Product State Code must be unique." +msgstr "" + +#. module: product_state +#: model:res.groups,name:product_state.group_product_state_manager +msgid "Product State Manager" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__state +#: model:ir.model.fields,field_description:product_state.field_product_template__state +#, fuzzy +msgid "Product Status" +msgstr "Predloga proizvoda" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban +msgid "Products" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_product__product_state_id +#: model:ir.model.fields,help:product_state.field_product_template__product_state_id +msgid "Select a state for this product" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__sequence +msgid "Sequence" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_product_state +#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id +#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id +#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state +msgid "State" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,field_description:product_state.field_product_state__code +msgid "State Code" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form +msgid "State Name" +msgstr "" + +#. module: product_state +#: model:ir.actions.act_window,name:product_state.action_open_state_products +#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids +msgid "State Products" +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_template.py:0 +msgid "The product state code %(product_state)s could not be found." +msgstr "" + +#. module: product_state +#. odoo-python +#: code:addons/product_state/models/product_state.py:0 +msgid "There should be only one default state" +msgstr "" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#, fuzzy +#~ msgid "Product States" +#~ msgstr "Predloga proizvoda" + +#~ msgid "Product Template" +#~ msgstr "Predloga proizvoda" + +#, fuzzy +#~ msgid "product.state" +#~ msgstr "Predloga proizvoda" diff --git a/product_state/models/__init__.py b/product_state/models/__init__.py new file mode 100644 index 00000000000..294a305ebb3 --- /dev/null +++ b/product_state/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import product_state +from . import product_template diff --git a/product_state/models/product_state.py b/product_state/models/product_state.py new file mode 100644 index 00000000000..d7207cab851 --- /dev/null +++ b/product_state/models/product_state.py @@ -0,0 +1,49 @@ +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models +from odoo.exceptions import ValidationError +from odoo.orm.domains import Domain + + +class ProductState(models.Model): + _name = "product.state" + _description = "Product State" + _order = "sequence, id" + + name = fields.Char(comodel_name="State Name", required=True, translate=True) + code = fields.Char(string="State Code", required=True) + sequence = fields.Integer(help="Used to order the States", default=25) + active = fields.Boolean(default=True) + description = fields.Text(translate=True) + product_ids = fields.One2many( + comodel_name="product.template", + inverse_name="product_state_id", + string="State Products", + ) + products_count = fields.Integer( + string="Number of products", + compute="_compute_products_count", + ) + default = fields.Boolean("Default state") + + _code_unique = models.Constraint( + "UNIQUE(code)", "Product State Code must be unique." + ) + + @api.depends("product_ids") + def _compute_products_count(self): + data = dict( + self.env["product.template"]._read_group( + domain=Domain("product_state_id", "in", self.ids), + groupby=["product_state_id"], + aggregates=["__count"], + ) + ) + for state in self: + state.products_count = data.get(state, 0) + + @api.constrains("default") + def _check_default(self): + if self.search_count(Domain("default", "=", True)) > 1: + raise ValidationError(self.env._("There should be only one default state")) diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py new file mode 100644 index 00000000000..6d8ceead80a --- /dev/null +++ b/product_state/models/product_template.py @@ -0,0 +1,71 @@ +# Copyright 2017-2021 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models +from odoo.exceptions import UserError +from odoo.orm.domains import Domain + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + state = fields.Char( + string="Product Status", + index=True, + compute="_compute_product_state", + inverse="_inverse_product_state", + readonly=True, + store=True, + ) + product_state_id = fields.Many2one( + comodel_name="product.state", + string="State", + help="Select a state for this product", + group_expand="_read_group_state_id", + inverse="_inverse_product_state_id", + default=lambda self: self._get_default_product_state().id, + index=True, + tracking=10, + copy=False, + ) + + def _inverse_product_state_id(self): + """Allow triggering custom behaviors on ``product_state_id`` updates + + Hook method, can be overridden by inheriting modules + """ + + @api.model + def _get_default_product_state(self): + return self.env["product.state"].search(Domain("default", "=", True), limit=1) + + @api.depends("product_state_id") + def _compute_product_state(self): + for product_tmpl in self: + product_tmpl.state = product_tmpl.product_state_id.code + + def _inverse_product_state(self): + for product_tmpl in self: + self._set_product_state_id(product_tmpl) + + @api.model + def _set_product_state_id(self, record: models.Model): + """Updates ``product_state_id`` on ``record`` + + :param record: any recordset whose model defines field ``product_state_id`` + (eg: ``product.template`` or ``product.product``) + """ + ProductState = record.env["product.state"] + product_state = ProductState.search(Domain("code", "=", record.state), limit=1) + if record.state and not product_state: + raise UserError( + self.env._( + "The product state code %(product_state)s could not be found.", + product_state=record.state, + ) + ) + record.product_state_id = product_state.id + + @api.model + def _read_group_state_id(self, states, domain): + return states.search(Domain.TRUE) diff --git a/product_state/pyproject.toml b/product_state/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_state/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_state/readme/CONTRIBUTORS.md b/product_state/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..389f2d52e19 --- /dev/null +++ b/product_state/readme/CONTRIBUTORS.md @@ -0,0 +1,11 @@ +- Cedric Pigeon \<\> +- Alexandre Saunier \<\> +- Nikul Chaudhary \<\> +- Eduardo Magdalena \<\> (C2i Change 2 improve + ) +- Andrii Skrypka \<\> +- Denis Roussel \<\> +- Riccardo Fresco \<\> +- Nils Coenen \<\> +- [Trobz](https://trobz.com): + - Tuan Nguyen \<\> diff --git a/product_state/readme/CREDITS.md b/product_state/readme/CREDITS.md new file mode 100644 index 00000000000..6e37c20d7a6 --- /dev/null +++ b/product_state/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 18.0 to 19.0 was financially supported by Camptocamp. diff --git a/product_state/readme/DESCRIPTION.md b/product_state/readme/DESCRIPTION.md new file mode 100644 index 00000000000..7ff986a25cd --- /dev/null +++ b/product_state/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module introduces the state field on product template and allows +simple product life cycle: + +- draft: In Development +- sellable: Normal +- end: End of Lifecycle +- obsolete: Obsolete diff --git a/product_state/readme/USAGE.md b/product_state/readme/USAGE.md new file mode 100644 index 00000000000..3d736a470e4 --- /dev/null +++ b/product_state/readme/USAGE.md @@ -0,0 +1,5 @@ +To add a product to a state: + +1. Go to the product itself and edit. +2. You can select the desired status in the list of buttons above the + form. diff --git a/product_state/security/ir.model.access.csv b/product_state/security/ir.model.access.csv new file mode 100644 index 00000000000..07b36aee44b --- /dev/null +++ b/product_state/security/ir.model.access.csv @@ -0,0 +1,4 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_product_state_manager","product.state","model_product_state",product_state.group_product_state_manager,1,1,1,1 +"access_product_state_internal_user","product.state.internal.user","model_product_state","base.group_user",1,0,0,0 +"access_product_state_public","product.state.public","model_product_state","base.group_public",1,0,0,0 diff --git a/product_state/security/product_state_security.xml b/product_state/security/product_state_security.xml new file mode 100644 index 00000000000..840b1119b9d --- /dev/null +++ b/product_state/security/product_state_security.xml @@ -0,0 +1,6 @@ + + + + Product State Manager + + diff --git a/product_state/static/description/icon.png b/product_state/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_state/static/description/icon.png differ diff --git a/product_state/static/description/index.html b/product_state/static/description/index.html new file mode 100644 index 00000000000..deec500bf13 --- /dev/null +++ b/product_state/static/description/index.html @@ -0,0 +1,466 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product State

+ +

Beta License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runboat

+

This module introduces the state field on product template and allows +simple product life cycle:

+
    +
  • draft: In Development
  • +
  • sellable: Normal
  • +
  • end: End of Lifecycle
  • +
  • obsolete: Obsolete
  • +
+

Table of contents

+ +
+

Usage

+

To add a product to a state:

+
    +
  1. Go to the product itself and edit.
  2. +
  3. You can select the desired status in the list of buttons above the +form.
  4. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 18.0 to 19.0 was financially supported +by Camptocamp.

+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

emagdalenaC2i

+

This module is part of the OCA/product-attribute project on GitHub.

+

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

+
+
+
+
+ + diff --git a/product_state/tests/__init__.py b/product_state/tests/__init__.py new file mode 100644 index 00000000000..cf5f2559a8f --- /dev/null +++ b/product_state/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import test_product_state diff --git a/product_state/tests/test_product_state.py b/product_state/tests/test_product_state.py new file mode 100644 index 00000000000..2e865e1f04a --- /dev/null +++ b/product_state/tests/test_product_state.py @@ -0,0 +1,82 @@ +# Copyright 2021 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +import logging + +from odoo.exceptions import UserError, ValidationError +from odoo.tests.common import TransactionCase + +_logger = logging.getLogger(__name__) + + +class TestProductState(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.ProductState = cls.env["product.state"] + cls.state_test = cls.ProductState.create({"name": "State Test", "code": "Test"}) + cls.state_sellable = cls.env.ref("product_state.product_state_sellable") + cls.product_obj = cls.env["product.template"] + + @classmethod + def _create_product(cls, state=None): + vals = {"name": "Product Test for State"} + if state: + vals.update({"product_state_id": state.id}) + cls.created_product = cls.product_obj.create(vals) + + def test_01_product_state(self): + """ + Check if new state has no products + Create a product, check if it has the default state + Create a product with state + Check if new state has 1 product + """ + self.assertEqual(self.state_test.products_count, 0) + self._create_product() + self.assertEqual(self.created_product.product_state_id, self.state_sellable) + self.assertEqual(self.state_test.products_count, 0) + self._create_product(self.state_test) + self.assertEqual(self.created_product.product_state_id, self.state_test) + self.assertEqual(self.state_test.products_count, 1) + + def test_02_set_product_state(self): + """ + Create product, it has default state + Then, update the state + It should have the existing one (Test) + """ + self._create_product() + self.assertEqual(self.created_product.product_state_id, self.state_sellable) + self.created_product.state = "Test" + self.assertEqual(self.created_product.product_state_id, self.state_test) + + def test_03_set_constrains_product_state(self): + """ + Create another default state, + It should have the existing only one default state at time + """ + with self.assertRaisesRegex( + ValidationError, "There should be only one default state" + ): + self.env["product.state"].create( + {"name": "Default State 2", "code": "df2", "default": True} + ) + + def test_04_invalid_state(self): + self._create_product() + with self.assertRaisesRegex( + UserError, "The product state code new_code could not be found." + ): + self.created_product.state = "new_code" + + def test_05_copy(self): + """ + Create product with non-default state. + Copy product. + The copy should have the default state. + """ + self._create_product() + self.created_product.state = "Test" + copied_product = self.created_product.copy() + self.assertEqual(copied_product.product_state_id, self.state_sellable) diff --git a/product_state/views/product_state_views.xml b/product_state/views/product_state_views.xml new file mode 100644 index 00000000000..c819f9af480 --- /dev/null +++ b/product_state/views/product_state_views.xml @@ -0,0 +1,103 @@ + + + + product.state.search.form + product.state + + + + + + + + product.state.form + product.state + +
+ +
+ +
+
+
+ + + + + + + + +
+
+
+
+ + product.state.tree + product.state + + + + + + + + + + product.state.kanban + product.state + + + + + + + +
+

+ +

+ +
+
+
+
+
+
+ + Product State + ir.actions.act_window + product.state + kanban,form,list + {} + [('id', '=', product_state_id)] + current + + + State + product.state + kanban,form,list + +
diff --git a/product_state/views/product_template_views.xml b/product_state/views/product_template_views.xml new file mode 100644 index 00000000000..f6a41ecfb63 --- /dev/null +++ b/product_state/views/product_template_views.xml @@ -0,0 +1,59 @@ + + + + product.template.search.state + product.template + + + + + + + + + + + product.template.common.form + product.template + + + + +
+ +
+
+
+
+ + product.template.tree (product_state_id) + product.template + + 50 + + + + + + + + State Products + ir.actions.act_window + product.template + kanban,form,list + {} + [('product_state_id', '=', id)] + +
diff --git a/product_status/README.rst b/product_status/README.rst new file mode 100644 index 00000000000..147f1d8021f --- /dev/null +++ b/product_status/README.rst @@ -0,0 +1,114 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============== +Product Status +============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3596eb6824b65a5915f05740fbfb36d82f872e7bc3460012ceda12da1b14a8f4 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/19.0/product_status + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-19-0/product-attribute-19-0-product_status + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module compute a status on product based on some date field +displayed on the Sales tab. This module will deactivate all default +state in product_state, implement new default data The option to use the +product-attribute/product_state module was considered but because the +status is computed based on today. It does not work well with a stored +fields and also means there is no need for creation of state from the +user. + +By order of importance, the status is computed by: - *End-of-life* - +*Discontinued until* - *New until* + +*End-of-life* has priority over the other dates. *Discontinued-until* +has priority over *New until*. + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +File data/product_state_data.xml will be moved to +demo/product_state_demo.xml since version 15.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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp + +Contributors +------------ + +- `Camptocamp `__: + + - Thierry Ducrest + - Simone Orsi + +- `Trobz `__: + + - Son Ho + - Tuan Nguyen + +Other credits +------------- + +**Financial support** + +- Cosanum +- Camptocamp R&D + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_status/__init__.py b/product_status/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/product_status/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_status/__manifest__.py b/product_status/__manifest__.py new file mode 100644 index 00000000000..2d2ab8d13aa --- /dev/null +++ b/product_status/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +{ + "name": "Product Status", + "summary": "Product Status Computed From Fields", + "version": "19.0.1.0.0", + "category": "Product", + "author": "Camptocamp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/product-attribute", + "license": "AGPL-3", + "depends": [ + "sale", # Needs to be installed to display the fields in the proper tab + "product_state", + ], + "data": [ + "data/ir_cron.xml", + "data/function_deactive_default_product_state_data.xml", + "data/product_state_data.xml", + "views/product_views.xml", + ], + "installable": True, +} diff --git a/product_status/data/function_deactive_default_product_state_data.xml b/product_status/data/function_deactive_default_product_state_data.xml new file mode 100644 index 00000000000..5a511c22efe --- /dev/null +++ b/product_status/data/function_deactive_default_product_state_data.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_status/data/ir_cron.xml b/product_status/data/ir_cron.xml new file mode 100644 index 00000000000..317bf18fcf7 --- /dev/null +++ b/product_status/data/ir_cron.xml @@ -0,0 +1,15 @@ + + + + + Recompute Product State + 1 + days + + + + code + model._cron_recompute_product_state() + + diff --git a/product_status/data/product_state_data.xml b/product_status/data/product_state_data.xml new file mode 100644 index 00000000000..62f06894eae --- /dev/null +++ b/product_status/data/product_state_data.xml @@ -0,0 +1,23 @@ + + + + new + New + 10 + + + discontinued + Discontinued + 20 + + + phaseout + Phase Out + 30 + + + endoflife + End-Of-Life + 40 + + diff --git a/product_status/i18n/es.po b/product_status/i18n/es.po new file mode 100644 index 00000000000..6ddeee05eaf --- /dev/null +++ b/product_status/i18n/es.po @@ -0,0 +1,175 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-28 20:20+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: product_status +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "" +"End-of-life has priority over the other dates.
\n" +" Discontinued-until has priority over New until." +msgstr "" +"El Fin de vida tiene prioridad sobre las demás fechas.
" +"\n" +" Descontinuado hasta tiene prioridad sobre " +"Nuevo hasta." + +#. module: product_status +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "By order of importance, the status is computed by:
" +msgstr "Por orden de importancia, el estado se computa por:
" + +#. module: product_status +#: code:addons/product_status/models/product_state.py:0 +#, python-format +msgid "Cannot delete/modified state installed by module, state name: %s" +msgstr "" +"No se puede eliminar/modificar el estado instalado por el módulo, nombre del " +"estado: %s" + +#. module: product_status +#: model:product.state,name:product_status.product_state_discontinued +msgid "Discontinued" +msgstr "Discontinuado" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__discontinued_until +#: model:ir.model.fields,field_description:product_status.field_product_template__discontinued_until +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "Discontinued until" +msgstr "Discontinuado hasta" + +#. module: product_status +#: model:product.state,name:product_status.product_state_endoflife +msgid "End-Of-Life" +msgstr "Fin de la vida útil" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__end_of_life_date +#: model:ir.model.fields,field_description:product_status.field_product_template__end_of_life_date +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "End-of-life" +msgstr "Fin de la vida útil" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__has_status_date +msgid "Has Status Date" +msgstr "Tiene Fecha Estado" + +#. module: product_status +#: model:product.state,name:product_status.product_state_new +msgid "New" +msgstr "Nuevo" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__new_until +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_new_until +#: model:ir.model.fields,help:product_status.field_product_template__new_until +msgid "New product, and you want to warn your client for a certain time" +msgstr "Nuevo producto, y quiere avisar a su cliente durante cierto tiempo" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__new_until +#: model:ir.model.fields,field_description:product_status.field_product_template__new_until +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "New until" +msgstr "Nuevo hasta" + +#. module: product_status +#: model:product.state,name:product_status.product_state_phaseout +msgid "Phase Out" +msgstr "Retirada Progresiva" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_product +msgid "Product" +msgstr "Producto" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_state +msgid "Product State" +msgstr "Estado del Producto" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__state +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "Product Status" +msgstr "Estado del Producto" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_template +msgid "Product Template" +msgstr "Plantilla del Producto" + +#. module: product_status +#: model:ir.actions.server,name:product_status.cron_recompute_product_state_ir_actions_server +#: model:ir.cron,cron_name:product_status.cron_recompute_product_state +#: model:ir.cron,name:product_status.cron_recompute_product_state +msgid "Recompute Product State" +msgstr "Recalcular el Estado del Producto" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__product_state_id +msgid "Select a state for this product" +msgstr "Selecciona un estado para este producto" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__product_state_id +msgid "State" +msgstr "Estado" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_discontinued_until +msgid "Template Discontinued until" +msgstr "Plantilla Interrumpida hasta" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_end_of_life_date +msgid "Template End-of-life" +msgstr "Plantilla Fin de vida útil" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_new_until +msgid "Template New until" +msgstr "Plantilla Nueva hasta" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__discontinued_until +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_discontinued_until +#: model:ir.model.fields,help:product_status.field_product_template__discontinued_until +msgid "" +"When the product is discontinued for a certain time, to warn your " +"client/avoid order during this downtime." +msgstr "" +"Cuando el producto esté descatalogado durante un tiempo determinado, para " +"avisar a su cliente/evitar el pedido durante este tiempo de inactividad." + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__end_of_life_date +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_end_of_life_date +#: model:ir.model.fields,help:product_status.field_product_template__end_of_life_date +msgid "" +"When the product is end-of-life, and you want to warn your client/avoid " +"order in the future." +msgstr "" +"Cuando el producto ha llegado al final de su vida útil y desea advertir a su " +"cliente/evitar que lo pida en el futuro." diff --git a/product_status/i18n/it.po b/product_status/i18n/it.po new file mode 100644 index 00000000000..32ed58acde5 --- /dev/null +++ b/product_status/i18n/it.po @@ -0,0 +1,174 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-02 10:38+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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" +"X-Generator: Weblate 4.17\n" + +#. module: product_status +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "" +"End-of-life has priority over the other dates.
\n" +" Discontinued-until has priority over New until." +msgstr "" +"Fine vita ha la priorità sulle altre date.
\n" +" Sospeso fino al ha la priorità su Nuovo " +"fino al." + +#. module: product_status +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "By order of importance, the status is computed by:
" +msgstr "Per ordine di importanza, lo stato è calcolato da:
" + +#. module: product_status +#: code:addons/product_status/models/product_state.py:0 +#, python-format +msgid "Cannot delete/modified state installed by module, state name: %s" +msgstr "" +"Non si può cancellare / modificare uno stato installato da un modulo, nome " +"stato: %s" + +#. module: product_status +#: model:product.state,name:product_status.product_state_discontinued +msgid "Discontinued" +msgstr "Sospeso" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__discontinued_until +#: model:ir.model.fields,field_description:product_status.field_product_template__discontinued_until +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "Discontinued until" +msgstr "Sospeso fino al" + +#. module: product_status +#: model:product.state,name:product_status.product_state_endoflife +msgid "End-Of-Life" +msgstr "Fine vita" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__end_of_life_date +#: model:ir.model.fields,field_description:product_status.field_product_template__end_of_life_date +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "End-of-life" +msgstr "Fine vita" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__has_status_date +msgid "Has Status Date" +msgstr "Ha data stato" + +#. module: product_status +#: model:product.state,name:product_status.product_state_new +msgid "New" +msgstr "Nuovo" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__new_until +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_new_until +#: model:ir.model.fields,help:product_status.field_product_template__new_until +msgid "New product, and you want to warn your client for a certain time" +msgstr "Prodotto nuovo e si vuole avvisare il cliente ad una certa ora" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__new_until +#: model:ir.model.fields,field_description:product_status.field_product_template__new_until +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "New until" +msgstr "Nuovo fino al" + +#. module: product_status +#: model:product.state,name:product_status.product_state_phaseout +msgid "Phase Out" +msgstr "Ritirato" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_product +msgid "Product" +msgstr "Prodotto" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_state +msgid "Product State" +msgstr "Stato prodotto" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__state +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "Product Status" +msgstr "Stato prodotto" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_template +msgid "Product Template" +msgstr "Modello prodotto" + +#. module: product_status +#: model:ir.actions.server,name:product_status.cron_recompute_product_state_ir_actions_server +#: model:ir.cron,cron_name:product_status.cron_recompute_product_state +#: model:ir.cron,name:product_status.cron_recompute_product_state +msgid "Recompute Product State" +msgstr "Ricalcolo stato prodotto" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__product_state_id +msgid "Select a state for this product" +msgstr "Selezionare uno stato per questo prodotto" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__product_state_id +msgid "State" +msgstr "Stato" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_discontinued_until +msgid "Template Discontinued until" +msgstr "Modello sospeso fino al" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_end_of_life_date +msgid "Template End-of-life" +msgstr "Fine vita modello" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_new_until +msgid "Template New until" +msgstr "Modello nuovo fino al" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__discontinued_until +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_discontinued_until +#: model:ir.model.fields,help:product_status.field_product_template__discontinued_until +msgid "" +"When the product is discontinued for a certain time, to warn your " +"client/avoid order during this downtime." +msgstr "" +"Quando il prodotto è sospeso per un certo periodo, per avvisare il cliente / " +"evitare ordini durante l'indisponibilità." + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__end_of_life_date +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_end_of_life_date +#: model:ir.model.fields,help:product_status.field_product_template__end_of_life_date +msgid "" +"When the product is end-of-life, and you want to warn your client/avoid " +"order in the future." +msgstr "" +"Quando il prodotto è a fine vita e si vuole avvisare il cliente / evitare " +"ordini nel futuro." diff --git a/product_status/i18n/product_status.pot b/product_status/i18n/product_status.pot new file mode 100644 index 00000000000..5366e2b4081 --- /dev/null +++ b/product_status/i18n/product_status.pot @@ -0,0 +1,160 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_status +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "" +"End-of-life has priority over the other dates.
\n" +" Discontinued-until has priority over New until." +msgstr "" + +#. module: product_status +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "By order of importance, the status is computed by:
" +msgstr "" + +#. module: product_status +#. odoo-python +#: code:addons/product_status/models/product_state.py:0 +msgid "Cannot delete/modified state installed by module, state name: %s" +msgstr "" + +#. module: product_status +#: model:product.state,name:product_status.product_state_discontinued +msgid "Discontinued" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__discontinued_until +#: model:ir.model.fields,field_description:product_status.field_product_template__discontinued_until +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "Discontinued until" +msgstr "" + +#. module: product_status +#: model:product.state,name:product_status.product_state_endoflife +msgid "End-Of-Life" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__end_of_life_date +#: model:ir.model.fields,field_description:product_status.field_product_template__end_of_life_date +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "End-of-life" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__has_status_date +msgid "Has Status Date" +msgstr "" + +#. module: product_status +#: model:product.state,name:product_status.product_state_new +msgid "New" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__new_until +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_new_until +#: model:ir.model.fields,help:product_status.field_product_template__new_until +msgid "New product, and you want to warn your client for a certain time" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__new_until +#: model:ir.model.fields,field_description:product_status.field_product_template__new_until +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "New until" +msgstr "" + +#. module: product_status +#: model:product.state,name:product_status.product_state_phaseout +msgid "Phase Out" +msgstr "" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_template +msgid "Product" +msgstr "" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_state +msgid "Product State" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__state +#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view +msgid "Product Status" +msgstr "" + +#. module: product_status +#: model:ir.model,name:product_status.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_status +#: model:ir.actions.server,name:product_status.cron_recompute_product_state_ir_actions_server +msgid "Recompute Product State" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__product_state_id +msgid "Select a state for this product" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__product_state_id +msgid "State" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_discontinued_until +msgid "Template Discontinued until" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_end_of_life_date +msgid "Template End-of-life" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_new_until +msgid "Template New until" +msgstr "" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__discontinued_until +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_discontinued_until +#: model:ir.model.fields,help:product_status.field_product_template__discontinued_until +msgid "" +"When the product is discontinued for a certain time, to warn your " +"client/avoid order during this downtime." +msgstr "" + +#. module: product_status +#: model:ir.model.fields,help:product_status.field_product_product__end_of_life_date +#: model:ir.model.fields,help:product_status.field_product_product__tmpl_end_of_life_date +#: model:ir.model.fields,help:product_status.field_product_template__end_of_life_date +msgid "" +"When the product is end-of-life, and you want to warn your client/avoid " +"order in the future." +msgstr "" diff --git a/product_status/models/__init__.py b/product_status/models/__init__.py new file mode 100644 index 00000000000..fa69db0b376 --- /dev/null +++ b/product_status/models/__init__.py @@ -0,0 +1,3 @@ +from . import product_product +from . import product_state +from . import product_template diff --git a/product_status/models/product_product.py b/product_status/models/product_product.py new file mode 100644 index 00000000000..f9f62e597e4 --- /dev/null +++ b/product_status/models/product_product.py @@ -0,0 +1,100 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import api, fields, models +from odoo.orm.domains import Domain + + +class ProductProduct(models.Model): + _inherit = "product.product" + + state = fields.Char( + string="Product Status", + index=True, + compute="_compute_product_state", + inverse="_inverse_product_state", + readonly=True, + store=True, + ) + product_state_id = fields.Many2one( + comodel_name="product.state", + string="State", + help="Select a state for this product", + group_expand="_read_group_state_id", + inverse="_inverse_product_state_id", + default=lambda self: self.product_tmpl_id._get_default_product_state().id, + index=True, + tracking=10, + ) + end_of_life_date = fields.Date( + string="End-of-life", + help="When the product is end-of-life, and you want to warn your " + "client/avoid order in the future.", + ) + discontinued_until = fields.Date( + string="Discontinued until", + help="When the product is discontinued for a certain time, to warn " + "your client/avoid order during this downtime.", + ) + new_until = fields.Date( + string="New until", + help="New product, and you want to warn your client for a certain time", + ) + tmpl_end_of_life_date = fields.Date( + string="Template End-of-life", + related="product_tmpl_id.end_of_life_date", + ) + tmpl_discontinued_until = fields.Date( + string="Template Discontinued until", + related="product_tmpl_id.discontinued_until", + ) + tmpl_new_until = fields.Date( + string="Template New until", + related="product_tmpl_id.new_until", + ) + has_status_date = fields.Boolean( + compute="_compute_has_status_date", + store=False, + ) + + @api.onchange("end_of_life_date") + def _onchange_end_of_life_date(self): + for rec in self: + self.product_tmpl_id._update_dates_of_states(rec, "end_of_life_date") + + @api.onchange("discontinued_until") + def _onchange_discontinued_until(self): + for rec in self: + self.product_tmpl_id._update_dates_of_states(rec, "discontinued_until") + + @api.depends( + "product_state_id", + "new_until", + "end_of_life_date", + "discontinued_until", + "product_tmpl_id.new_until", + "product_tmpl_id.end_of_life_date", + "product_tmpl_id.discontinued_until", + ) + def _compute_product_state(self): + for record in self: + self.product_tmpl_id._check_dates_of_states(record) + + def _inverse_product_state(self): + for product in self: + self.product_tmpl_id._set_product_state_id(product) + + def _inverse_product_state_id(self): + """ + Allow to ease triggering other stuff when product state changes + without a write() + """ + + @api.model + def _read_group_state_id(self, states, domain): + return states.search(Domain.TRUE) + + def _compute_has_status_date(self): + for rec in self: + res = rec.end_of_life_date or rec.discontinued_until or rec.new_until + rec.has_status_date = bool(res) diff --git a/product_status/models/product_state.py b/product_status/models/product_state.py new file mode 100644 index 00000000000..ce40cfb48aa --- /dev/null +++ b/product_status/models/product_state.py @@ -0,0 +1,86 @@ +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models +from odoo.exceptions import ValidationError +from odoo.orm.domains import Domain + + +class ProductState(models.Model): + _inherit = "product.state" + + def write(self, vals): + allow = {"default", "active"} + if not allow.issuperset(set(vals)): + self._check_module_data() + return super().write(vals) + + def unlink(self): + self._check_module_data() + return super().unlink() + + def _check_module_data(self): + if self.env.user._is_superuser(): + return True + default_data = [st.code for st in self._get_module_data()] + msg = self.env._( + "Cannot delete/modified state installed by module, state name: %s" + ) + for rec in self: + if rec.code in default_data: + raise ValidationError(msg % rec.name) + + def _get_module_data(self): + code = ["new", "discontinued", "phaseout", "endoflife"] + return self.env["product.state"].search(Domain("code", "in", code)) + + @api.model + def _domain_recompute_product_state(self): + today = fields.Date.today() + return ( + Domain( + [ + # get 'phaseout' products that should be updated to 'endoflife' + ("end_of_life_date", "!=", False), + ("end_of_life_date", "<", today), + ("state", "=", "phaseout"), + ] + ) + | Domain( + [ + # discontinued + ("discontinued_until", "!=", False), + ("discontinued_until", "<", today), + ("state", "=", "discontinued"), + ] + ) + | Domain( + [ + # get products that aren't 'new' anymore + ("new_until", "!=", False), + ("new_until", "<", today), + ("state", "=", "new"), + ] + ) + ) + + @api.model + def _get_products_recompute_product_state(self): + domain = self._domain_recompute_product_state() + templates = ( + self.env["product.template"].with_context(active_test=False).search(domain) + ) + variants = ( + self.env["product.product"].with_context(active_test=False).search(domain) + ) + return templates, variants + + @api.model + def _cron_recompute_product_state(self): + """Recompute the state of products.""" + templates, variants = self._get_products_recompute_product_state() + for template in templates: + template._check_dates_of_states(template) + for variant in variants: + variant.product_tmpl_id._check_dates_of_states(variant) + return bool(templates or variants) diff --git a/product_status/models/product_template.py b/product_status/models/product_template.py new file mode 100644 index 00000000000..97a3609df7c --- /dev/null +++ b/product_status/models/product_template.py @@ -0,0 +1,74 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import api, fields, models + +other_date_fields = { + "end_of_life_date": {"new_until": False, "discontinued_until": False}, + "discontinued_until": {"new_until": False}, +} + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + end_of_life_date = fields.Date( + string="End-of-life", + help="When the product is end-of-life, and you want to warn your " + "client/avoid order in the future.", + ) + discontinued_until = fields.Date( + string="Discontinued until", + help="When the product is discontinued for a certain time, to warn " + "your client/avoid order during this downtime.", + ) + new_until = fields.Date( + string="New until", + help="New product, and you want to warn your client for a certain time", + ) + + @api.onchange("end_of_life_date") + def _onchange_end_of_life_date(self): + for rec in self: + self._update_dates_of_states(rec, "end_of_life_date") + + @api.onchange("discontinued_until") + def _onchange_discontinued_until(self): + for rec in self: + self._update_dates_of_states(rec, "discontinued_until") + + @api.model + def _update_dates_of_states(self, record, date_field): + if not getattr(record, date_field): + return + record.update(other_date_fields[date_field]) + + @api.depends( + "product_state_id", "new_until", "end_of_life_date", "discontinued_until" + ) + def _compute_product_state(self): + for record in self: + self._check_dates_of_states(record) + + # This method can be called by variant so the record is either + # product.template or product.product + @api.model + def _check_dates_of_states(self, record): + today = fields.Date.today() + if record.end_of_life_date: + if record.end_of_life_date < today: + record.state = "endoflife" + else: + record.state = "phaseout" + elif record.discontinued_until and record.discontinued_until >= today: + record.state = "discontinued" + elif record.new_until and record.new_until >= today: + record.state = "new" + else: + if record._name == "product.template": + product_state = record._get_default_product_state() + else: + product_state = record.product_tmpl_id.product_state_id + record.state = product_state.code + # This is not triggered when assigning value in code. + record._inverse_product_state() diff --git a/product_status/pyproject.toml b/product_status/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_status/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_status/readme/CONTRIBUTORS.md b/product_status/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..daeb08627dc --- /dev/null +++ b/product_status/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- [Camptocamp](https://www.camptocamp.com): + - Thierry Ducrest \<\> + - Simone Orsi \<\> + +- [Trobz](https://trobz.com): + - Son Ho \<\> + - Tuan Nguyen \<\> diff --git a/product_status/readme/CREDITS.md b/product_status/readme/CREDITS.md new file mode 100644 index 00000000000..76784bf5159 --- /dev/null +++ b/product_status/readme/CREDITS.md @@ -0,0 +1,4 @@ +**Financial support** + +- Cosanum +- Camptocamp R&D diff --git a/product_status/readme/DESCRIPTION.md b/product_status/readme/DESCRIPTION.md new file mode 100644 index 00000000000..fec67542821 --- /dev/null +++ b/product_status/readme/DESCRIPTION.md @@ -0,0 +1,13 @@ +This module compute a status on product based on some date field +displayed on the Sales tab. This module will deactivate all default +state in product_state, implement new default data The option to use the +product-attribute/product_state module was considered but because the +status is computed based on today. It does not work well with a stored +fields and also means there is no need for creation of state from the +user. + +By order of importance, the status is computed by: - *End-of-life* - +*Discontinued until* - *New until* + +*End-of-life* has priority over the other dates. *Discontinued-until* +has priority over *New until*. diff --git a/product_status/readme/ROADMAP.md b/product_status/readme/ROADMAP.md new file mode 100644 index 00000000000..2d9ca314056 --- /dev/null +++ b/product_status/readme/ROADMAP.md @@ -0,0 +1,2 @@ +File data/product_state_data.xml will be moved to +demo/product_state_demo.xml since version 15.0 diff --git a/product_status/static/description/icon.png b/product_status/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_status/static/description/icon.png differ diff --git a/product_status/static/description/index.html b/product_status/static/description/index.html new file mode 100644 index 00000000000..1933e03691b --- /dev/null +++ b/product_status/static/description/index.html @@ -0,0 +1,463 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product Status

+ +

Beta License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runboat

+

This module compute a status on product based on some date field +displayed on the Sales tab. This module will deactivate all default +state in product_state, implement new default data The option to use the +product-attribute/product_state module was considered but because the +status is computed based on today. It does not work well with a stored +fields and also means there is no need for creation of state from the +user.

+

By order of importance, the status is computed by: - End-of-life - +Discontinued until - New until

+

End-of-life has priority over the other dates. Discontinued-until +has priority over New until.

+

Table of contents

+ +
+

Known issues / Roadmap

+

File data/product_state_data.xml will be moved to +demo/product_state_demo.xml since version 15.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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

Financial support

+
    +
  • Cosanum
  • +
  • Camptocamp R&D
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/product-attribute project on GitHub.

+

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

+
+
+
+
+ + diff --git a/product_status/tests/__init__.py b/product_status/tests/__init__.py new file mode 100644 index 00000000000..cf12c2b5498 --- /dev/null +++ b/product_status/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_status diff --git a/product_status/tests/test_product_status.py b/product_status/tests/test_product_status.py new file mode 100644 index 00000000000..183b22e11e4 --- /dev/null +++ b/product_status/tests/test_product_status.py @@ -0,0 +1,220 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from freezegun import freeze_time + +from odoo.exceptions import ValidationError +from odoo.tests.common import new_test_user, tagged +from odoo.tests.form import Form + +from odoo.addons.product.tests.common import ProductVariantsCommon + + +@tagged("post_install", "-at_install") +class TestProductStatusCase(ProductVariantsCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product = cls.product_sofa_red + cls.product2 = cls.product_sofa_blue + cls.product_tmpl = cls.product_template_sofa + # Add user to check without superuser permissions + cls.demo_user = new_test_user( + env=cls.env, + login="product_status_demo_user", + groups="base.group_user,product_state.group_product_state_manager", + ) + # To avoid error with filestore and Form test + (cls.product | cls.product2).image_1920 = False + cls.product_tmpl.image_1920 = False + cls.state_model = cls.env["product.state"] + + def test_default(self): + self.assertEqual(self.product.product_state_id.code, "sellable") + + @freeze_time("2020-09-15") + def test_new(self): + self.product.new_until = "2020-09-16" + self.assertEqual(self.product.state, "new") + self.assertEqual(self.product.product_state_id.code, "new") + self.product.new_until = "2020-09-14" + self.assertEqual(self.product.state, "sellable") + self.assertEqual(self.product.product_state_id.code, "sellable") + + @freeze_time("2020-09-15") + def test_product_template_no_specific_state(self): + """Check product template back to default state.""" + self.product_tmpl.new_until = "2020-09-16" + self.assertEqual(self.product_tmpl.state, "new") + self.assertEqual(self.product_tmpl.product_state_id.code, "new") + self.product_tmpl.new_until = "2020-09-14" + self.assertEqual(self.product_tmpl.state, "sellable") + self.assertEqual(self.product_tmpl.product_state_id.code, "sellable") + + @freeze_time("2020-09-15") + def test_discontinued(self): + self.product.discontinued_until = "2020-09-16" + self.assertEqual(self.product.state, "discontinued") + self.assertEqual(self.product.product_state_id.code, "discontinued") + self.assertEqual(self.product2.state, "sellable") + self.product.discontinued_until = "2020-09-14" + self.assertEqual(self.product.state, "sellable") + self.assertEqual(self.product.product_state_id.code, "sellable") + self.assertEqual(self.product2.state, "sellable") + self.product.state = "discontinued" + self.assertEqual(self.product.product_state_id.code, "discontinued") + self.assertEqual(self.product2.state, "sellable") + + @freeze_time("2020-09-15") + def test_eol(self): + self.product.end_of_life_date = "2020-09-14" + self.assertEqual(self.product.state, "endoflife") + self.assertEqual(self.product.product_state_id.code, "endoflife") + self.product.end_of_life_date = "2020-09-16" + self.assertEqual(self.product.state, "phaseout") + self.assertEqual(self.product.product_state_id.code, "phaseout") + + @freeze_time("2020-09-15") + def test_priority(self): + # by order of importance: end_of_life_date, discontinued_until, new_until + self.product.write( + { + "end_of_life_date": "2020-09-14", + "discontinued_until": "2020-09-16", + "new_until": "2020-09-16", + } + ) + # all set, EOL wins + self.assertEqual(self.product.state, "endoflife") + self.assertEqual(self.product.product_state_id.code, "endoflife") + self.product.end_of_life_date = False + # discontinued wins + self.assertEqual(self.product.state, "discontinued") + self.assertEqual(self.product.product_state_id.code, "discontinued") + self.product.discontinued_until = False + self.assertEqual(self.product.state, "new") + self.assertEqual(self.product.product_state_id.code, "new") + + @freeze_time("2020-09-15") + def test_onchange(self): + with Form(self.product) as form: + form.new_until = "2020-09-16" + self.assertEqual(form.product_state_id.code, "new") + form.discontinued_until = "2020-09-16" + self.assertEqual(form.product_state_id.code, "discontinued") + # new_until wiped + self.assertFalse(form.new_until) + form.end_of_life_date = "2020-09-14" + self.assertEqual(form.product_state_id.code, "endoflife") + # other fields wiped when setting EOL + self.assertFalse(form.new_until) + self.assertFalse(form.discontinued_until) + + @freeze_time("2020-09-15") + def test_template_state_dates(self): + group_product_state_manager = self.env.ref( + "product_state.group_product_state_manager" + ) + self.env.user.write({"group_ids": [(4, group_product_state_manager.id)]}) + with Form(self.product_tmpl) as form: + form.new_until = "2020-09-16" + self.assertEqual(form.product_state_id.code, "new") + form.discontinued_until = "2020-09-16" + self.assertEqual(form.product_state_id.code, "discontinued") + # new_until wiped + self.assertFalse(form.new_until) + form.end_of_life_date = "2020-09-14" + self.assertEqual(form.product_state_id.code, "endoflife") + # other fields wiped when setting EOL + self.assertFalse(form.new_until) + self.assertFalse(form.discontinued_until) + + def test_modified_default_data(self): + st_env = self.env["product.state"] + demo_user = self.demo_user + demo_user.group_ids = [ + (4, self.env.ref("product_state.group_product_state_manager").id) + ] + default_state = st_env._get_module_data() + vals = { + "name": "State change", + "code": "Code change", + "default": True, + "active": True, + } + for ds_id in default_state: + vals["code"] = ds_id.code + with self.assertRaises(ValidationError) as cm: + st_env.browse(ds_id.id).with_user(demo_user.id).write(vals) + wn_expect = cm.exception.args[0] + self.assertEqual( + f"Cannot delete/modified state installed by module, " + f"state name: {ds_id.name}", + wn_expect, + ) + with self.assertRaises(ValidationError) as cm: + st_env.browse(ds_id.id).with_user(demo_user.id).unlink() + wn_expect = cm.exception.args[0] + self.assertEqual( + f"Cannot delete/modified state installed by module, " + f"state name: {ds_id.name}", + wn_expect, + ) + # Allow update default value + current_default_state = st_env.search([("default", "=", True)]) + current_default_state = current_default_state.with_user(demo_user.id) + for vals in [ + {"default": False}, + {"active": False}, + {"active": False, "default": False}, + ]: + self.assertTrue(current_default_state.write(vals)) + new_state = st_env.create({"name": "New State", "code": "new_state"}) + new_state.unlink() + + def test_cron_recompute_product_state_endoflife(self): + self.product.end_of_life_date = "2020-09-15" + # compute the value and put it in cache so it's not recomputed + # automatically afterwards + self.product.state # pylint: disable=pointless-statement # noqa: B018 + # starting point, the product hasn't passed its end of life date + with freeze_time("2020-09-15"): + self.product.product_tmpl_id._check_dates_of_states(self.product) + self.assertEqual(self.product.state, "phaseout") + # the next day the product is now flagged 'endoflife' + with freeze_time("2020-09-16"): + __, variants = self.state_model._get_products_recompute_product_state() + self.assertIn(self.product, variants) + self.state_model._cron_recompute_product_state() + self.assertEqual(self.product.state, "endoflife") + + def test_cron_recompute_product_state_discontinued(self): + self.product.discontinued_until = "2020-09-15" + # compute the value and put it in cache so it's not recomputed + # automatically afterwards + self.product.state # pylint: disable=pointless-statement # noqa: B018 + # starting point, the product is flagged as 'discontinued' + with freeze_time("2020-09-15"): + self.product.product_tmpl_id._check_dates_of_states(self.product) + self.assertEqual(self.product.state, "discontinued") + # the next day the product isn't discontinued anymore + with freeze_time("2020-09-16"): + __, variants = self.state_model._get_products_recompute_product_state() + self.assertIn(self.product, variants) + self.state_model._cron_recompute_product_state() + self.assertEqual(self.product.state, "sellable") + + def test_cron_recompute_product_state_new(self): + self.product.new_until = "2020-09-15" + # compute the value and put it in cache so it's not recomputed + # automatically afterwards + self.product.state # pylint: disable=pointless-statement # noqa: B018 + # starting point, the product is flagged as 'new' + with freeze_time("2020-09-15"): + self.product.product_tmpl_id._check_dates_of_states(self.product) + self.assertEqual(self.product.state, "new") + # the next day the product isn't new anymore + with freeze_time("2020-09-16"): + __, variants = self.state_model._get_products_recompute_product_state() + self.assertIn(self.product, variants) + self.state_model._cron_recompute_product_state() + self.assertEqual(self.product.state, "sellable") diff --git a/product_status/views/product_views.xml b/product_status/views/product_views.xml new file mode 100644 index 00000000000..4db6c943e32 --- /dev/null +++ b/product_status/views/product_views.xml @@ -0,0 +1,94 @@ + + + + product.template + + + + + + + + + + + + + + + + + + + + + product.product + + + + + + + + + + + + + + + + + + + + + + + + + product.product + + + + + + + + + + product.template.form.inherit + product.template + + + + + {'clickable': 0} + + + +