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_status: Migration to 18.0 #1796

Open
wants to merge 16 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
110 changes: 110 additions & 0 deletions product_status/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
==============
Product Status
==============

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

.. |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_status
: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_status
: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 compute a status on product based on some date field
displayed on the Sales tab. This module will deactivate all default
state in product_state, implement new default data The option to use the
product-attribute/product_state module was considered but because the
status is computed based on today. It does not work well with a stored
fields and also means there is no need for creation of state from the
user.

By order of importance, the status is computed by: - *End-of-life* -
*Discontinued until* - *New until*

*End-of-life* has priority over the other dates. *Discontinued-until*
has priority over *New until*.

**Table of contents**

.. contents::
:local:

Known issues / Roadmap
======================

File data/product_state_data.xml will be moved to
demo/product_state_demo.xml since version 15.0

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_status%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
-------

* Camptocamp

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

- `Camptocamp <https://www.camptocamp.com>`__:

- Thierry Ducrest <thierry.ducrest@camptocamp.com>
- Simone Orsi <simahawk@gmail.com>

- `Trobz <https://trobz.com>`__:

- Son Ho <sonhd@trobz.com>
- Tuan Nguyen <tuanna@trobz.com>

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

**Financial support**

- Cosanum
- Camptocamp R&D

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.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions product_status/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions product_status/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

{
"name": "Product Status",
"summary": "Product Status Computed From Fields",
"version": "18.0.1.0.0",
"category": "Product",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"license": "AGPL-3",
"depends": ["product", "product_state"],
"data": [
"data/ir_cron.xml",
"data/function_deactive_default_product_state_data.xml",
"data/product_state_data.xml",
"views/product_views.xml",
],
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value
eval="[('module', '=', 'product_state'),
('model', '=', 'product.state')]"
/>
</function>
<value eval="{'noupdate': False}" />
</function>

<record id="product_state.product_state_draft" model="product.state">
<field name="active" eval="False" />
</record>

<record id="product_state.product_state_end" model="product.state">
<field name="active" eval="False" />
</record>

<record id="product_state.product_state_obsolete" model="product.state">
<field name="active" eval="False" />
</record>

<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value
eval="[('module', '=', 'product_state'),
('model', '=', 'product.state')]"
/>
</function>
<value eval="{'noupdate': True}" />
</function>
</odoo>
18 changes: 18 additions & 0 deletions product_status/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 Camptocamp SA
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.cron" id="cron_recompute_product_state">
<field name='name'>Recompute Product State</field>
<field name='interval_number'>1</field>
<field name='interval_type'>days</field>
<field name="active" eval="True" />
<field
name="nextcall"
eval="(datetime.now() + timedelta(days=1)).strftime('%Y-%m-%d 00:00:00')"
/>
<field name="model_id" ref="product_status.model_product_state" />
<field name="state">code</field>
<field name="code">model._cron_recompute_product_state()</field>
</record>
</odoo>
23 changes: 23 additions & 0 deletions product_status/data/product_state_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="product_state_new" model="product.state">
<field name="code">new</field>
<field name="name">New</field>
<field name="sequence">10</field>
</record>
<record id="product_state_discontinued" model="product.state">
<field name="code">discontinued</field>
<field name="name">Discontinued</field>
<field name="sequence">20</field>
</record>
<record id="product_state_phaseout" model="product.state">
<field name="code">phaseout</field>
<field name="name">Phase Out</field>
<field name="sequence">30</field>
</record>
<record id="product_state_endoflife" model="product.state">
<field name="code">endoflife</field>
<field name="name">End-Of-Life</field>
<field name="sequence">40</field>
</record>
</odoo>
175 changes: 175 additions & 0 deletions product_status/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_status
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-10-28 20:20+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\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.17\n"

#. module: product_status
#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view
msgid ""
"<strong>End-of-life</strong> has priority over the other dates.<br/>\n"
" <strong>Discontinued-until</strong> has priority over <strong>New until</strong>."
msgstr ""
"El <strong>Fin de vida</strong> tiene prioridad sobre las demás fechas.<br/>"
"\n"
" <strong>Descontinuado hasta</strong> tiene prioridad sobre "
"<strong>Nuevo hasta</strong>."

#. module: product_status
#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view
msgid "By order of importance, the status is computed by:<br/>"
msgstr "Por orden de importancia, el estado se computa por:<br/>"

