Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f7e27dc
re-introduce state field on product (#261)
May 16, 2017
7e4508f
add product state on tree view
Jul 14, 2017
5b780be
OCA Transbot updated translations from Transifex
oca-transbot May 20, 2017
1719f8e
product_state: Migration to 11.0
asaunier Apr 10, 2018
28c8df9
Update product_state.pot
oca-travis Jun 21, 2018
fd296c3
[MIG] product_state v11 to v12
Nikul-Chaudhary Jan 29, 2019
636eb80
[UPD] README.rst
OCA-git-bot May 14, 2019
9cbbad4
[ADD] icon.png
OCA-git-bot May 14, 2019
6ae1fcc
[UPD] Update product_state.pot
oca-travis May 14, 2019
a1a3bce
Update translation files
oca-transbot May 20, 2019
322e2ae
[UPD] README.rst
OCA-git-bot Jul 29, 2019
adf1b9d
describe the state field
zeroheure Oct 19, 2019
efe942b
remove space before ":"
zeroheure Oct 19, 2019
d9633df
[UPD] README.rst
OCA-git-bot Oct 19, 2019
5382ab1
Added translation using Weblate (Portuguese)
pedrocs-exo Mar 23, 2020
4f8c278
Translated using Weblate (Portuguese)
pedrocs-exo Mar 23, 2020
6ce4691
[MIG] product_state to v13
benwillig Jun 17, 2020
71d1150
[IMP] product_state
emagdalenaC2i Mar 7, 2020
a5a5a24
[CHG] some code cleaning to make it v13 compliant
benwillig Jun 17, 2020
7dc70af
[UPD] Update product_state.pot
oca-travis Jun 24, 2020
23134f1
[UPD] README.rst
OCA-git-bot Jun 24, 2020
85ebeb1
product_state 13.0.1.0.1
OCA-git-bot Jun 24, 2020
99287ff
Update translation files
oca-transbot Jun 25, 2020
5cc447c
Translated using Weblate (French)
didierdonze Jul 22, 2020
757c207
Translated using Weblate (German)
didierdonze Jul 22, 2020
c842645
Translated using Weblate (French)
didierdonze Jul 22, 2020
75b5d9e
Update translation files
oca-transbot Aug 16, 2020
c65ce8a
[MIG] product_state: Migration to 14.0
watthanun Nov 19, 2020
b81e580
[14.0][IMP] product_state: Add default value, tests
rousseldenis Mar 16, 2021
62a01d3
[14.0][IMP] product_state: Add tracking, index and fix default value
rousseldenis Mar 16, 2021
21b2216
[14.0][FIX] product_state: Good xml id
rousseldenis Mar 17, 2021
06009d3
update manifest
andreampiovesana Feb 9, 2021
582a418
[UPD] Update product_state.pot
oca-travis May 7, 2021
dc7520f
[UPD] README.rst
OCA-git-bot May 7, 2021
a15d6ed
Added translation using Weblate (Dutch)
bosd May 9, 2021
7f22bcf
Translated using Weblate (Dutch)
bosd May 9, 2021
a17d717
[14.0][IMP] product_state: Prevent a write with both values
rousseldenis Jul 8, 2021
d3680f7
product_state 14.0.1.0.1
OCA-git-bot Jul 27, 2021
ae16002
Move default states on product_state and product_tier_validation to d…
Oct 27, 2021
82b36bc
[14.0][IMP] product_state: Add an inverse method on product_state_id
rousseldenis Nov 25, 2021
faaf667
[UPD] Update product_state.pot
oca-travis Nov 25, 2021
f628919
[UPD] README.rst
OCA-git-bot Nov 25, 2021
981cccc
product_state 14.0.1.1.0
OCA-git-bot Nov 25, 2021
a7e65ca
Update translation files
oca-transbot Nov 25, 2021
a7b4715
product_state 14.0.1.1.1
OCA-git-bot Nov 25, 2021
c14a14a
[IMP] product_state: fix issue, refactor inverse state
Dec 3, 2021
0dcadde
[IMP] product_state: use id in default of field
hailangvn Dec 15, 2021
61e99da
[UPD] Update product_state.pot
oca-travis Dec 16, 2021
71a09df
product_state 14.0.1.1.2
OCA-git-bot Dec 16, 2021
c15fab4
Update translation files
oca-transbot Dec 16, 2021
32eaa2f
[MIG] product_state: Migration to 15.0
Feb 2, 2022
16dbb64
[UPD] Update product_state.pot
Feb 18, 2022
46ca9e5
[UPD] README.rst
OCA-git-bot Feb 18, 2022
a3ff5c4
product_state 15.0.1.0.1
OCA-git-bot Feb 18, 2022
ee54ef8
[15.0][FIX] product_state: solving problem from migration
Feb 28, 2022
434cda5
product_state 15.0.1.1.0
OCA-git-bot Mar 3, 2022
6016cfe
Added translation using Weblate (Catalan)
pablontura Apr 22, 2022
0630c71
Translated using Weblate (Catalan)
pablontura Apr 22, 2022
a2cbca9
[MIG] product_state: Migration to 16.0
Nov 29, 2022
334da09
[UPD] Update product_state.pot
Dec 5, 2022
5585373
[UPD] README.rst
OCA-git-bot Dec 5, 2022
6ad028e
Added translation using Weblate (Italian)
PicchiSeba Apr 27, 2023
b1bead0
Translated using Weblate (Italian)
PicchiSeba Apr 27, 2023
6428603
[16.0][IMP] Product State
Hardik-OSI May 9, 2023
de2ad65
Translated using Weblate (Italian)
francesco-ooops May 12, 2023
b4abf9c
Translated using Weblate (Italian)
mymage Jun 8, 2023
285eef6
Translated using Weblate (Spanish)
Ivorra78 Aug 23, 2023
0ce8d9b
[UPD] README.rst
OCA-git-bot Sep 3, 2023
d891223
Update translation files
weblate Oct 9, 2023
c8d2cca
Translated using Weblate (Spanish)
Ivorra78 Oct 12, 2023
3ff5ad1
Translated using Weblate (Italian)
mymage Oct 31, 2023
1a5cdc8
Translated using Weblate (Italian)
mymage Nov 2, 2023
1877787
[BOT] post-merge updates
OCA-git-bot Nov 6, 2023
52c059e
[IMP] product_state: pre-commit auto fixes
mostafabarmshory Mar 9, 2024
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
111 changes: 111 additions & 0 deletions product_state/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
=============
Product State
=============

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

.. |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/17.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-17-0/product-attribute-17-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=17.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 create a new state:

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

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:%2017.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>

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/17.0/product_state>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
18 changes: 18 additions & 0 deletions product_state/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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(env):
"""This hook is used to add a state on existing products
when module product_state is installed.
"""
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)]
)
product_without_state._inverse_product_state()
22 changes: 22 additions & 0 deletions product_state/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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": "17.0.1.1.0",
"license": "AGPL-3",
"depends": ["product", "sale"],
"data": [
"data/product_state_data.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",
}
24 changes: 24 additions & 0 deletions product_state/data/product_state_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<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>
195 changes: 195 additions & 0 deletions product_state/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# 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____last_update
msgid "Last Modified on"
msgstr "Última modificació el"

#. 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:ir.ui.menu,name:product_state.menu_product_state
msgid "Product States"
msgstr "Estats del producte"

#. 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
#, 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."

#. module: product_state
#. odoo-python
#: code:addons/product_state/models/product_state.py:0
#, python-format
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 "Product Template"
#~ msgstr "Plantilla de producte"
Loading