Metadata-Version: 2.1
Name: odoo-addon-product_template_attribute_value_xmlid
Version: 20.0.1.0.1.2
Requires-Dist: odoo==20.0.*
Summary: Predictable XML IDs for product variant attribute values
Home-page: https://github.com/GetFluvo/addons
License: LGPL-3
Author: Fluvo
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 20.0
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Description-Content-Type: text/x-rst

=======================
Attribute Value XML IDs
=======================

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

.. |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/license-LGPL--3-blue.png
    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
    :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-GetFluvo%2Faddons-lightgray.png?logo=github
    :target: https://github.com/GetFluvo/addons/tree/20.0/product_template_attribute_value_xmlid
    :alt: GetFluvo/addons

|badge1| |badge2| |badge3|

This module gives every ``product.template.attribute.value`` record a
predictable XML ID, so that product variants can be referenced in
imports and integrations without looking up database ids.

When Odoo creates a template attribute value, the module adds an XML ID
``product_template_attribute_value.<template>_<value>``, where:

- ``<template>`` is the name of the XML ID of the product template;
- ``<value>`` is the name of the XML ID of the attribute value.

Characters other than letters, digits and underscores are replaced by
``_``.

No XML ID is generated when the template or the attribute value has no
XML ID (the result would not be predictable), or when the name is
already used by another record; the latter is logged as a warning.

**Table of contents**

.. contents::
   :local:

Use Cases / Context
===================

Product variants are built from ``product.template.attribute.value``
records: one per attribute value on a product template (for example
*Size: L* on a *Desk Organizer*). Odoo gives these records no XML ID, so
imports and integrations have to look them up by database id, which
differs between databases.

With a predictable XML ID, extra prices, exclusions and variant
combinations can be imported and synchronized with external systems by
reference.

Usage
=====

XML IDs are generated automatically when attribute values are added to a
product template.

To generate the XML IDs of records that existed before the module was
installed:

1. Go to *Sales > Products > Product Template Attribute Values*.
2. Click *Generate XML IDs* above the list.

All template attribute values without a generated XML ID get one, if
their template and attribute value have an XML ID.

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

- This module might result in unpredictable behaviour when used with
  enterprise module ``product_barcodelookup``.

Changelog
=========



Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/GetFluvo/addons/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/GetFluvo/addons/issues/new?body=module:%20product_template_attribute_value_xmlid%0Aversion:%2020.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
-------

* Fluvo

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

- bosd

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



Maintainers
-----------

This module is part of the `GetFluvo/addons <https://github.com/GetFluvo/addons/tree/20.0/product_template_attribute_value_xmlid>`_ project on GitHub.

You are welcome to contribute.
