Repository
OCA/product-attribute · module folder · Try on Runboat
Module version
1.0.0
Category
Product
Folder size
0.09 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/product-attribute
Last tracking update
2026-08-07 09:06:25
Authors
Camptocamp, Odoo Community Association (OCA)
Maintainers
Camptocamp, Odoo Community Association (OCA)
Committers
Maksym Yankin, Weblate, OCA-git-bot, oca-ci
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description
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*.

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
product_normal_form_view product.product form Inherits product.product_normal_form_view
product_product_tree_view product.product tree Inherits product.product_product_tree_view
product_template_form_view product.template.form.inherit product.template form Inherits product_state.product_template_form_view
product_template_only_form_view product.template form Inherits product.product_template_only_form_view
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (3)

New fields (9)
  • discontinued_until Date
    help='When the product is discontinued for a certain time, to warn your client/avoid order during this downtime.' string='Discontinued until'
  • end_of_life_date Date
    help='When the product is end-of-life, and you want to warn your client/avoid order in the future.' string='End-of-life'
  • has_status_date Boolean
    compute='_compute_has_status_date' store=False
  • new_until Date
    help='New product, and you want to warn your client for a certain time' string='New until'
  • product_state_id Many2one → product.state
    comodel_name='product.state' default=<expr> group_expand='_read_group_state_id' help='Select a state for this product' index=True inverse='_inverse_product_state_id' string='State' tracking=10
  • state Char
    compute='_compute_product_state' index=True inverse='_inverse_product_state' readonly=True store=True string='Product Status'
  • tmpl_discontinued_until Date
    related='product_tmpl_id.discontinued_until' string='Template Discontinued until'
  • tmpl_end_of_life_date Date
    related='product_tmpl_id.end_of_life_date' string='Template End-of-life'
  • tmpl_new_until Date
    related='product_tmpl_id.new_until' string='Template New until'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (2)
  • unlink(self)
  • write(self, vals)

New fields (3)
  • discontinued_until Date
    help='When the product is discontinued for a certain time, to warn your client/avoid order during this downtime.' string='Discontinued until'
  • end_of_life_date Date
    help='When the product is end-of-life, and you want to warn your client/avoid order in the future.' string='End-of-life'
  • new_until Date
    help='New product, and you want to warn your client for a certain time' string='New until'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…