From 37db8870c61bc1b9d9ba95378e20e08191bab488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pigeon=20=28ACSONE=29?= Date: Wed, 17 May 2017 00:36:08 +0200 Subject: [PATCH 01/37] re-introduce state field on product (#261) * [10.0] re-introduce state field on product * [ADD] add setup for product state --- product_state/README.rst | 69 ++++++++++++++++++++++++ product_state/__init__.py | 5 ++ product_state/__manifest__.py | 20 +++++++ product_state/models/__init__.py | 5 ++ product_state/models/product_template.py | 17 ++++++ product_state/views/product_views.xml | 15 ++++++ 6 files changed, 131 insertions(+) create mode 100644 product_state/README.rst create mode 100644 product_state/__init__.py create mode 100644 product_state/__manifest__.py create mode 100644 product_state/models/__init__.py create mode 100644 product_state/models/product_template.py create mode 100644 product_state/views/product_views.xml diff --git a/product_state/README.rst b/product_state/README.rst new file mode 100644 index 00000000000..f30ada800e5 --- /dev/null +++ b/product_state/README.rst @@ -0,0 +1,69 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============= +Product State +============= + +In version 10.0 Odoo removes the state field from product. This module re-introduces it and allows simple product life cycle. + +Installation +============ + +To install this module, you need to: + +* Click on install button + +Configuration +============= + +Nothing to configure. + +Usage +===== + +To use this module, you need to: + +* Go to ... + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/135/10.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Cedric Pigeon + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/product_state/__init__.py b/product_state/__init__.py new file mode 100644 index 00000000000..51c0e2c2aff --- /dev/null +++ b/product_state/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py new file mode 100644 index 00000000000..f2d09a1e2a4 --- /dev/null +++ b/product_state/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + 'name': "Product State", + 'description': """ + Module introducing a state field on product template""", + 'author': 'ACSONE SA/NV, Odoo Community Association (OCA)', + 'website': "http://acsone.eu", + 'category': 'Product', + 'version': '10.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'product', + ], + 'data': [ + 'views/product_views.xml', + ], + 'application': True, +} diff --git a/product_state/models/__init__.py b/product_state/models/__init__.py new file mode 100644 index 00000000000..53ae6c068ea --- /dev/null +++ b/product_state/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import product_template diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py new file mode 100644 index 00000000000..28e58a4d41c --- /dev/null +++ b/product_state/models/product_template.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + state = fields.Selection(selection=[('draft', 'In Development'), + ('sellable', 'Normal'), + ('end', 'End of Lifecycle'), + ('obsolete', 'Obsolete')], + string='Status', + default='sellable', + index=True) diff --git a/product_state/views/product_views.xml b/product_state/views/product_views.xml new file mode 100644 index 00000000000..83fc32509cb --- /dev/null +++ b/product_state/views/product_views.xml @@ -0,0 +1,15 @@ + + + + product.template.common.form + product.template + + + +
+ +
+
+
+
+
From b0c32222ad2a969391d39619aab1cd6c717331d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pigeon?= Date: Fri, 14 Jul 2017 18:45:06 +0200 Subject: [PATCH 02/37] add product state on tree view --- product_state/i18n/de.po | 50 ++++++++++++++++++++++++++ product_state/i18n/es.po | 51 +++++++++++++++++++++++++++ product_state/i18n/fr.po | 51 +++++++++++++++++++++++++++ product_state/i18n/hr.po | 50 ++++++++++++++++++++++++++ product_state/i18n/nl_NL.po | 50 ++++++++++++++++++++++++++ product_state/i18n/sl.po | 50 ++++++++++++++++++++++++++ product_state/views/product_views.xml | 12 +++++++ 7 files changed, 314 insertions(+) create mode 100644 product_state/i18n/de.po create mode 100644 product_state/i18n/es.po create mode 100644 product_state/i18n/fr.po create mode 100644 product_state/i18n/hr.po create mode 100644 product_state/i18n/nl_NL.po create mode 100644 product_state/i18n/sl.po diff --git a/product_state/i18n/de.po b/product_state/i18n/de.po new file mode 100644 index 00000000000..5a5757e2bc0 --- /dev/null +++ b/product_state/i18n/de.po @@ -0,0 +1,50 @@ +# 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: 2017-05-17 02:38+0000\n" +"Last-Translator: Niki Waibel , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_state +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Produktvorlage" + +#. 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 "Status" +msgstr "" diff --git a/product_state/i18n/es.po b/product_state/i18n/es.po new file mode 100644 index 00000000000..785cc2d13bb --- /dev/null +++ b/product_state/i18n/es.po @@ -0,0 +1,51 @@ +# 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: 2018-01-29 08:49+0000\n" +"Last-Translator: enjolras , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_state +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "Fin del ciclo de vida" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "En desarrollo" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "Obsoleto" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Plantilla de producto" + +#. 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 "Status" +msgstr "Estado" diff --git a/product_state/i18n/fr.po b/product_state/i18n/fr.po new file mode 100644 index 00000000000..81cfc3abf15 --- /dev/null +++ b/product_state/i18n/fr.po @@ -0,0 +1,51 @@ +# 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: 2017-07-29 02:55+0000\n" +"Last-Translator: guillaume bauer , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: product_state +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "Fin de vie" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "Phase de recherche et de développement" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "Obsolète" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Modèle de produit" + +#. 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 "Status" +msgstr "Statut" diff --git a/product_state/i18n/hr.po b/product_state/i18n/hr.po new file mode 100644 index 00000000000..a878ca33733 --- /dev/null +++ b/product_state/i18n/hr.po @@ -0,0 +1,50 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\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 +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "Kraj životnog ciklusa" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "U razvoju" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "Normalno" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "Zastarjelo" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Predložak proizvoda" + +#. 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 "Status" +msgstr "Status" diff --git a/product_state/i18n/nl_NL.po b/product_state/i18n/nl_NL.po new file mode 100644 index 00000000000..bf4b8b0fb9e --- /dev/null +++ b/product_state/i18n/nl_NL.po @@ -0,0 +1,50 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_state +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Productsjabloon" + +#. 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 "Status" +msgstr "" diff --git a/product_state/i18n/sl.po b/product_state/i18n/sl.po new file mode 100644 index 00000000000..e528717e9b8 --- /dev/null +++ b/product_state/i18n/sl.po @@ -0,0 +1,50 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: product_state +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Predloga proizvoda" + +#. 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 "Status" +msgstr "" diff --git a/product_state/views/product_views.xml b/product_state/views/product_views.xml index 83fc32509cb..60572c32289 100644 --- a/product_state/views/product_views.xml +++ b/product_state/views/product_views.xml @@ -12,4 +12,16 @@ + + + product.template.tree (product_state) + product.template + + 50 + + + + + + From 60f424bacc43b3b1b4b665bc49db8eb912c59e50 Mon Sep 17 00:00:00 2001 From: Alexandre Saunier Date: Tue, 10 Apr 2018 14:55:08 +0200 Subject: [PATCH 03/37] product_state: Migration to 11.0 --- product_state/README.rst | 22 +++--------- product_state/__init__.py | 3 +- product_state/__manifest__.py | 7 ++-- product_state/i18n/de.po | 4 +-- product_state/i18n/es.po | 4 +-- product_state/i18n/fr.po | 4 +-- product_state/i18n/hr.po | 7 ++-- product_state/i18n/nl_NL.po | 7 ++-- product_state/i18n/product_state.pot | 46 ++++++++++++++++++++++++ product_state/i18n/sl.po | 7 ++-- product_state/models/__init__.py | 3 +- product_state/models/product_template.py | 3 +- product_state/views/product_views.xml | 4 +-- 13 files changed, 77 insertions(+), 44 deletions(-) create mode 100644 product_state/i18n/product_state.pot diff --git a/product_state/README.rst b/product_state/README.rst index f30ada800e5..e548f995d4a 100644 --- a/product_state/README.rst +++ b/product_state/README.rst @@ -6,19 +6,7 @@ Product State ============= -In version 10.0 Odoo removes the state field from product. This module re-introduces it and allows simple product life cycle. - -Installation -============ - -To install this module, you need to: - -* Click on install button - -Configuration -============= - -Nothing to configure. +This module introduces the state field on product template and allows simple product life cycle. Usage ===== @@ -29,7 +17,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/135/10.0 + :target: https://runbot.odoo-community.org/runbot/135/11.0 Bug Tracker =========== @@ -37,8 +25,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback -`_. +help us smash it by providing detailed and welcomed feedback. Credits ======= @@ -52,6 +39,7 @@ Contributors ------------ * Cedric Pigeon +* Alexandre Saunier Maintainer ---------- @@ -66,4 +54,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file +To contribute to this module, please visit https://odoo-community.org. diff --git a/product_state/__init__.py b/product_state/__init__.py index 51c0e2c2aff..75476a9ff32 100644 --- a/product_state/__init__.py +++ b/product_state/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV () -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py index f2d09a1e2a4..94af6e9ad3a 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -1,14 +1,13 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV () -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { 'name': "Product State", 'description': """ Module introducing a state field on product template""", 'author': 'ACSONE SA/NV, Odoo Community Association (OCA)', - 'website': "http://acsone.eu", + 'website': "https://github.com/OCA/product-attribute", 'category': 'Product', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'product', diff --git a/product_state/i18n/de.po b/product_state/i18n/de.po index 5a5757e2bc0..ac35e0aa0c2 100644 --- a/product_state/i18n/de.po +++ b/product_state/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_state -# +# # Translators: # Niki Waibel , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-05-17 02:38+0000\n" "Last-Translator: Niki Waibel , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_state diff --git a/product_state/i18n/es.po b/product_state/i18n/es.po index 785cc2d13bb..53b59997005 100644 --- a/product_state/i18n/es.po +++ b/product_state/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_state -# +# # Translators: # Pedro M. Baeza , 2018 # enjolras , 2018 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2018-01-29 08:49+0000\n" "Last-Translator: enjolras , 2018\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" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_state diff --git a/product_state/i18n/fr.po b/product_state/i18n/fr.po index 81cfc3abf15..237a96fea0b 100644 --- a/product_state/i18n/fr.po +++ b/product_state/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_state -# +# # Translators: # OCA Transbot , 2017 # guillaume bauer , 2017 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2017-07-29 02:55+0000\n" "Last-Translator: guillaume bauer , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: product_state diff --git a/product_state/i18n/hr.po b/product_state/i18n/hr.po index a878ca33733..18fd29d4d48 100644 --- a/product_state/i18n/hr.po +++ b/product_state/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_state -# +# # Translators: # Bole , 2018 msgid "" @@ -12,11 +12,12 @@ msgstr "" "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" -"Language: hr\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" +"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 #: selection:product.template,state:0 diff --git a/product_state/i18n/nl_NL.po b/product_state/i18n/nl_NL.po index bf4b8b0fb9e..54b8429a6f1 100644 --- a/product_state/i18n/nl_NL.po +++ b/product_state/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_state -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "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-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_state diff --git a/product_state/i18n/product_state.pot b/product_state/i18n/product_state.pot new file mode 100644 index 00000000000..bd4caa3e84e --- /dev/null +++ b/product_state/i18n/product_state.pot @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_state +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 "Status" +msgstr "" + diff --git a/product_state/i18n/sl.po b/product_state/i18n/sl.po index e528717e9b8..79db4e2e50a 100644 --- a/product_state/i18n/sl.po +++ b/product_state/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * product_state -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -12,11 +12,12 @@ msgstr "" "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" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: product_state #: selection:product.template,state:0 diff --git a/product_state/models/__init__.py b/product_state/models/__init__.py index 53ae6c068ea..437a4f052e7 100644 --- a/product_state/models/__init__.py +++ b/product_state/models/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV () -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import product_template diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index 28e58a4d41c..8895ec54364 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV () -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields diff --git a/product_state/views/product_views.xml b/product_state/views/product_views.xml index 60572c32289..aa8729e440b 100644 --- a/product_state/views/product_views.xml +++ b/product_state/views/product_views.xml @@ -19,9 +19,9 @@ 50 - + - + From d1e282cd3e9bd99db801f816e1235fc4ec4200c8 Mon Sep 17 00:00:00 2001 From: Nikul-Chaudhary Date: Tue, 29 Jan 2019 22:59:31 +0530 Subject: [PATCH 04/37] [MIG] product_state v11 to v12 --- product_state/README.rst | 70 ++-- product_state/__init__.py | 1 - product_state/__manifest__.py | 4 +- product_state/i18n/de.po | 4 +- product_state/i18n/es.po | 4 +- product_state/i18n/fr.po | 4 +- product_state/i18n/hr.po | 4 +- product_state/i18n/nl_NL.po | 4 +- product_state/i18n/product_state.pot | 6 +- product_state/i18n/sl.po | 4 +- product_state/models/product_template.py | 16 +- product_state/readme/CONTRIBUTORS.rst | 3 + product_state/readme/DESCRIPTION.rst | 1 + product_state/static/description/icon.png | Bin 0 -> 9455 bytes product_state/static/description/index.html | 421 ++++++++++++++++++++ product_state/views/product_views.xml | 2 + 16 files changed, 497 insertions(+), 51 deletions(-) create mode 100644 product_state/readme/CONTRIBUTORS.rst create mode 100644 product_state/readme/DESCRIPTION.rst create mode 100644 product_state/static/description/icon.png create mode 100644 product_state/static/description/index.html diff --git a/product_state/README.rst b/product_state/README.rst index e548f995d4a..682f1426052 100644 --- a/product_state/README.rst +++ b/product_state/README.rst @@ -1,57 +1,75 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ============= Product State ============= -This module introduces the state field on product template and allows simple product life cycle. - -Usage -===== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/12.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-12-0/product-attribute-12-0-product_state + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/135/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| -To use this module, you need to: +This module introduces the state field on product template and allows simple product life cycle. -* Go to ... +**Table of contents** -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/135/11.0 +.. contents:: + :local: Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smash it by providing detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* ACSONE SA/NV Contributors ------------- +~~~~~~~~~~~~ * Cedric Pigeon * Alexandre Saunier +* Nikul Chaudhary -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +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 index 75476a9ff32..4b76c7b2d5c 100644 --- a/product_state/__init__.py +++ b/product_state/__init__.py @@ -1,4 +1,3 @@ -# Copyright 2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py index 94af6e9ad3a..485aeadf509 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -2,12 +2,12 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { 'name': "Product State", - 'description': """ + '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': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'product', diff --git a/product_state/i18n/de.po b/product_state/i18n/de.po index ac35e0aa0c2..cb155622236 100644 --- a/product_state/i18n/de.po +++ b/product_state/i18n/de.po @@ -44,7 +44,7 @@ msgid "Product Template" msgstr "Produktvorlage" #. 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 +#: 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 "Status" msgstr "" diff --git a/product_state/i18n/es.po b/product_state/i18n/es.po index 53b59997005..d12889b893b 100644 --- a/product_state/i18n/es.po +++ b/product_state/i18n/es.po @@ -45,7 +45,7 @@ msgid "Product Template" msgstr "Plantilla de producto" #. 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 +#: 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 "Status" msgstr "Estado" diff --git a/product_state/i18n/fr.po b/product_state/i18n/fr.po index 237a96fea0b..7273ec0aa0e 100644 --- a/product_state/i18n/fr.po +++ b/product_state/i18n/fr.po @@ -45,7 +45,7 @@ msgid "Product Template" msgstr "Modèle de produit" #. 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 +#: 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 "Status" msgstr "Statut" diff --git a/product_state/i18n/hr.po b/product_state/i18n/hr.po index 18fd29d4d48..104e5de2704 100644 --- a/product_state/i18n/hr.po +++ b/product_state/i18n/hr.po @@ -45,7 +45,7 @@ msgid "Product Template" msgstr "Predložak proizvoda" #. 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 +#: 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 "Status" msgstr "Status" diff --git a/product_state/i18n/nl_NL.po b/product_state/i18n/nl_NL.po index 54b8429a6f1..2c1f074b735 100644 --- a/product_state/i18n/nl_NL.po +++ b/product_state/i18n/nl_NL.po @@ -45,7 +45,7 @@ msgid "Product Template" msgstr "Productsjabloon" #. 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 +#: 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 "Status" msgstr "" diff --git a/product_state/i18n/product_state.pot b/product_state/i18n/product_state.pot index bd4caa3e84e..b5dafa67326 100644 --- a/product_state/i18n/product_state.pot +++ b/product_state/i18n/product_state.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -39,8 +39,8 @@ msgid "Product Template" 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 +#: 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 "Status" msgstr "" diff --git a/product_state/i18n/sl.po b/product_state/i18n/sl.po index 79db4e2e50a..e600d663259 100644 --- a/product_state/i18n/sl.po +++ b/product_state/i18n/sl.po @@ -45,7 +45,7 @@ msgid "Product Template" msgstr "Predloga proizvoda" #. 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 +#: 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 "Status" msgstr "" diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index 8895ec54364..b6335069e7e 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -7,10 +7,12 @@ class ProductTemplate(models.Model): _inherit = 'product.template' - state = fields.Selection(selection=[('draft', 'In Development'), - ('sellable', 'Normal'), - ('end', 'End of Lifecycle'), - ('obsolete', 'Obsolete')], - string='Status', - default='sellable', - index=True) + state = fields.Selection(selection=[ + ('draft', 'In Development'), + ('sellable', 'Normal'), + ('end', 'End of Lifecycle'), + ('obsolete', 'Obsolete')], + string='Status', + default='sellable', + index=True + ) diff --git a/product_state/readme/CONTRIBUTORS.rst b/product_state/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..f3e9390dc98 --- /dev/null +++ b/product_state/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Cedric Pigeon +* Alexandre Saunier +* Nikul Chaudhary diff --git a/product_state/readme/DESCRIPTION.rst b/product_state/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..b77483eb3f6 --- /dev/null +++ b/product_state/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module introduces the state field on product template and allows simple product life cycle. diff --git a/product_state/static/description/icon.png b/product_state/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 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 z 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 Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/product_state/static/description/index.html b/product_state/static/description/index.html new file mode 100644 index 00000000000..c410ca92d48 --- /dev/null +++ b/product_state/static/description/index.html @@ -0,0 +1,421 @@ + + + + + + +Product State + + + +
+

Product State

+ + +

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

+

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

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing 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

+ +
+
+

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_state/views/product_views.xml b/product_state/views/product_views.xml index aa8729e440b..cb0124896a3 100644 --- a/product_state/views/product_views.xml +++ b/product_state/views/product_views.xml @@ -1,5 +1,6 @@ + product.template.common.form product.template @@ -24,4 +25,5 @@
+ From 5f5ed1d0b997cc38ff514069da0ed9464afda183 Mon Sep 17 00:00:00 2001 From: Xavier Brochard Date: Sat, 19 Oct 2019 10:49:11 +0200 Subject: [PATCH 05/37] describe the state field I've added both field content and help to ease understand the possibilities (draft and sellable have different meaning than In Development and Normal --- product_state/readme/DESCRIPTION.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/product_state/readme/DESCRIPTION.rst b/product_state/readme/DESCRIPTION.rst index b77483eb3f6..8e667db1423 100644 --- a/product_state/readme/DESCRIPTION.rst +++ b/product_state/readme/DESCRIPTION.rst @@ -1 +1,6 @@ -This module introduces the state field on product template and allows simple product life cycle. +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 From 54e44e4e710b07ed2ed370a1c9a7773dccd48ce3 Mon Sep 17 00:00:00 2001 From: Xavier Brochard Date: Sat, 19 Oct 2019 21:38:29 +0200 Subject: [PATCH 06/37] remove space before ":" --- product_state/README.rst | 7 ++++++- product_state/readme/DESCRIPTION.rst | 10 +++++----- product_state/static/description/index.html | 8 +++++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/product_state/README.rst b/product_state/README.rst index 682f1426052..834fcd99180 100644 --- a/product_state/README.rst +++ b/product_state/README.rst @@ -25,7 +25,12 @@ Product State |badge1| |badge2| |badge3| |badge4| |badge5| -This module introduces the state field on product template and allows simple product life cycle. +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** diff --git a/product_state/readme/DESCRIPTION.rst b/product_state/readme/DESCRIPTION.rst index 8e667db1423..3e27c2300f9 100644 --- a/product_state/readme/DESCRIPTION.rst +++ b/product_state/readme/DESCRIPTION.rst @@ -1,6 +1,6 @@ -This module introduces the state field on product template and allows simple product life cycle : +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 +- draft: In Development +- sellable: Normal +- end: End of Lifecycle +- obsolete: Obsolete diff --git a/product_state/static/description/index.html b/product_state/static/description/index.html index c410ca92d48..5e78461ee6e 100644 --- a/product_state/static/description/index.html +++ b/product_state/static/description/index.html @@ -368,7 +368,13 @@

Product State

!! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

-

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

+

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

    From e64196b591b10d3049419b7c647d43df03c93a2f Mon Sep 17 00:00:00 2001 From: Pedro Castro Silva Date: Mon, 23 Mar 2020 11:49:23 +0000 Subject: [PATCH 07/37] Added translation using Weblate (Portuguese) Currently translated at 100.0% (6 of 6 strings) Translation: product-attribute-12.0/product-attribute-12.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_state/pt/ --- product_state/i18n/pt.po | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 product_state/i18n/pt.po diff --git a/product_state/i18n/pt.po b/product_state/i18n/pt.po new file mode 100644 index 00000000000..891170e0b57 --- /dev/null +++ b/product_state/i18n/pt.po @@ -0,0 +1,48 @@ +# 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 +#: selection:product.template,state:0 +msgid "End of Lifecycle" +msgstr "Fim de Ciclo de Vida" + +#. module: product_state +#: selection:product.template,state:0 +msgid "In Development" +msgstr "Em Desenvolvimento" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Normal" +msgstr "Normal" + +#. module: product_state +#: selection:product.template,state:0 +msgid "Obsolete" +msgstr "Obsoleto" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Modelo de Produto" + +#. 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 "Status" +msgstr "Estado" From f8744be0f83bb15183a91a798153a457ab4ba401 Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Wed, 17 Jun 2020 15:21:11 +0200 Subject: [PATCH 08/37] [MIG] product_state to v13 --- product_state/__manifest__.py | 4 ++-- product_state/models/product_template.py | 13 ++++++++----- .../{product_views.xml => product_template.xml} | 8 +++----- 3 files changed, 13 insertions(+), 12 deletions(-) rename product_state/views/{product_views.xml => product_template.xml} (82%) diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py index 485aeadf509..c2e7c741559 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -7,13 +7,13 @@ 'author': 'ACSONE SA/NV, Odoo Community Association (OCA)', 'website': "https://github.com/OCA/product-attribute", 'category': 'Product', - 'version': '12.0.1.0.0', + 'version': '13.0.1.0.0', 'license': 'AGPL-3', 'depends': [ 'product', ], 'data': [ - 'views/product_views.xml', + 'views/product_template.xml', ], 'application': True, } diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index b6335069e7e..f04bfccce03 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -5,13 +5,16 @@ class ProductTemplate(models.Model): + _inherit = 'product.template' - state = fields.Selection(selection=[ - ('draft', 'In Development'), - ('sellable', 'Normal'), - ('end', 'End of Lifecycle'), - ('obsolete', 'Obsolete')], + state = fields.Selection( + selection=[ + ('draft', 'In Development'), + ('sellable', 'Normal'), + ('end', 'End of Lifecycle'), + ('obsolete', 'Obsolete') + ], string='Status', default='sellable', index=True diff --git a/product_state/views/product_views.xml b/product_state/views/product_template.xml similarity index 82% rename from product_state/views/product_views.xml rename to product_state/views/product_template.xml index cb0124896a3..5744c04cd5d 100644 --- a/product_state/views/product_views.xml +++ b/product_state/views/product_template.xml @@ -6,11 +6,9 @@ product.template - -
    - -
    -
    +
    + +
    From c23f86bd21ed246aa7e9db70e3497bf413843097 Mon Sep 17 00:00:00 2001 From: emagdalena Date: Sat, 7 Mar 2020 15:39:56 +0100 Subject: [PATCH 09/37] [IMP] product_state --- product_state/__init__.py | 14 +++ product_state/__manifest__.py | 9 +- product_state/data/product_state_data.xml | 26 ++++ product_state/models/product_template.py | 73 +++++++++-- product_state/readme/CONTRIBUTORS.rst | 2 + product_state/readme/USAGE.rst | 9 ++ product_state/security/ir.model.access.csv | 3 + product_state/views/product_template.xml | 137 ++++++++++++++++++++- 8 files changed, 254 insertions(+), 19 deletions(-) create mode 100644 product_state/data/product_state_data.xml create mode 100644 product_state/readme/USAGE.rst create mode 100644 product_state/security/ir.model.access.csv diff --git a/product_state/__init__.py b/product_state/__init__.py index 4b76c7b2d5c..92481f7ef36 100644 --- a/product_state/__init__.py +++ b/product_state/__init__.py @@ -1,3 +1,17 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models + + +from odoo import api, SUPERUSER_ID + + +def post_init_hook(cr, registry): + """ This hook is used to add a state on existing products + when module product_state is installed. + """ + env = api.Environment(cr, SUPERUSER_ID, {}) + product_without_state = env["product.template"].search( + [("product_state_id", "=", False), ("state", "!=", False),] + ) + product_without_state._inverse_product_state() diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py index c2e7c741559..b5d1620048c 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -1,8 +1,8 @@ # Copyright 2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { - 'name': "Product State", - 'summary': """ + "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", @@ -11,9 +11,14 @@ 'license': 'AGPL-3', 'depends': [ 'product', + 'sale', ], 'data': [ + 'data/product_state_data.xml', + 'security/ir.model.access.csv', 'views/product_template.xml', ], 'application': True, + "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..90a0a76320c --- /dev/null +++ b/product_state/data/product_state_data.xml @@ -0,0 +1,26 @@ + + + + + + draft + In Development + 10 + + + sellable + Normal + 20 + + + end + End of Lifecycle + 30 + + + obsolete + Obsolete + 40 + + + diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index f04bfccce03..94ae7742da0 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -1,21 +1,72 @@ # Copyright 2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import api, models, fields + + +class ProductState(models.Model): + _name = "product.state" + _description = "Product State" + _order = "sequence, id" + + name = fields.Char("State Name", required=True, translate=True) + code = fields.Char("State Code", required=True) + sequence = fields.Integer("Sequence", help="Used to order the States", default=25) + description = fields.Text(translate=True) + product_ids = fields.One2many( + "product.template", "product_state_id", string="State Products", + ) + products_count = fields.Integer( + string="Number of products", compute="_compute_products_count", + ) + + _sql_constraints = [ + ("code_unique", "UNIQUE(code)", "Product State Code must be unique.") + ] + + @api.depends("product_ids") + def _compute_products_count(self): + data = self.env["product.template"].read_group( + [("product_state_id", "in", self.ids)], + ["product_state_id"], + ["product_state_id"], + ) + mapped_data = { + record["product_state_id"][0]: record["product_state_id_count"] + for record in data + } + for state in self: + state.products_count = mapped_data.get(state.id, 0) class ProductTemplate(models.Model): _inherit = 'product.template' - state = fields.Selection( - selection=[ - ('draft', 'In Development'), - ('sellable', 'Normal'), - ('end', 'End of Lifecycle'), - ('obsolete', 'Obsolete') - ], - string='Status', - default='sellable', - index=True + state = fields.Char( + string="Product Status", + index=True, + compute="_compute_product_state", + inverse="_inverse_product_state", + store=True, + ) + product_state_id = fields.Many2one( + comodel_name="product.state", + string="State", + help="Select a state for this product", ) + + @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): + ProductState = self.env["product.state"] + for product_tmpl in self: + product_state = ProductState.search( + [("code", "=", product_tmpl.state)], limit=1 + ) + if product_tmpl.state and not product_state: + product_state = ProductState.create({"name": product_tmpl.state}) + product_tmpl.product_state_id = product_state.id diff --git a/product_state/readme/CONTRIBUTORS.rst b/product_state/readme/CONTRIBUTORS.rst index f3e9390dc98..ce54243ee34 100644 --- a/product_state/readme/CONTRIBUTORS.rst +++ b/product_state/readme/CONTRIBUTORS.rst @@ -1,3 +1,5 @@ * Cedric Pigeon * Alexandre Saunier * Nikul Chaudhary +* Eduardo Magdalena (C2i Change 2 improve http://www.c2i.es) +* Andrii Skrypka diff --git a/product_state/readme/USAGE.rst b/product_state/readme/USAGE.rst new file mode 100644 index 00000000000..1c5324f8c6b --- /dev/null +++ b/product_state/readme/USAGE.rst @@ -0,0 +1,9 @@ +To create a new state: + +#. Go to *Sales > Configuration > Products > Product States*. +#. You can set its name and a description. + +To add a product to a state: + +#. Go to the product itself and edit. +#. 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..742e0231611 --- /dev/null +++ b/product_state/security/ir.model.access.csv @@ -0,0 +1,3 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_product_state_product_manager","product.state","model_product_state","base.group_partner_manager",1,1,1,1 +"access_product_state_public","product.state.public","model_product_state",,1,0,0,0 diff --git a/product_state/views/product_template.xml b/product_state/views/product_template.xml index 5744c04cd5d..3c244ca3888 100644 --- a/product_state/views/product_template.xml +++ b/product_state/views/product_template.xml @@ -1,27 +1,152 @@ - + + product.state.search.form + product.state + + + + + + + + + + + + + product.state.form + product.state + +
    + +
    + +
    +
    +
    + + + + + + +
    +
    +
    +
    + + + product.state.tree + product.state + + + + + + + + + + product.state.kanban + product.state + + + + + + + +
    +
    +

    + +

    + +
    +
    +
    +
    +
    +
    +
    + + + product.template.search.state + product.template + + + + + + + + + + + product.template.common.form product.template
    - + +
    - - product.template.tree (product_state) + + product.template.tree (product_state_id) product.template 50 - - + + + State + product.state + form + kanban,form,tree + + + +
    From c0f52a78b90e6aee43057d2f2c5a4e7b9e267564 Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Wed, 17 Jun 2020 16:13:01 +0200 Subject: [PATCH 10/37] [CHG] some code cleaning to make it v13 compliant --- product_state/README.rst | 33 +++- product_state/__init__.py | 4 +- product_state/__manifest__.py | 26 ++- product_state/data/product_state_data.xml | 31 ++-- product_state/i18n/de.po | 146 ++++++++++++++++- product_state/i18n/es.po | 150 ++++++++++++++++- product_state/i18n/fr.po | 150 ++++++++++++++++- product_state/i18n/hr.po | 150 ++++++++++++++++- product_state/i18n/nl_NL.po | 146 ++++++++++++++++- product_state/i18n/product_state.pot | 143 ++++++++++++++-- product_state/i18n/pt.po | 152 +++++++++++++++++- product_state/i18n/sl.po | 146 ++++++++++++++++- .../migrations/13.0.1.0.0/post-migration.py | 10 ++ product_state/models/__init__.py | 2 +- product_state/models/product_state.py | 43 +++++ product_state/models/product_template.py | 44 +---- product_state/static/description/index.html | 44 +++-- product_state/views/product_template.xml | 131 ++++++++------- 18 files changed, 1342 insertions(+), 209 deletions(-) create mode 100644 product_state/migrations/13.0.1.0.0/post-migration.py create mode 100644 product_state/models/product_state.py diff --git a/product_state/README.rst b/product_state/README.rst index 834fcd99180..418929a8a5c 100644 --- a/product_state/README.rst +++ b/product_state/README.rst @@ -14,13 +14,13 @@ Product State :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/12.0/product_state + :target: https://github.com/OCA/product-attribute/tree/13.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-12-0/product-attribute-12-0-product_state + :target: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/135/12.0 + :target: https://runbot.odoo-community.org/runbot/135/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -37,13 +37,26 @@ This module introduces the state field on product template and allows simple pro .. contents:: :local: +Usage +===== + +To create a new state: + +#. Go to *Sales > Configuration > Products > Product States*. +#. You can set its name and a description. + +To add a product to a state: + +#. Go to the product itself and edit. +#. 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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -61,6 +74,8 @@ Contributors * Cedric Pigeon * Alexandre Saunier * Nikul Chaudhary +* Eduardo Magdalena (C2i Change 2 improve http://www.c2i.es) +* Andrii Skrypka Maintainers ~~~~~~~~~~~ @@ -75,6 +90,14 @@ 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. +.. |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 index 92481f7ef36..a3b9286ff0d 100644 --- a/product_state/__init__.py +++ b/product_state/__init__.py @@ -11,7 +11,9 @@ def post_init_hook(cr, registry): when module product_state is installed. """ env = api.Environment(cr, SUPERUSER_ID, {}) + product_without_state = env["product.template"].search([("state", "=", False)]) + product_without_state.write({"state": "sellable"}) product_without_state = env["product.template"].search( - [("product_state_id", "=", False), ("state", "!=", False),] + [("product_state_id", "=", False)] ) product_without_state._inverse_product_state() diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py index b5d1620048c..34851d36a36 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -4,21 +4,19 @@ "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': '13.0.1.0.0', - 'license': 'AGPL-3', - 'depends': [ - 'product', - 'sale', + "author": "ACSONE SA/NV, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/product-attribute", + "category": "Product", + "version": "13.0.1.0.1", + "license": "AGPL-3", + "depends": ["product", "sale"], + "data": [ + "security/ir.model.access.csv", + "data/product_state_data.xml", + "security/ir.model.access.csv", + "views/product_template.xml", ], - 'data': [ - 'data/product_state_data.xml', - 'security/ir.model.access.csv', - 'views/product_template.xml', - ], - 'application': True, + "application": True, "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 index 90a0a76320c..88681a8c4bc 100644 --- a/product_state/data/product_state_data.xml +++ b/product_state/data/product_state_data.xml @@ -1,26 +1,23 @@ - - - - + + - draft - In Development - 10 + draft + In Development + 10 - sellable - Normal - 20 + sellable + Normal + 20 - end - End of Lifecycle - 30 + end + End of Lifecycle + 30 - obsolete - Obsolete - 40 + obsolete + Obsolete + 40 - diff --git a/product_state/i18n/de.po b/product_state/i18n/de.po index cb155622236..af846e871f0 100644 --- a/product_state/i18n/de.po +++ b/product_state/i18n/de.po @@ -19,32 +19,164 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 -#: selection:product.template,state:0 +#: 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 -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 -#: selection:product.template,state:0 +#: 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 Template" +#: 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 Template" +msgid "Product State" +msgstr "Produktvorlage" + +#. 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:ir.ui.menu,name:product_state.menu_product_state +#, fuzzy +#| msgid "Product Template" +msgid "Product States" msgstr "Produktvorlage" #. 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 "Status" +#, fuzzy +#| msgid "Product Template" +msgid "Product Status" +msgstr "Produktvorlage" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Produktvorlage" + +#. 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 +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +#, fuzzy +#| msgid "Product Template" +msgid "product.state" +msgstr "Produktvorlage" diff --git a/product_state/i18n/es.po b/product_state/i18n/es.po index d12889b893b..e91c977efce 100644 --- a/product_state/i18n/es.po +++ b/product_state/i18n/es.po @@ -20,32 +20,168 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 "Fin del ciclo de vida" #. module: product_state -#: selection:product.template,state:0 +#: 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 "En desarrollo" #. module: product_state -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 "Normal" #. module: product_state -#: selection:product.template,state:0 +#: 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 Template" +#: 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 Template" +msgid "Product State" +msgstr "Plantilla de producto" + +#. 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:ir.ui.menu,name:product_state.menu_product_state +#, fuzzy +#| msgid "Product Template" +msgid "Product States" msgstr "Plantilla de producto" #. 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 "Status" +#, fuzzy +#| msgid "Product Template" +msgid "Product Status" +msgstr "Plantilla de producto" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 "" + +#. 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 "Status" +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 "Status" +msgid "State Products" msgstr "Estado" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +#, fuzzy +#| msgid "Product Template" +msgid "product.state" +msgstr "Plantilla de producto" diff --git a/product_state/i18n/fr.po b/product_state/i18n/fr.po index 7273ec0aa0e..69ae2d110db 100644 --- a/product_state/i18n/fr.po +++ b/product_state/i18n/fr.po @@ -20,32 +20,168 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 "Fin de vie" #. module: product_state -#: selection:product.template,state:0 +#: 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 "Phase de recherche et de développement" #. module: product_state -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 "Normal" #. module: product_state -#: selection:product.template,state:0 +#: 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 "Obsolète" #. module: product_state -#: model:ir.model,name:product_state.model_product_template -msgid "Product Template" +#: 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 Template" +msgid "Product State" +msgstr "Modèle de produit" + +#. 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:ir.ui.menu,name:product_state.menu_product_state +#, fuzzy +#| msgid "Product Template" +msgid "Product States" msgstr "Modèle de produit" #. 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 "Status" +#, fuzzy +#| msgid "Product Template" +msgid "Product Status" +msgstr "Modèle de produit" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +msgstr "Modèle de produit" + +#. 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 "Status" +msgid "State" +msgstr "Statut" + +#. 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 "Status" +msgid "State Products" msgstr "Statut" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +#, fuzzy +#| msgid "Product Template" +msgid "product.state" +msgstr "Modèle de produit" diff --git a/product_state/i18n/hr.po b/product_state/i18n/hr.po index 104e5de2704..b2b10378efd 100644 --- a/product_state/i18n/hr.po +++ b/product_state/i18n/hr.po @@ -20,32 +20,168 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 -#: selection:product.template,state:0 +#: 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 -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 "Normalno" #. module: product_state -#: selection:product.template,state:0 +#: 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 Template" +#: 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 Template" +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:ir.ui.menu,name:product_state.menu_product_state +#, fuzzy +#| msgid "Product Template" +msgid "Product States" msgstr "Predložak proizvoda" #. 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 "Status" +#, fuzzy +#| msgid "Product Template" +msgid "Product Status" +msgstr "Predložak proizvoda" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 "Status" +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 "Status" +msgid "State Products" msgstr "Status" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +#, fuzzy +#| msgid "Product Template" +msgid "product.state" +msgstr "Predložak proizvoda" diff --git a/product_state/i18n/nl_NL.po b/product_state/i18n/nl_NL.po index 2c1f074b735..f666f958e59 100644 --- a/product_state/i18n/nl_NL.po +++ b/product_state/i18n/nl_NL.po @@ -20,32 +20,164 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 -#: selection:product.template,state:0 +#: 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 -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 -#: selection:product.template,state:0 +#: 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 Template" +#: 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 Template" +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:ir.ui.menu,name:product_state.menu_product_state +#, fuzzy +#| msgid "Product Template" +msgid "Product States" msgstr "Productsjabloon" #. 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 "Status" +#, fuzzy +#| msgid "Product Template" +msgid "Product Status" +msgstr "Productsjabloon" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +#, fuzzy +#| msgid "Product Template" +msgid "product.state" +msgstr "Productsjabloon" diff --git a/product_state/i18n/product_state.pot b/product_state/i18n/product_state.pot index b5dafa67326..79fd01d1615 100644 --- a/product_state/i18n/product_state.pot +++ b/product_state/i18n/product_state.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * product_state +# * product_state # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14,33 +14,156 @@ msgstr "" "Plural-Forms: \n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 -#: selection:product.template,state:0 +#: 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 -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 -#: selection:product.template,state:0 +#: 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 Template" +#: 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:ir.ui.menu,name:product_state.menu_product_state +msgid "Product States" 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 "Status" +msgid "Product Status" +msgstr "" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +msgid "product.state" +msgstr "" diff --git a/product_state/i18n/pt.po b/product_state/i18n/pt.po index 891170e0b57..54df891f43a 100644 --- a/product_state/i18n/pt.po +++ b/product_state/i18n/pt.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * product_state +# * product_state # msgid "" msgstr "" @@ -17,32 +17,168 @@ msgstr "" "X-Generator: Weblate 3.10\n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 -#: selection:product.template,state:0 +#: 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 -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 "Normal" #. module: product_state -#: selection:product.template,state:0 +#: 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 Template" +#: 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 Template" +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:ir.ui.menu,name:product_state.menu_product_state +#, fuzzy +#| msgid "Product Template" +msgid "Product States" msgstr "Modelo de Produto" #. 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 "Status" +#, fuzzy +#| msgid "Product Template" +msgid "Product Status" +msgstr "Modelo de Produto" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 "Status" +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 "Status" +msgid "State Products" msgstr "Estado" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +#, fuzzy +#| msgid "Product Template" +msgid "product.state" +msgstr "Modelo de Produto" diff --git a/product_state/i18n/sl.po b/product_state/i18n/sl.po index e600d663259..5cd87e7d008 100644 --- a/product_state/i18n/sl.po +++ b/product_state/i18n/sl.po @@ -20,32 +20,164 @@ msgstr "" "%100==4 ? 2 : 3);\n" #. module: product_state -#: selection:product.template,state:0 +#: 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__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 -#: selection:product.template,state:0 +#: 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 -#: selection:product.template,state:0 +#: model:ir.model.fields,field_description:product_state.field_product_state____last_update +msgid "Last Modified on" +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 -#: selection:product.template,state:0 +#: 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 Template" +#: 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 Template" +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:ir.ui.menu,name:product_state.menu_product_state +#, fuzzy +#| msgid "Product Template" +msgid "Product States" msgstr "Predloga proizvoda" #. 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 "Status" +#, fuzzy +#| msgid "Product Template" +msgid "Product Status" +msgstr "Predloga proizvoda" + +#. module: product_state +#: model:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +#, fuzzy +#| msgid "Product Template" +msgid "product.state" +msgstr "Predloga proizvoda" diff --git a/product_state/migrations/13.0.1.0.0/post-migration.py b/product_state/migrations/13.0.1.0.0/post-migration.py new file mode 100644 index 00000000000..2ababa1b572 --- /dev/null +++ b/product_state/migrations/13.0.1.0.0/post-migration.py @@ -0,0 +1,10 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade # pylint: disable=W7936 + +from odoo.addons.product_state import post_init_hook + + +@openupgrade.migrate() +def migrate(env, version): + post_init_hook(env.cr, env) diff --git a/product_state/models/__init__.py b/product_state/models/__init__.py index 437a4f052e7..294a305ebb3 100644 --- a/product_state/models/__init__.py +++ b/product_state/models/__init__.py @@ -1,4 +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..9cf8a76d2fd --- /dev/null +++ b/product_state/models/product_state.py @@ -0,0 +1,43 @@ +# Copyright 2017 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +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( + string="Sequence", help="Used to order the States", default=25 + ) + 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", + ) + + _sql_constraints = [ + ("code_unique", "UNIQUE(code)", "Product State Code must be unique.") + ] + + @api.depends("product_ids") + def _compute_products_count(self): + data = self.env["product.template"].read_group( + [("product_state_id", "in", self.ids)], + ["product_state_id"], + ["product_state_id"], + ) + mapped_data = { + record["product_state_id"][0]: record["product_state_id_count"] + for record in data + } + for state in self: + state.products_count = mapped_data.get(state.id, 0) diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index 94ae7742da0..ddc1a839bfc 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -1,47 +1,12 @@ # Copyright 2017 ACSONE SA/NV () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import api, models, fields - - -class ProductState(models.Model): - _name = "product.state" - _description = "Product State" - _order = "sequence, id" - - name = fields.Char("State Name", required=True, translate=True) - code = fields.Char("State Code", required=True) - sequence = fields.Integer("Sequence", help="Used to order the States", default=25) - description = fields.Text(translate=True) - product_ids = fields.One2many( - "product.template", "product_state_id", string="State Products", - ) - products_count = fields.Integer( - string="Number of products", compute="_compute_products_count", - ) - - _sql_constraints = [ - ("code_unique", "UNIQUE(code)", "Product State Code must be unique.") - ] - - @api.depends("product_ids") - def _compute_products_count(self): - data = self.env["product.template"].read_group( - [("product_state_id", "in", self.ids)], - ["product_state_id"], - ["product_state_id"], - ) - mapped_data = { - record["product_state_id"][0]: record["product_state_id_count"] - for record in data - } - for state in self: - state.products_count = mapped_data.get(state.id, 0) +from odoo import api, fields, models class ProductTemplate(models.Model): - _inherit = 'product.template' + _inherit = "product.template" state = fields.Char( string="Product Status", @@ -54,6 +19,7 @@ class ProductTemplate(models.Model): comodel_name="product.state", string="State", help="Select a state for this product", + group_expand="_read_group_state_id", ) @api.depends("product_state_id") @@ -70,3 +36,7 @@ def _inverse_product_state(self): if product_tmpl.state and not product_state: product_state = ProductState.create({"name": product_tmpl.state}) product_tmpl.product_state_id = product_state.id + + @api.model + def _read_group_state_id(self, states, domain, order): + return states.search([]) diff --git a/product_state/static/description/index.html b/product_state/static/description/index.html index 5e78461ee6e..1aa7fd5503f 100644 --- a/product_state/static/description/index.html +++ b/product_state/static/description/index.html @@ -367,7 +367,7 @@

    Product State

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

    +

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

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

    • draft: In Development
    • @@ -378,47 +378,65 @@

      Product State

      Table of contents

      +
      +

      Usage

      +

      To create a new state:

      +
        +
      1. Go to Sales > Configuration > Products > Product States.
      2. +
      3. You can set its name and a description.
      4. +
      +

      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

      +

      Bug Tracker

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

      +feedback.

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

      -

      Credits

      +

      Credits

      -

      Authors

      +

      Authors

      • ACSONE SA/NV
      -

      Contributors

      +

      Contributors

      -

      Maintainers

      +

      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.

      +

      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/views/product_template.xml b/product_state/views/product_template.xml index 3c244ca3888..6171ba027a2 100644 --- a/product_state/views/product_template.xml +++ b/product_state/views/product_template.xml @@ -1,33 +1,31 @@ - + - - + product.state.search.form product.state - + - - - - - + + State Products + ir.actions.act_window + product.template + kanban,form,tree + {} + [('product_state_id', '=', active_id)] + + + Product State + ir.actions.act_window + product.state + kanban,form,tree + {} + [('product_state_id', '=', active_id)] + current + product.state.form product.state @@ -35,59 +33,68 @@
      -
      -
      - + - +
      - product.state.tree product.state - - + + - product.state.kanban product.state - - - + + +

      - +

      @@ -98,55 +105,57 @@ - product.template.search.state product.template - + - - - + + + - product.template.common.form product.template - +
      - - + +
      - product.template.tree (product_state_id) product.template - + 50 - + + - State product.state - form kanban,form,tree - - - + + Product States + + + From 26eca636f50d3ec65002a987374400b7f8a573b2 Mon Sep 17 00:00:00 2001 From: c2cdidier Date: Wed, 22 Jul 2020 11:23:43 +0000 Subject: [PATCH 11/37] Translated using Weblate (German) Currently translated at 100.0% (29 of 29 strings) Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/de/ --- product_state/i18n/de.po | 71 ++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/product_state/i18n/de.po b/product_state/i18n/de.po index af846e871f0..5c9ae6b74ff 100644 --- a/product_state/i18n/de.po +++ b/product_state/i18n/de.po @@ -9,119 +9,114 @@ 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: 2017-05-17 02:38+0000\n" -"Last-Translator: Niki Waibel , 2017\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" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form msgid "Code" -msgstr "" +msgstr "Code" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__create_uid msgid "Created by" -msgstr "" +msgstr "Erstellt durch" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__create_date msgid "Created on" -msgstr "" +msgstr "Erstellt am" #. 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 "" +msgstr "Beschreibung" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__display_name msgid "Display Name" -msgstr "" +msgstr "Anzeigename" #. module: product_state #: model:product.state,name:product_state.product_state_end msgid "End of Lifecycle" -msgstr "" +msgstr "Ende des Lebenszyklus" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__id msgid "ID" -msgstr "" +msgstr "ID" #. module: product_state #: model:product.state,name:product_state.product_state_draft msgid "In Development" -msgstr "" +msgstr "In Entwicklung" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state____last_update msgid "Last Modified on" -msgstr "" +msgstr "Letzte Änderung am" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__write_uid msgid "Last Updated by" -msgstr "" +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 "" +msgstr "Zuletzt aktualisiert am" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__name msgid "Name" -msgstr "" +msgstr "Name" #. module: product_state #: model:product.state,name:product_state.product_state_sellable msgid "Normal" -msgstr "" +msgstr "Normal" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__products_count msgid "Number of products" -msgstr "" +msgstr "Anzahl der Produkte" #. module: product_state #: model:product.state,name:product_state.product_state_obsolete msgid "Obsolete" -msgstr "" +msgstr "Veraltet" #. 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 Template" msgid "Product State" -msgstr "Produktvorlage" +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 "" +msgstr "Produkt Zustandscode muss eindeutig sein." #. module: product_state #: model:ir.ui.menu,name:product_state.menu_product_state -#, fuzzy -#| msgid "Product Template" msgid "Product States" -msgstr "Produktvorlage" +msgstr "Produkt-Zustände" #. 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 Template" msgid "Product Status" -msgstr "Produktvorlage" +msgstr "Produkt-Status" #. module: product_state #: model:ir.model,name:product_state.model_product_template @@ -132,18 +127,18 @@ msgstr "Produktvorlage" #: 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 "" +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 "" +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 "" +msgstr "Sequenz" #. module: product_state #: model:ir.actions.act_window,name:product_state.action_product_state @@ -151,32 +146,30 @@ msgstr "" #: 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 "" +msgstr "Zustand" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__code msgid "State Code" -msgstr "" +msgstr "Zustandscode" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form msgid "State Name" -msgstr "" +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 "" +msgstr "Produkte Zustand" #. module: product_state #: model:ir.model.fields,help:product_state.field_product_state__sequence msgid "Used to order the States" -msgstr "" +msgstr "Dient zu Sortierung der Zustände" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree -#, fuzzy -#| msgid "Product Template" msgid "product.state" -msgstr "Produktvorlage" +msgstr "Produktzustand" From 876617958edf3eb986a4ed259350f36b9dbd097c Mon Sep 17 00:00:00 2001 From: c2cdidier Date: Wed, 22 Jul 2020 11:17:20 +0000 Subject: [PATCH 12/37] Translated using Weblate (French) Currently translated at 100.0% (29 of 29 strings) Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/fr/ Translated using Weblate (French) Currently translated at 55.2% (16 of 29 strings) Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/fr/ --- product_state/i18n/fr.po | 67 +++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/product_state/i18n/fr.po b/product_state/i18n/fr.po index 69ae2d110db..bfe371b3400 100644 --- a/product_state/i18n/fr.po +++ b/product_state/i18n/fr.po @@ -10,40 +10,41 @@ 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: 2017-07-29 02:55+0000\n" -"Last-Translator: guillaume bauer , 2017\n" +"PO-Revision-Date: 2020-07-22 14:19+0000\n" +"Last-Translator: c2cdidier \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" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form msgid "Code" -msgstr "" +msgstr "Code" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__create_uid msgid "Created by" -msgstr "" +msgstr "Créé par" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__create_date msgid "Created on" -msgstr "" +msgstr "Créé le" #. 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 "" +msgstr "Description" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__display_name msgid "Display Name" -msgstr "" +msgstr "Nom affiché" #. module: product_state #: model:product.state,name:product_state.product_state_end @@ -53,7 +54,7 @@ msgstr "Fin de vie" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__id msgid "ID" -msgstr "" +msgstr "ID" #. module: product_state #: model:product.state,name:product_state.product_state_draft @@ -63,22 +64,22 @@ msgstr "Phase de recherche et de développement" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state____last_update msgid "Last Modified on" -msgstr "" +msgstr "Dernière modification le" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__write_uid msgid "Last Updated by" -msgstr "" +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 "" +msgstr "Dernière modification le" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__name msgid "Name" -msgstr "" +msgstr "Nom" #. module: product_state #: model:product.state,name:product_state.product_state_sellable @@ -88,7 +89,7 @@ msgstr "Normal" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__products_count msgid "Number of products" -msgstr "" +msgstr "Nombre d'articles" #. module: product_state #: model:product.state,name:product_state.product_state_obsolete @@ -99,89 +100,77 @@ msgstr "Obsolète" #: 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 Template" msgid "Product State" -msgstr "Modèle de produit" +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 "" +msgstr "Le code d'état de l'article doit être unique." #. module: product_state #: model:ir.ui.menu,name:product_state.menu_product_state -#, fuzzy -#| msgid "Product Template" msgid "Product States" -msgstr "Modèle de produit" +msgstr "Etats de l'article" #. 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 Template" msgid "Product Status" -msgstr "Modèle de produit" +msgstr "Statut de l'article" #. module: product_state #: model:ir.model,name:product_state.model_product_template msgid "Product Template" -msgstr "Modèle de produit" +msgstr "Modèle 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 "" +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 "" +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 "" +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 -#, fuzzy -#| msgid "Status" msgid "State" msgstr "Statut" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__code msgid "State Code" -msgstr "" +msgstr "Code du statut" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form msgid "State Name" -msgstr "" +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 -#, fuzzy -#| msgid "Status" msgid "State Products" -msgstr "Statut" +msgstr "Statut des articles" #. module: product_state #: model:ir.model.fields,help:product_state.field_product_state__sequence msgid "Used to order the States" -msgstr "" +msgstr "Utilisé pour trier les statuts" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree -#, fuzzy -#| msgid "Product Template" msgid "product.state" -msgstr "Modèle de produit" +msgstr "Statut de l'article" From 91d1243b90f2352427e5303b192277ef542d51f4 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 16 Aug 2020 11:38:45 +0000 Subject: [PATCH 13/37] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-attribute-13.0/product-attribute-13.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-13-0/product-attribute-13-0-product_state/ [MIG] product_state: Migration to 14.0 --- product_state/__init__.py | 2 +- product_state/__manifest__.py | 2 +- product_state/i18n/es.po | 6 ------ product_state/i18n/hr.po | 6 ------ product_state/i18n/nl_NL.po | 4 ---- product_state/i18n/pt.po | 6 ------ product_state/i18n/sl.po | 4 ---- product_state/models/product_state.py | 3 ++- product_state/tests/__init__.py | 2 ++ product_state/tests/test_product_state.py | 21 +++++++++++++++++++++ 10 files changed, 27 insertions(+), 29 deletions(-) create mode 100644 product_state/tests/__init__.py create mode 100644 product_state/tests/test_product_state.py diff --git a/product_state/__init__.py b/product_state/__init__.py index a3b9286ff0d..fe161f40f41 100644 --- a/product_state/__init__.py +++ b/product_state/__init__.py @@ -7,7 +7,7 @@ def post_init_hook(cr, registry): - """ This hook is used to add a state on existing products + """This hook is used to add a state on existing products when module product_state is installed. """ env = api.Environment(cr, SUPERUSER_ID, {}) diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py index 34851d36a36..41f8b7ecc28 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -7,7 +7,7 @@ "author": "ACSONE SA/NV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/product-attribute", "category": "Product", - "version": "13.0.1.0.1", + "version": "14.0.1.0.0", "license": "AGPL-3", "depends": ["product", "sale"], "data": [ diff --git a/product_state/i18n/es.po b/product_state/i18n/es.po index e91c977efce..9f631e660e6 100644 --- a/product_state/i18n/es.po +++ b/product_state/i18n/es.po @@ -100,7 +100,6 @@ msgstr "Obsoleto" #: 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 Template" msgid "Product State" msgstr "Plantilla de producto" @@ -112,7 +111,6 @@ msgstr "" #. module: product_state #: model:ir.ui.menu,name:product_state.menu_product_state #, fuzzy -#| msgid "Product Template" msgid "Product States" msgstr "Plantilla de producto" @@ -120,7 +118,6 @@ msgstr "Plantilla de producto" #: 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 Template" msgid "Product Status" msgstr "Plantilla de producto" @@ -152,7 +149,6 @@ msgstr "" #: 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 "Status" msgid "State" msgstr "Estado" @@ -170,7 +166,6 @@ msgstr "" #: 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 "Status" msgid "State Products" msgstr "Estado" @@ -182,6 +177,5 @@ msgstr "" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree #, fuzzy -#| msgid "Product Template" msgid "product.state" msgstr "Plantilla de producto" diff --git a/product_state/i18n/hr.po b/product_state/i18n/hr.po index b2b10378efd..375b553fb21 100644 --- a/product_state/i18n/hr.po +++ b/product_state/i18n/hr.po @@ -100,7 +100,6 @@ msgstr "Zastarjelo" #: 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 Template" msgid "Product State" msgstr "Predložak proizvoda" @@ -112,7 +111,6 @@ msgstr "" #. module: product_state #: model:ir.ui.menu,name:product_state.menu_product_state #, fuzzy -#| msgid "Product Template" msgid "Product States" msgstr "Predložak proizvoda" @@ -120,7 +118,6 @@ msgstr "Predložak proizvoda" #: 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 Template" msgid "Product Status" msgstr "Predložak proizvoda" @@ -152,7 +149,6 @@ msgstr "" #: 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 "Status" msgid "State" msgstr "Status" @@ -170,7 +166,6 @@ msgstr "" #: 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 "Status" msgid "State Products" msgstr "Status" @@ -182,6 +177,5 @@ msgstr "" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree #, fuzzy -#| msgid "Product Template" msgid "product.state" msgstr "Predložak proizvoda" diff --git a/product_state/i18n/nl_NL.po b/product_state/i18n/nl_NL.po index f666f958e59..13bb6066a54 100644 --- a/product_state/i18n/nl_NL.po +++ b/product_state/i18n/nl_NL.po @@ -100,7 +100,6 @@ msgstr "" #: 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 Template" msgid "Product State" msgstr "Productsjabloon" @@ -112,7 +111,6 @@ msgstr "" #. module: product_state #: model:ir.ui.menu,name:product_state.menu_product_state #, fuzzy -#| msgid "Product Template" msgid "Product States" msgstr "Productsjabloon" @@ -120,7 +118,6 @@ msgstr "Productsjabloon" #: 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 Template" msgid "Product Status" msgstr "Productsjabloon" @@ -178,6 +175,5 @@ msgstr "" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree #, fuzzy -#| msgid "Product Template" msgid "product.state" msgstr "Productsjabloon" diff --git a/product_state/i18n/pt.po b/product_state/i18n/pt.po index 54df891f43a..c91bae9eac7 100644 --- a/product_state/i18n/pt.po +++ b/product_state/i18n/pt.po @@ -97,7 +97,6 @@ msgstr "Obsoleto" #: 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 Template" msgid "Product State" msgstr "Modelo de Produto" @@ -109,7 +108,6 @@ msgstr "" #. module: product_state #: model:ir.ui.menu,name:product_state.menu_product_state #, fuzzy -#| msgid "Product Template" msgid "Product States" msgstr "Modelo de Produto" @@ -117,7 +115,6 @@ msgstr "Modelo de Produto" #: 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 Template" msgid "Product Status" msgstr "Modelo de Produto" @@ -149,7 +146,6 @@ msgstr "" #: 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 "Status" msgid "State" msgstr "Estado" @@ -167,7 +163,6 @@ msgstr "" #: 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 "Status" msgid "State Products" msgstr "Estado" @@ -179,6 +174,5 @@ msgstr "" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree #, fuzzy -#| msgid "Product Template" msgid "product.state" msgstr "Modelo de Produto" diff --git a/product_state/i18n/sl.po b/product_state/i18n/sl.po index 5cd87e7d008..1948a292dee 100644 --- a/product_state/i18n/sl.po +++ b/product_state/i18n/sl.po @@ -100,7 +100,6 @@ msgstr "" #: 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 Template" msgid "Product State" msgstr "Predloga proizvoda" @@ -112,7 +111,6 @@ msgstr "" #. module: product_state #: model:ir.ui.menu,name:product_state.menu_product_state #, fuzzy -#| msgid "Product Template" msgid "Product States" msgstr "Predloga proizvoda" @@ -120,7 +118,6 @@ msgstr "Predloga proizvoda" #: 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 Template" msgid "Product Status" msgstr "Predloga proizvoda" @@ -178,6 +175,5 @@ msgstr "" #. module: product_state #: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree #, fuzzy -#| msgid "Product Template" msgid "product.state" msgstr "Predloga proizvoda" diff --git a/product_state/models/product_state.py b/product_state/models/product_state.py index 9cf8a76d2fd..8483d1ba318 100644 --- a/product_state/models/product_state.py +++ b/product_state/models/product_state.py @@ -21,7 +21,8 @@ class ProductState(models.Model): string="State Products", ) products_count = fields.Integer( - string="Number of products", compute="_compute_products_count", + string="Number of products", + compute="_compute_products_count", ) _sql_constraints = [ 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..62652eb3122 --- /dev/null +++ b/product_state/tests/test_product_state.py @@ -0,0 +1,21 @@ +from odoo.tests.common import SavepointCase + + +class TestProductState(SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.ProductState = cls.env["product.state"] + cls.state = cls.ProductState.create( + { + "name": "State Name", + "code": "Code" + } + ) + + def test_01_product_state(self): + print(self.state.products_count) + + + + From 870b4139dc2e2094031df3c8cf3abde9631b0efe Mon Sep 17 00:00:00 2001 From: watthanun Date: Thu, 19 Nov 2020 17:35:09 +0700 Subject: [PATCH 14/37] [MIG] product_state: Migration to 14.0 --- product_state/tests/__init__.py | 1 + product_state/tests/test_product_state.py | 16 +++++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/product_state/tests/__init__.py b/product_state/tests/__init__.py index cf5f2559a8f..d537dc55a93 100644 --- a/product_state/tests/__init__.py +++ b/product_state/tests/__init__.py @@ -1,2 +1,3 @@ # 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 index 62652eb3122..06d3e025365 100644 --- a/product_state/tests/test_product_state.py +++ b/product_state/tests/test_product_state.py @@ -1,3 +1,5 @@ +import logging + from odoo.tests.common import SavepointCase @@ -6,16 +8,8 @@ class TestProductState(SavepointCase): def setUpClass(cls): super().setUpClass() cls.ProductState = cls.env["product.state"] - cls.state = cls.ProductState.create( - { - "name": "State Name", - "code": "Code" - } - ) + cls.state = cls.ProductState.create({"name": "State Name", "code": "Code"}) def test_01_product_state(self): - print(self.state.products_count) - - - - + # print(self.state.products_count) + logger = logging.getLogger(self.state.products_count) From 5790612644cbb41f1c0dc75eca457259e8ee351c Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Tue, 16 Mar 2021 10:26:17 +0100 Subject: [PATCH 15/37] [14.0][IMP] product_state: Add default value, tests --- product_state/models/product_template.py | 7 ++- product_state/readme/CONTRIBUTORS.rst | 1 + product_state/tests/__init__.py | 1 - product_state/tests/test_product_state.py | 60 ++++++++++++++++++++++- 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index ddc1a839bfc..e3f93707ba3 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -1,4 +1,4 @@ -# Copyright 2017 ACSONE SA/NV () +# 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 @@ -20,8 +20,13 @@ class ProductTemplate(models.Model): string="State", help="Select a state for this product", group_expand="_read_group_state_id", + default=lambda self: self._get_default_product_state_id(), ) + @api.model + def _get_default_product_state_id(self): + return self.env.ref("product_state.product_state_sellable") + @api.depends("product_state_id") def _compute_product_state(self): for product_tmpl in self: diff --git a/product_state/readme/CONTRIBUTORS.rst b/product_state/readme/CONTRIBUTORS.rst index ce54243ee34..e5892e17dbb 100644 --- a/product_state/readme/CONTRIBUTORS.rst +++ b/product_state/readme/CONTRIBUTORS.rst @@ -3,3 +3,4 @@ * Nikul Chaudhary * Eduardo Magdalena (C2i Change 2 improve http://www.c2i.es) * Andrii Skrypka +* Denis Roussel diff --git a/product_state/tests/__init__.py b/product_state/tests/__init__.py index d537dc55a93..cf5f2559a8f 100644 --- a/product_state/tests/__init__.py +++ b/product_state/tests/__init__.py @@ -1,3 +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 index 06d3e025365..284a3dab91e 100644 --- a/product_state/tests/test_product_state.py +++ b/product_state/tests/test_product_state.py @@ -1,7 +1,11 @@ +# Copyright 2021 ACSONE SA/NV () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). import logging from odoo.tests.common import SavepointCase +_logger = logging.getLogger(__name__) + class TestProductState(SavepointCase): @classmethod @@ -9,7 +13,59 @@ def setUpClass(cls): super().setUpClass() cls.ProductState = cls.env["product.state"] cls.state = cls.ProductState.create({"name": "State Name", "code": "Code"}) + cls.product_obj = cls.env["product.template"] + cls.product_1 = cls.env.ref("product.product_product_4_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.product = cls.product_obj.create(vals) def test_01_product_state(self): - # print(self.state.products_count) - logger = logging.getLogger(self.state.products_count) + """ + Check if existing product has the default value (see init_hook) + 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.assertTrue(self.product_1.product_state_id) + self.assertFalse( + self.state.products_count, + ) + self._create_product() + self.assertEqual( + self.env.ref("product_state.product_state_sellable"), + self.product.product_state_id, + ) + + self._create_product(self.state) + self.assertEqual( + self.state, + self.product.product_state_id, + ) + self.assertEqual( + 1, + self.state.products_count, + ) + + def test_02_set_product_state(self): + """ + Create product, it has default state + Then, update the state + It should have the existing one (Code) + """ + self._create_product() + self.assertEqual( + self.env.ref("product_state.product_state_sellable"), + self.product.product_state_id, + ) + self.product.state = "Code" + self.assertEqual( + self.state, + self.product.product_state_id, + ) From 955811903f3a286fa5af3e4bf696a2736a3bc3fa Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Tue, 16 Mar 2021 14:20:35 +0100 Subject: [PATCH 16/37] [14.0][IMP] product_state: Add tracking, index and fix default value --- product_state/models/product_template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index e3f93707ba3..cb575463315 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -21,11 +21,13 @@ class ProductTemplate(models.Model): help="Select a state for this product", group_expand="_read_group_state_id", default=lambda self: self._get_default_product_state_id(), + index=True, + tracking=10, ) @api.model def _get_default_product_state_id(self): - return self.env.ref("product_state.product_state_sellable") + return self.env.ref("product_state_sellable", raise_if_not_found=False) @api.depends("product_state_id") def _compute_product_state(self): From 75ff100e1823fbe4d3c54e35e8917a7b8930611f Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Wed, 17 Mar 2021 10:26:57 +0100 Subject: [PATCH 17/37] [14.0][FIX] product_state: Good xml id --- product_state/models/product_template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index cb575463315..aa8ceb24a47 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -27,7 +27,8 @@ class ProductTemplate(models.Model): @api.model def _get_default_product_state_id(self): - return self.env.ref("product_state_sellable", raise_if_not_found=False) + return self.env.ref( + "product_state.product_state_sellable", raise_if_not_found=False) @api.depends("product_state_id") def _compute_product_state(self): From e4f23a5a0f9fdf4356d77090b22b71226257865e Mon Sep 17 00:00:00 2001 From: Andrea Piovesana Date: Tue, 9 Feb 2021 11:46:19 +0100 Subject: [PATCH 18/37] update manifest Application: False --- product_state/README.rst | 11 ++++++----- product_state/__manifest__.py | 2 +- product_state/i18n/product_state.pot | 5 ++++- product_state/models/product_template.py | 3 ++- product_state/static/description/index.html | 7 ++++--- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/product_state/README.rst b/product_state/README.rst index 418929a8a5c..c63145b8d3e 100644 --- a/product_state/README.rst +++ b/product_state/README.rst @@ -14,13 +14,13 @@ Product State :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/13.0/product_state + :target: https://github.com/OCA/product-attribute/tree/14.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-13-0/product-attribute-13-0-product_state + :target: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_state :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/135/13.0 + :target: https://runbot.odoo-community.org/runbot/135/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -56,7 +56,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -76,6 +76,7 @@ Contributors * Nikul Chaudhary * Eduardo Magdalena (C2i Change 2 improve http://www.c2i.es) * Andrii Skrypka +* Denis Roussel Maintainers ~~~~~~~~~~~ @@ -98,6 +99,6 @@ Current `maintainer `__: |maintainer-emagdalenaC2i| -This module is part of the `OCA/product-attribute `_ project on GitHub. +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/__manifest__.py b/product_state/__manifest__.py index 41f8b7ecc28..cbf5f364249 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -16,7 +16,7 @@ "security/ir.model.access.csv", "views/product_template.xml", ], - "application": True, + "application": False, "maintainers": ["emagdalenaC2i"], "post_init_hook": "post_init_hook", } diff --git a/product_state/i18n/product_state.pot b/product_state/i18n/product_state.pot index 79fd01d1615..85ce44b3496 100644 --- a/product_state/i18n/product_state.pot +++ b/product_state/i18n/product_state.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -36,6 +36,7 @@ msgstr "" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__display_name +#: model:ir.model.fields,field_description:product_state.field_product_template__display_name msgid "Display Name" msgstr "" @@ -46,6 +47,7 @@ msgstr "" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state__id +#: model:ir.model.fields,field_description:product_state.field_product_template__id msgid "ID" msgstr "" @@ -56,6 +58,7 @@ msgstr "" #. module: product_state #: model:ir.model.fields,field_description:product_state.field_product_state____last_update +#: model:ir.model.fields,field_description:product_state.field_product_template____last_update msgid "Last Modified on" msgstr "" diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index aa8ceb24a47..8fe05c5bc47 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -28,7 +28,8 @@ class ProductTemplate(models.Model): @api.model def _get_default_product_state_id(self): return self.env.ref( - "product_state.product_state_sellable", raise_if_not_found=False) + "product_state.product_state_sellable", raise_if_not_found=False + ) @api.depends("product_state_id") def _compute_product_state(self): diff --git a/product_state/static/description/index.html b/product_state/static/description/index.html index 1aa7fd5503f..1b12b2c5ff4 100644 --- a/product_state/static/description/index.html +++ b/product_state/static/description/index.html @@ -367,7 +367,7 @@

      Product State

      !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

      +

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

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

      • draft: In Development
      • @@ -406,7 +406,7 @@

        Bug Tracker

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

        +feedback.

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

      @@ -425,6 +425,7 @@

      Contributors

    • Nikul Chaudhary <nikulchaudhary2112@gmail.com>
    • Eduardo Magdalena <emagdalena@c2i.es> (C2i Change 2 improve http://www.c2i.es)
    • Andrii Skrypka <andrijskrypa@ukr.net>
    • +
    • Denis Roussel <denis.roussel@acsone.eu>
@@ -436,7 +437,7 @@

Maintainers

promote its widespread use.

Current maintainer:

emagdalenaC2i

-

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

+

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.

From cca81aa0480303e857c5b6ce31f0503efdde7871 Mon Sep 17 00:00:00 2001 From: Bosd Date: Sun, 9 May 2021 14:32:00 +0000 Subject: [PATCH 19/37] Added translation using Weblate (Dutch) Currently translated at 93.1% (27 of 29 strings) Translation: product-attribute-14.0/product-attribute-14.0-product_state Translate-URL: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_state/nl/ --- product_state/i18n/nl.po | 175 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 product_state/i18n/nl.po diff --git a/product_state/i18n/nl.po b/product_state/i18n/nl.po new file mode 100644 index 00000000000..059bf4101b3 --- /dev/null +++ b/product_state/i18n/nl.po @@ -0,0 +1,175 @@ +# 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: 2021-05-09 16:47+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 4.3.2\n" + +#. 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__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 +#: model:ir.model.fields,field_description:product_state.field_product_template__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 +#: model:ir.model.fields,field_description:product_state.field_product_template__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____last_update +#: model:ir.model.fields,field_description:product_state.field_product_template____last_update +msgid "Last Modified on" +msgstr "Laatst gewijzigd op" + +#. 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.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:ir.ui.menu,name:product_state.menu_product_state +msgid "Product States" +msgstr "Product status" + +#. 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:ir.model,name:product_state.model_product_template +msgid "Product Template" +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 "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 dir 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 "Status code" + +#. 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 "Product status" + +#. module: product_state +#: model:ir.model.fields,help:product_state.field_product_state__sequence +msgid "Used to order the States" +msgstr "" + +#. module: product_state +#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_tree +msgid "product.state" +msgstr "" From 67547f0f30f0fb37e851e0a87bd4f064353d6eb0 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Thu, 8 Jul 2021 14:28:14 +0200 Subject: [PATCH 20/37] [14.0][IMP] product_state: Prevent a write with both values As fields are on the form view, a write is called with them. This is an unwanted behaviour. --- product_state/__manifest__.py | 2 +- product_state/models/product_template.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/product_state/__manifest__.py b/product_state/__manifest__.py index cbf5f364249..f1f4749b4f5 100644 --- a/product_state/__manifest__.py +++ b/product_state/__manifest__.py @@ -7,7 +7,7 @@ "author": "ACSONE SA/NV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/product-attribute", "category": "Product", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "license": "AGPL-3", "depends": ["product", "sale"], "data": [ diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index 8fe05c5bc47..5e831b2776b 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -13,6 +13,7 @@ class ProductTemplate(models.Model): index=True, compute="_compute_product_state", inverse="_inverse_product_state", + readonly=True, store=True, ) product_state_id = fields.Many2one( From 77d318e78a6f41ec5781edacffb1ec2b20ac79ab Mon Sep 17 00:00:00 2001 From: sonhd Date: Wed, 27 Oct 2021 17:29:01 +0700 Subject: [PATCH 21/37] Move default states on product_state and product_tier_validation to demo data --- product_state/README.rst | 5 ++++ product_state/data/product_state_data.xml | 1 + product_state/models/product_state.py | 11 +++++++-- product_state/models/product_template.py | 4 +-- product_state/readme/ROADMAP.rst | 1 + product_state/static/description/index.html | 27 ++++++++++++--------- product_state/tests/test_product_state.py | 15 +++++++++++- 7 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 product_state/readme/ROADMAP.rst diff --git a/product_state/README.rst b/product_state/README.rst index c63145b8d3e..00be459607b 100644 --- a/product_state/README.rst +++ b/product_state/README.rst @@ -50,6 +50,11 @@ To add a product to a state: #. Go to the product itself and edit. #. You can select the desired status in the list of buttons above the form. +Known issues / Roadmap +====================== + +File data/product_state_data.xml will be moved to demo/product_state_demo.xml since version 15.0 + Bug Tracker =========== diff --git a/product_state/data/product_state_data.xml b/product_state/data/product_state_data.xml index 88681a8c4bc..2cd9913df33 100644 --- a/product_state/data/product_state_data.xml +++ b/product_state/data/product_state_data.xml @@ -9,6 +9,7 @@ sellable Normal 20 + True end diff --git a/product_state/models/product_state.py b/product_state/models/product_state.py index 8483d1ba318..99965fba40b 100644 --- a/product_state/models/product_state.py +++ b/product_state/models/product_state.py @@ -1,7 +1,8 @@ # 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 import _, api, fields, models +from odoo.exceptions import ValidationError class ProductState(models.Model): @@ -14,6 +15,7 @@ class ProductState(models.Model): sequence = fields.Integer( string="Sequence", 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", @@ -24,7 +26,7 @@ class ProductState(models.Model): string="Number of products", compute="_compute_products_count", ) - + default = fields.Boolean("Default state") _sql_constraints = [ ("code_unique", "UNIQUE(code)", "Product State Code must be unique.") ] @@ -42,3 +44,8 @@ def _compute_products_count(self): } for state in self: state.products_count = mapped_data.get(state.id, 0) + + @api.constrains("default") + def _check_default(self): + if self.search_count([("default", "=", True)]) > 1: + raise ValidationError(_("There should be only one default state")) diff --git a/product_state/models/product_template.py b/product_state/models/product_template.py index 5e831b2776b..43361a82f6f 100644 --- a/product_state/models/product_template.py +++ b/product_state/models/product_template.py @@ -28,9 +28,7 @@ class ProductTemplate(models.Model): @api.model def _get_default_product_state_id(self): - return self.env.ref( - "product_state.product_state_sellable", raise_if_not_found=False - ) + return self.env["product.state"].search([("default", "=", True)], limit=1).id @api.depends("product_state_id") def _compute_product_state(self): diff --git a/product_state/readme/ROADMAP.rst b/product_state/readme/ROADMAP.rst new file mode 100644 index 00000000000..3338cccb707 --- /dev/null +++ b/product_state/readme/ROADMAP.rst @@ -0,0 +1 @@ +File data/product_state_data.xml will be moved to demo/product_state_demo.xml since version 15.0 diff --git a/product_state/static/description/index.html b/product_state/static/description/index.html index 1b12b2c5ff4..f1e5f3fdf98 100644 --- a/product_state/static/description/index.html +++ b/product_state/static/description/index.html @@ -3,7 +3,7 @@ - + Product State