Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8e9dd05
re-introduce state field on product (#261)
May 16, 2017
de7e225
add product state on tree view
Jul 14, 2017
2b91f5a
product_state: Migration to 11.0
asaunier Apr 10, 2018
983af6a
[MIG] product_state v11 to v12
Nikul-Chaudhary Jan 29, 2019
9560898
describe the state field
zeroheure Oct 19, 2019
7932ac2
remove space before ":"
zeroheure Oct 19, 2019
1e0ee53
Added translation using Weblate (Portuguese)
pedrocs-exo Mar 23, 2020
71e831f
[MIG] product_state to v13
benwillig Jun 17, 2020
917deac
[IMP] product_state
emagdalenaC2i Mar 7, 2020
e7112d7
[CHG] some code cleaning to make it v13 compliant
benwillig Jun 17, 2020
1e64dd2
Translated using Weblate (German)
didierdonze Jul 22, 2020
f123e40
Translated using Weblate (French)
didierdonze Jul 22, 2020
133b9ae
Update translation files
oca-transbot Aug 16, 2020
e118c0c
[MIG] product_state: Migration to 14.0
watthanun Nov 19, 2020
cc3118b
[14.0][IMP] product_state: Add default value, tests
rousseldenis Mar 16, 2021
bf0b5cd
[14.0][IMP] product_state: Add tracking, index and fix default value
rousseldenis Mar 16, 2021
2d25424
[14.0][FIX] product_state: Good xml id
rousseldenis Mar 17, 2021
39fb880
update manifest
andreampiovesana Feb 9, 2021
d1446e1
Added translation using Weblate (Dutch)
bosd May 9, 2021
dd910fd
[14.0][IMP] product_state: Prevent a write with both values
rousseldenis Jul 8, 2021
81cd514
Move default states on product_state and product_tier_validation to d…
Oct 27, 2021
df7a77e
[14.0][IMP] product_state: Add an inverse method on product_state_id
rousseldenis Nov 25, 2021
d2e0188
[IMP] product_state: fix issue, refactor inverse state
Dec 3, 2021
1fc8ff1
[IMP] product_state: use id in default of field
hailangvn Dec 15, 2021
a2da4d1
[MIG] product_state: Migration to 15.0
Feb 2, 2022
6c1e6cc
[15.0][FIX] product_state: solving problem from migration
Feb 28, 2022
b30a70a
Added translation using Weblate (Catalan)
pablontura Apr 22, 2022
8b1cac5
[MIG] product_state: Migration to 16.0
Nov 29, 2022
c5a8247
Added translation using Weblate (Italian)
PicchiSeba Apr 27, 2023
62bb540
[16.0][IMP] Product State
Hardik-OSI May 9, 2023
867ff0e
[IMP] product_state: pre-commit auto fixes
NICO-SOLUTIONS Nov 21, 2023
499b4ae
[MIG] product_state: Migration to 17.0
NICO-SOLUTIONS Nov 21, 2023
dd5b26d
[IMP] product_state (copy=False)
patrickrwilson May 10, 2022
53e26ee
product_state: move access to Sales + Inventory Manager
HekkiMelody Jul 27, 2022
8b3d7ca
[IMP] product_state: pre-commit auto fixes
natuan9 Nov 27, 2024
371782d
[MIG] product_state: Migration to 18.0
natuan9 Nov 28, 2024
1915dba
[IMP] product_state: Remove dependencies on stock and sale modules
natuan9 Dec 12, 2024
1c3e287
[UPD] Update product_state.pot
Feb 3, 2025
b1a35d7
[BOT] post-merge updates
OCA-git-bot Feb 3, 2025
cc2bc35
Update translation files
weblate Feb 3, 2025
b804b9b
Translated using Weblate (Italian)
mymage Feb 3, 2025
a22718a
Translated using Weblate (French)
bealdav Aug 14, 2025
3f3da72
Translated using Weblate (French)
bealdav Sep 9, 2025
362ad28
Translated using Weblate (Dutch)
bosd Nov 20, 2025
824f842
[MIG] product_state: Migration to 19.0
SilvioC2C Feb 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions product_state/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=============
Product State
=============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:46754da5dcc6fd670fc33b3793012ae8f5f716b433a982d624e4b481c4478cb6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/19.0/product_state
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-19-0/product-attribute-19-0-product_state
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=19.0
:alt: Try me on Runboat

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

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

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

**Table of contents**

.. contents::
:local:

Usage
=====

To add a product to a state:

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

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_state%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* ACSONE SA/NV

Contributors
------------

- Cedric Pigeon <cedric.pigeon@acsone.eu>
- Alexandre Saunier <alexandre.saunier@camptocamp.com>
- 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>
- Riccardo Fresco <riccardo.fresco@bt-group.com>
- Nils Coenen <nils.coenen@nico-solutions.de>
- `Trobz <https://trobz.com>`__:

- Tuan Nguyen <tuanna@trobz.com>

Other credits
-------------

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

Maintainers
-----------

This module is maintained by the OCA.

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

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

.. |maintainer-emagdalenaC2i| image:: https://github.com/emagdalenaC2i.png?size=40px
:target: https://github.com/emagdalenaC2i
:alt: emagdalenaC2i

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

|maintainer-emagdalenaC2i|

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/19.0/product_state>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
13 changes: 13 additions & 0 deletions product_state/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from odoo.orm.domains import Domain


def post_init_hook(env):
"""Add a state on existing products"""
tmpl_obj = env["product.template"].with_context(active_test=False)
tmpl_without_state = tmpl_obj.search(Domain("state", "=", False))
tmpl_without_state.write({"state": "sellable"})
tmpl_without_state_id = tmpl_obj.search(Domain("product_state_id", "=", False))
tmpl_without_state_id._inverse_product_state()
23 changes: 23 additions & 0 deletions product_state/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Product State",
"summary": """
Module introducing a state field on product template""",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"category": "Product",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"depends": ["product"],
"data": [
"data/product_state_data.xml",
"security/product_state_security.xml",
"security/ir.model.access.csv",
"views/product_template_views.xml",
"views/product_state_views.xml",
],
"application": False,
"maintainers": ["emagdalenaC2i"],
"post_init_hook": "post_init_hook",
}
23 changes: 23 additions & 0 deletions product_state/data/product_state_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<odoo noupdate="1">
<record id="product_state_draft" model="product.state">
<field name="code">draft</field>
<field name="name">In Development</field>
<field name="sequence">10</field>
</record>
<record id="product_state_sellable" model="product.state">
<field name="code">sellable</field>
<field name="name">Normal</field>
<field name="sequence">20</field>
<field name="default">True</field>
</record>
<record id="product_state_end" model="product.state">
<field name="code">end</field>
<field name="name">End of Lifecycle</field>
<field name="sequence">30</field>
</record>
<record id="product_state_obsolete" model="product.state">
<field name="code">obsolete</field>
<field name="name">Obsolete</field>
<field name="sequence">40</field>
</record>
</odoo>
198 changes: 198 additions & 0 deletions product_state/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_state
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-04-22 10:05+0000\n"
"Last-Translator: pablontura <pablo.ruiz@qubiq.es>\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__active
msgid "Active"
msgstr "Actiu"