#. module: product_status
#: code:addons/product_status/models/product_state.py:0
#, python-format
msgid "Cannot delete/modified state installed by module, state name: %s"
msgstr ""
"No se puede eliminar/modificar el estado instalado por el módulo, nombre del "
"estado: %s"

#. module: product_status
#: model:product.state,name:product_status.product_state_discontinued
msgid "Discontinued"
msgstr "Discontinuado"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__discontinued_until
#: model:ir.model.fields,field_description:product_status.field_product_template__discontinued_until
#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view
msgid "Discontinued until"
msgstr "Discontinuado hasta"

#. module: product_status
#: model:product.state,name:product_status.product_state_endoflife
msgid "End-Of-Life"
msgstr "Fin de la vida útil"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__end_of_life_date
#: model:ir.model.fields,field_description:product_status.field_product_template__end_of_life_date
#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view
msgid "End-of-life"
msgstr "Fin de la vida útil"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__has_status_date
msgid "Has Status Date"
msgstr "Tiene Fecha Estado"

#. module: product_status
#: model:product.state,name:product_status.product_state_new
msgid "New"
msgstr "Nuevo"

#. module: product_status
#: model:ir.model.fields,help:product_status.field_product_product__new_until
#: model:ir.model.fields,help:product_status.field_product_product__tmpl_new_until
#: model:ir.model.fields,help:product_status.field_product_template__new_until
msgid "New product, and you want to warn your client for a certain time"
msgstr "Nuevo producto, y quiere avisar a su cliente durante cierto tiempo"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__new_until
#: model:ir.model.fields,field_description:product_status.field_product_template__new_until
#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view
msgid "New until"
msgstr "Nuevo hasta"

#. module: product_status
#: model:product.state,name:product_status.product_state_phaseout
msgid "Phase Out"
msgstr "Retirada Progresiva"

#. module: product_status
#: model:ir.model,name:product_status.model_product_product
msgid "Product"
msgstr "Producto"

#. module: product_status
#: model:ir.model,name:product_status.model_product_state
msgid "Product State"
msgstr "Estado del Producto"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__state
#: model_terms:ir.ui.view,arch_db:product_status.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:product_status.product_template_only_form_view
msgid "Product Status"
msgstr "Estado del Producto"

#. module: product_status
#: model:ir.model,name:product_status.model_product_template
msgid "Product Template"
msgstr "Plantilla del Producto"

#. module: product_status
#: model:ir.actions.server,name:product_status.cron_recompute_product_state_ir_actions_server
#: model:ir.cron,cron_name:product_status.cron_recompute_product_state
#: model:ir.cron,name:product_status.cron_recompute_product_state
msgid "Recompute Product State"
msgstr "Recalcular el Estado del Producto"

#. module: product_status
#: model:ir.model.fields,help:product_status.field_product_product__product_state_id
msgid "Select a state for this product"
msgstr "Selecciona un estado para este producto"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__product_state_id
msgid "State"
msgstr "Estado"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_discontinued_until
msgid "Template Discontinued until"
msgstr "Plantilla Interrumpida hasta"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_end_of_life_date
msgid "Template End-of-life"
msgstr "Plantilla Fin de vida útil"

#. module: product_status
#: model:ir.model.fields,field_description:product_status.field_product_product__tmpl_new_until
msgid "Template New until"
msgstr "Plantilla Nueva hasta"

#. module: product_status
#: model:ir.model.fields,help:product_status.field_product_product__discontinued_until
#: model:ir.model.fields,help:product_status.field_product_product__tmpl_discontinued_until
#: model:ir.model.fields,help:product_status.field_product_template__discontinued_until
msgid ""
"When the product is discontinued for a certain time, to warn your "
"client/avoid order during this downtime."
msgstr ""
"Cuando el producto esté descatalogado durante un tiempo determinado, para "
"avisar a su cliente/evitar el pedido durante este tiempo de inactividad."

#. module: product_status
#: model:ir.model.fields,help:product_status.field_product_product__end_of_life_date
#: model:ir.model.fields,help:product_status.field_product_product__tmpl_end_of_life_date
#: model:ir.model.fields,help:product_status.field_product_template__end_of_life_date
msgid ""
"When the product is end-of-life, and you want to warn your client/avoid "
"order in the future."
msgstr ""
"Cuando el producto ha llegado al final de su vida útil y desea advertir a su "
"cliente/evitar que lo pida en el futuro."
Loading
Loading