Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] product_state: Migration to 18.0 #1795

Open
wants to merge 36 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
37db887
re-introduce state field on product (#261)
May 16, 2017
b0c3222
add product state on tree view
Jul 14, 2017
60f424b
product_state: Migration to 11.0
asaunier Apr 10, 2018
d1e282c
[MIG] product_state v11 to v12
Nikul-Chaudhary Jan 29, 2019
5f5ed1d
describe the state field
zeroheure Oct 19, 2019
54e44e4
remove space before ":"
zeroheure Oct 19, 2019
e64196b
Added translation using Weblate (Portuguese)
pedrocs-exo Mar 23, 2020
f8744be
[MIG] product_state to v13
benwillig Jun 17, 2020
c23f86b
[IMP] product_state
emagdalenaC2i Mar 7, 2020
c0f52a7
[CHG] some code cleaning to make it v13 compliant
benwillig Jun 17, 2020
26eca63
Translated using Weblate (German)
didierdonze Jul 22, 2020
8766179
Translated using Weblate (French)
didierdonze Jul 22, 2020
91d1243
Update translation files
oca-transbot Aug 16, 2020
870b413
[MIG] product_state: Migration to 14.0
watthanun Nov 19, 2020
5790612
[14.0][IMP] product_state: Add default value, tests
rousseldenis Mar 16, 2021
9558119
[14.0][IMP] product_state: Add tracking, index and fix default value
rousseldenis Mar 16, 2021
75ff100
[14.0][FIX] product_state: Good xml id
rousseldenis Mar 17, 2021
e4f23a5
update manifest
andreampiovesana Feb 9, 2021
cca81aa
Added translation using Weblate (Dutch)
bosd May 9, 2021
67547f0
[14.0][IMP] product_state: Prevent a write with both values
rousseldenis Jul 8, 2021
77d318e
Move default states on product_state and product_tier_validation to d…
Oct 27, 2021
710439d
[14.0][IMP] product_state: Add an inverse method on product_state_id
rousseldenis Nov 25, 2021
773ef2c
[IMP] product_state: fix issue, refactor inverse state
Dec 3, 2021
80ef575
[IMP] product_state: use id in default of field
hailangvn Dec 15, 2021
424c35e
[MIG] product_state: Migration to 15.0
Feb 2, 2022
4f70668
[15.0][FIX] product_state: solving problem from migration
Feb 28, 2022
916a3c8
Added translation using Weblate (Catalan)
pablontura Apr 22, 2022
e3c0b28
[MIG] product_state: Migration to 16.0
Nov 29, 2022
43ff6a6
Added translation using Weblate (Italian)
PicchiSeba Apr 27, 2023
1fdb6cb
[16.0][IMP] Product State
Hardik-OSI May 9, 2023
d8b1eb2
[IMP] product_state: pre-commit auto fixes
NICO-SOLUTIONS Nov 21, 2023
89a69cf
[MIG] product_state: Migration to 17.0
NICO-SOLUTIONS Nov 21, 2023
b9a4d83
[IMP] product_state (copy=False)
patrickrwilson May 10, 2022
7af51a1
product_state: move access to Sales + Inventory Manager
aleuffre Jul 27, 2022
69e0390
[IMP] product_state: pre-commit auto fixes
natuan9 Nov 27, 2024
f813f33
[MIG] product_state: Migration to 18.0
natuan9 Nov 28, 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
121 changes: 121 additions & 0 deletions product_state/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
=============
Product State
=============

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

.. |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/18.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-18-0/product-attribute-18-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=18.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:%2018.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 17.0 to 18.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/18.0/product_state>`_ project on GitHub.

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

from . import models


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": "18.0.1.0.0",
"license": "AGPL-3",
"depends": ["product", "sale", "stock"],
"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",
}
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>
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
Loading