#. module: product_state
#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form
msgid "Code"
msgstr "Codi"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__create_uid
msgid "Created by"
msgstr "Creat per"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__create_date
msgid "Created on"
msgstr "Creat el"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__default
msgid "Default state"
msgstr "Estat per defecte"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__description
#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form
msgid "Description"
msgstr "Descripció"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__display_name
msgid "Display Name"
msgstr "Nom de visualització"

#. module: product_state
#: model:product.state,name:product_state.product_state_end
msgid "End of Lifecycle"
msgstr "Final del cicle de vida"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__id
msgid "ID"
msgstr "ID"

#. module: product_state
#: model:product.state,name:product_state.product_state_draft
msgid "In Development"
msgstr "En Desenvolupament"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__write_uid
msgid "Last Updated by"
msgstr "Última actualització per"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__write_date
msgid "Last Updated on"
msgstr "Última actualització el"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__name
msgid "Name"
msgstr "Nom"

#. module: product_state
#: model:product.state,name:product_state.product_state_sellable
msgid "Normal"
msgstr "Normal"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__products_count
msgid "Number of products"
msgstr "Nombre de productes"

#. module: product_state
#: model:product.state,name:product_state.product_state_obsolete
msgid "Obsolete"
msgstr "Obsolet"

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

#. module: product_state
#: model:ir.actions.act_window,name:product_state.action_open_single_product_state
#: model:ir.model,name:product_state.model_product_state
#: model_terms:ir.ui.view,arch_db:product_state.product_state_search_form_view
msgid "Product State"
msgstr "Estat del producte"

