Product Attribute Model Link

product_attribute_model_link
REPOSITORY
REPOSITORYOCA/product-attribute
GIT
GIThttps://github.com/OCA/product-attribute.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-attribute/tree/16.0/product_attribute_model_link
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYProduct
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Cetmix
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Cetmix
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Ivan Sokolov, angelinaanaki
WEBSITE
WEBSITEhttps://github.com/OCA/product-attribute
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:48
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/product-attribute:
    - product_attribute_archive
odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
product_attribute_model_link_form product.attribute.model.link.form product.attribute xpath Inherits product.product_attribute_view_form
view_linked_record_wizard_form linked.record.wizard.form linked.record.wizard form New
Models touched (3)

New fields (1)
  • linked_record_ref Reference
    selection='_select_target_model' string='Linked Record'
Public methods (1)
  • action_save_linked_record(self)
    Action to save the linked record

New fields (8)
  • apply_to_products_on_create Boolean
    help='If enabled when a new attribute value is created it will be automatically added to all existing products that use this attribute. Attention! You must completely understand possible consequences and use this option with care!'
  • create_from_attribute_values Boolean
    help='If enabled when a new attribute value is added to the attribute a new record will be created in the linked model. Attention! The only value passed explicitly on creation will be the linked field containing the new attribute value name. You must ensure that this would be enough for new record creation. Otherwise an exception will be raised. If a digital field is used a conversion attempt will be done. If conversion fails an exception might be raised.'
  • delete_when_attribute_value_is_deleted Boolean
    help="When enabled if an attribute value is deleted linked record will be deleted too. Use with extreme care! This option is available only if 'Create from Attribute Values' option is enabled."
  • domain Char
    default='[]' help='If configured only records matching the domain will be used for attribute value creation. Warning: updating domain will not affect existing attribute values!' string='Domain (optional)'
  • linked_field_id Many2one → ir.model.fields
    domain="[('store', '=', True), ('relation', '=', False), ('model_id', '=', linked_model_id)]" help='Field of the selected model that will be used for the attribute value names. Can be any field except for related or computed non-stored ones. Digital field values will be converted to Char automatically. Warning: changing or removing existing value will not affect existing attribute values!' args: 'ir.model.fields', 'Linked field'
  • linked_model_id Many2one → ir.model
    domain="[('transient', '=', False)]" help='Model which records will be used for the attribute values. Cannot be a transient model. Warning: changing or removing existing value will not affect existing attribute values!' args: 'ir.model', 'Linked model'
  • modify_from_attribute_values Boolean
    help="If enabled when an attribute value is renamed linked field value in the linked model will be updated accordingly. If a digital field is used a conversion attempt will be done. If conversion fails an exception might be raised. This option is available only if 'Create from Attribute Values' option is enabled."
  • res_model_name Char
    related='linked_model_id.model' string='Model'
Public methods (4)
  • add_attribute_value_from_linked_record(self)
    Action to open a wizard for the linked record. :return: Action dictionary to open the wizard.
  • create(self, vals_list)
    @api.model_create_multi
  • unlink(self)
  • write(self, vals)

New fields (1)
  • linked_record_ref Reference
    selection='_selection_target_model' string='Linked record'
Public methods (5)
  • action_open_linked_record_wizard(self)
    Action to open a wizard for the linked record. :return: Action dictionary to open the wizard.
  • convert_attribute_value(self, value, linked_field)
    Convert attribute value name to the appropriate data type based on the linked field's type. :param value: Value to be converted. :return: Converted value or the original value if no conversion is needed.
  • create(self, vals_list)
    @api.model_create_multi
    Override to create records based on attribute values. :param vals_list: List of dictionaries containing attribute values for creating records. :return: Created records. :raise: ValidationError if conversion fails for a field.
  • unlink(self)
    Delete records and associated linked records based on specified conditions. :return: Result of the unlink operation.
  • write(self, vals)
    Override to modify the linked records with given values. :param vals: Dictionary of values to be updated. :return: Result of the write operation. :raise: ValidationError if conversion fails for a field.