Skip to content

Commit

Permalink
Merge PR #1795 into 18.0
Browse files Browse the repository at this point in the history
Signed-off-by rousseldenis
  • Loading branch information
OCA-git-bot committed Feb 3, 2025
2 parents dbbabb0 + 8c1a844 commit c9899f4
Show file tree
Hide file tree
Showing 31 changed files with 3,235 additions and 0 deletions.
116 changes: 116 additions & 0 deletions product_state/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
=============
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 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 <[email protected]>
- Alexandre Saunier <[email protected]>
- Nikul Chaudhary <[email protected]>
- Eduardo Magdalena <[email protected]> (C2i Change 2 improve
http://www.c2i.es)
- Andrii Skrypka <[email protected]>
- Denis Roussel <[email protected]>
- Riccardo Fresco <[email protected]>
- Nils Coenen <[email protected]>
- `Trobz <https://trobz.com>`__:

- Tuan Nguyen <[email protected]>

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()
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": "18.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>
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 <[email protected]>\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

0 comments on commit c9899f4

Please sign in to comment.