#. module: product_state
#: model:ir.model.constraint,message:product_state.constraint_product_state_code_unique
msgid "Product State Code must be unique."
msgstr "El codi d'estat del producte ha de ser únic."

#. module: product_state
#: model:res.groups,name:product_state.group_product_state_manager
msgid "Product State Manager"
msgstr ""

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_product__state
#: model:ir.model.fields,field_description:product_state.field_product_template__state
msgid "Product Status"
msgstr "Estat del producte"

#. module: product_state
#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form
#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_kanban
msgid "Products"
msgstr "Productes"

#. module: product_state
#: model:ir.model.fields,help:product_state.field_product_product__product_state_id
#: model:ir.model.fields,help:product_state.field_product_template__product_state_id
msgid "Select a state for this product"
msgstr "Seleccioneu un estat per a aquest producte"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__sequence
msgid "Sequence"
msgstr "Seqüència"

#. module: product_state
#: model:ir.actions.act_window,name:product_state.action_product_state
#: model:ir.model.fields,field_description:product_state.field_product_product__product_state_id
#: model:ir.model.fields,field_description:product_state.field_product_template__product_state_id
#: model_terms:ir.ui.view,arch_db:product_state.view_product_template_search_state
msgid "State"
msgstr "Estat"

#. module: product_state
#: model:ir.model.fields,field_description:product_state.field_product_state__code
msgid "State Code"
msgstr "Codi de l'Estat"

#. module: product_state
#: model_terms:ir.ui.view,arch_db:product_state.view_product_state_form
msgid "State Name"
msgstr "Nom de l'Estat"

#. module: product_state
#: model:ir.actions.act_window,name:product_state.action_open_state_products
#: model:ir.model.fields,field_description:product_state.field_product_state__product_ids
#, fuzzy
msgid "State Products"
msgstr "Estat dels productes"

#. module: product_state
#. odoo-python
#: code:addons/product_state/models/product_template.py:0
msgid "The product state code %(product_state)s could not be found."
msgstr ""

#. module: product_state
#. odoo-python
#: code:addons/product_state/models/product_state.py:0
msgid "There should be only one default state"
msgstr "Només hi hauria d'haver un estat per defecte"

#. module: product_state
#: model:ir.model.fields,help:product_state.field_product_state__sequence
msgid "Used to order the States"
msgstr "S'utilitza per ordenar els Estats"

#~ msgid "Last Modified on"
#~ msgstr "Última modificació el"

#~ msgid "Product States"
#~ msgstr "Estats del producte"

#, fuzzy, python-format
#~ msgid "The product state code %s could not be found."
#~ msgstr "No s'ha pogut trobar el codi d'estat del producte %s."

#~ msgid "Product Template"
#~ msgstr "Plantilla de producte"
Loading