Repository
OCA/product-attribute · module folder · Try on Runboat
Module version
1.0.0
Category
product
Folder size
0.36 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/product-attribute
Last tracking update
2026-08-07 08:42:54
Authors
Akretion, Odoo Community Association (OCA)
Maintainers
Akretion, Odoo Community Association (OCA)
Committers
Stefan Rijnhart, Weblate, OCA-git-bot, oca-ci
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description
This module provides easier products configuration (in one click). It
allows to configure a product template with only one field.

> ![](static/img/field.png)

**Main use case**: a lot of modules are installed (mrp, purchase, sale,
pos) and products configuration becomes harder for end users: too many
fields to take care of.

You are concerned that at any time a product might be not configured
correctly: this module is your friend.

Thanks to this module, a lot of complexity becomes hidden (default
behavior) to the end user and usability is optimal.

It eases as well the data migration by only specifying the profile field
instead of all fields which depend on it.

Note: This module is meant to be used by skilled people in database
fields creation within the ERP framework.

Additional feature: a default value can be attached to a profile (see §
Configuration, part 3)

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
product_profile_tree_view product.profile list New
product_template_form_view product.template form Inherits product.product_template_form_view
product_template_search_view product.template search Inherits product.product_template_search_view
view_general_configuration res.config.settings form Inherits sale.res_config_settings_view_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (5)

New fields (0)

No new fields.

Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • write(self, vals)

New fields (0)

No new fields.

Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model

New fields (4)
  • explanation Text
    help='An explanation on the selected profile\n(not synchronized with product.template fields)' required=True
  • name Char
    help='Profile name displayed on product template\n(not synchronized with product.template fields)' required=True
  • sequence Integer
    help='Defines the order of the entries of profile_id field\n(not synchronized with product.template fields)'
  • type Selection
    default='consu' help="See 'detailed_type' field in product.template" required=True selection=[('consu', 'Consumable'), ('service', 'Service')]
Public methods (3)
  • check_useless_key_in_vals(self, vals, key)
    @api.model
    If replacing values are the same than in db, we remove them. Use cases: 1/ if in edition mode you switch a field from value A to value B and then go back to value A then save form, field is in vals whereas it shouldn't. 2/ if profile data are in csv file there are processed each time module containing csv is loaded we remove field from vals to minimize impact on products
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    Add a warning to the form view which is otherwise auto-generated
  • write(self, vals)
    Profile update can impact products: we take care to propagate ad hoc changes. If on the profile at least one field has changed, re-apply its values on relevant products

New fields (2)
  • profile_explanation Text
    readonly=True related='profile_id.explanation'
  • profile_id Many2one → product.profile
    comodel_name='product.profile' string='Profile'
Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    fields_view_get comes from Model (not AbstractModel)

New fields (1)
  • group_product_profile Boolean
    help='Display fields computed by product profile module.\nFor debugging purpose see menu\nSales > Configuration \n> Products\n> Product Profiles' implied_group='product_profile.group_product_profile_user' string='Display Product Profile fields'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
20 days ago
Last activity
20 days ago
Repository
OCA/product-attribute
Pull request
[19.0] [MIG] product_profile : Migration to 19.0 (#2361)