SharpSync
  • Welcome
  • Fundamentals
    • Getting Started
      • Registration
      • Landing Page
      • Support
      • Subscription
    • Data Sources
    • Property Mappings
    • Rule Templates
    • BOM Comparison
    • Data Safety
    • Troubleshooting
      • Duplicate component paths
      • OAuth 2.0
  • Data Sources
    • Autodesk Inventor
    • CSV
      • Getting Started
      • Importing a Bill of Materials (BOM)
    • MS Dynamics 365 Business Central
      • Getting Started
      • Item Fields Json & Internal Names
      • Resource Fields Json & Internal Names
      • List Names For nestedObject Mappings
    • NetSuite
      • OAuth Setup
        • Permissions
      • Suite API Setup
      • Create an uploads folder
      • Setting up a thumbnail folder
      • Authentication + Configuration
      • Common setup
        • Configure quantity mapping
        • Configure accounts mappings
        • Configure itemType mapping
        • Configure isPhantom mapping
        • Configure subsidiary mapping
        • Configure price mapping
        • Configure Where Used Link mapping
        • Configure thumbnail mapping
        • Common Mapping Rules
        • Common List names
      • Advanced Bill of Materials
      • Configure Server Side Script
        • Example Server Side Script
      • Configure SharpSync to use Server Side Script
      • Configure Routings
      • Integration tips
      • Troubleshooting
    • Odoo
      • Getting Started
        • Authentication + Configuration
        • Debugging tips
      • Common Setup
        • Map BOM Codes
        • Map BOM Types
        • Map Attribute Values
          • Reading Attributes - Overview
          • Display All Attribute Names
          • Display Single Attribute Values
          • Writing attributes
      • Product Management
      • Hosting Options
      • List Names
      • Permissions
    • Onshape
      • Getting Started
      • Setting up Derivatives
    • Propel PLM
      • Getting Started
    • SolidWorks
    • SolidWorks PDM
      • Downloading and installing the add-in
      • Configure the add-in
      • Setting up the Solidworks PDM Web 2
      • Troubleshooting
      • Submitting a BOM for update
  • Property Mappings
    • Property Mapping Settings
      • Rendering Types
    • Rule Templates
      • Import / Export
        • Append text
        • Calculate number
        • Export manipulation
        • Format as decimal number
        • Prepend text
        • Remove property
        • Replace all instances
        • Replace first instance
        • Round to nearest X
        • Select from JSON
        • Set cell value
        • Set empty cells
        • Text manipulation
      • Display
        • Number between
        • Text contains
        • Text ends with
        • Text evaluation
        • Text is a number
        • Text is exactly
        • Text is in list
        • Text is not a number
        • Text is not empty
        • Text is not in list
        • Text length between
        • Text length is exactly
        • Text maximum length
        • Text minimum length
        • Text not contains
        • Text not ends with
        • Text not starts with
        • Text starts with
  • Advanced
    • Derivatives
    • Advanced Scripting
  • User management
    • User Management
    • Application Permissions
Powered by GitBook
On this page
  • Adding an removing attributes in Odoo
  • Single attributes values
  • Multiple attributes
  • Displaying an attribute as a Property Mapping
  • Limitations in Odoo on Uniqueness
  1. Data Sources
  2. Odoo
  3. Common Setup

Map Attribute Values

PreviousMap BOM TypesNextReading Attributes - Overview

Last updated 25 days ago

Some terms before you read the below:

Term
Explanation

product.template

A product. The top level type which encapsulates all the information about a product that is sold on the web portal

product.product

A product variant. A different version of the product.template. It has something different like a color, material or finish, but has the same underlying geometry or shares some properties which are similar.

There is a 1:1 or 1:N relationship between product.templateand product.product, depending on the number of attributes defined.

unique identifier

The value on a product.template or product.product that uniquely identifies it in the entire Odoo system.

CAUTION: You should note that attributes (In Odoo) are the equivalent of configurations in your CAD system.

This means that:

  1. For a given configuration in your CAD system,

  2. The properties for the model will list as multiple attributes in a product template, but only a single value on a product variant.

  3. Deleting an attribute is the equivalent of deleting one or more configurations (unless they are referenced on a purchase order, in which case they will be archived (becomes invisible))

Please read the information below carefully as it could result in data loss in Odoo if done incorrectly!

CAUTION: Removing an attribute value (if there is more than 1 value for the same attribute) will remove the associated variant (unless it is used in a purchase order).

Adding an removing attributes in Odoo

When adding new attributes in Odoo, Odoo automatically creates new variants. It does not set the internal reference (you have to do that), but it creates multiple variants. Product Templates and Product Variants have a 1:N relationship in Odoo. For a single template attribute value, it is a 1:1 relationship. Anything more than that results in multiple product variants.

[You can add new Attributes (and in doing so, product variants) by navigating to the Attributes and variants Tab in Odoo and adding new values]

Single attributes values

If a single attribute with 1 value is added, the default product.product variant is updated with that value.

If another attribute is added, also only with a single value, only 1 variant is available.

If any more than a single value is added, then an additional variants are created with the new values:

SharpSync does not currently support the generation of multiple variant lines with multiple attribute values. Only a single attribute value is supported.

Multiple attributes

Multiple attributes in Odoo automatically adds multiple variants. It increases the relationship from a 1xproduct.template:1x product.productto a 1T:N:M relationship where

  • 1T = 1 Product Template

  • N = N number of attributes

  • M = M number of variants

Below is an image that illustrates this for the product A1-PN, where 2 different attributes with 2 values each results in 4 variants.

Displaying an attribute as a Property Mapping

Each configuration's properties in the CAD system will be mapped as an attribute in Odoo. Let's say we have the following setup:

  • Assembly A1-PN, with configuration

    • C1

    • C2

Each configuration has a Color value.

  • C1, Color = Red

  • C2, Color = Satin Black.

Each configuration has a Finish value

  • C1, Finish = Matte

  • C1, Finish = Gloss

To display these values in SharpSync, we map the following Property Mappings

  • product.template.attributes

Do NOT map product.template.attribute_line_ids. These values are the ids of the attribute lines, not the attribute values.

There is a 1:1 mapping in the BOM comparison screen for Color. Sending the BOM to SharpSync should display either a value of Blue OR Red for the part. Not both.

There is a 1:1 mapping in the BOM comparison screen for Finish. Sending the BOM to SharpSync should display either a value of Satin Black OR Bronze for the part. Not both.

From SharpSync ⇒ Odoo

You should thoroughly test this functionality when mapping attributes. Incorrectly mapping + setting updates can delete product.product variants in Odoo. You have been warned!

Attributes in Odoo are analogous to configuration values in a CAD system. When adding an attribute to a product template or a product variant, you are creating a new variant (new configuration) of that product.

To setup attribute lists in SharpSync these are major steps:

  • Read the values

  • Setup a Render Type

  • Write the values back to Odoo

Limitations in Odoo on Uniqueness

Odoo uses attribute values like CAD configurations.

Let's sketch a hypothetical scenario which, while possible in Odoo, is not supported by SharpSync.

You have a product template (T1) with variants (v1, v2, v3) which were created through setting some variant attribute values.

You add a unique internal reference to each variant namely

  • PT1-PV1-I

  • PT1-PV2-I

  • PT1-PV3-I

You then archive, say, PV2. In this step, the internal reference is no longer considered as part of the uniqueness rule in Odoo.

You then rename PV3 to PV2.

Finally, you unarchive the original PV2.

The situation you've now arrived at is that PV2 contains 2 product variants (product.product) instances with the same internal reference. Attempting to save either will result in an error in Odoo informing you that you have a unique constraint violation. But importantly, it does allow the duplicates!.

In SharpSync, when setting the primary search identifier to default_code (which is the internal name of the internal reference) field, SharpSync will search for and sometimes find both items if both variants are linked to the same BOM. This will result in an error stating that you have duplicate items.

The fix

In Odoo - change the internal or unique reference for the item shown in SharpSync to something which makes it unique again.

For every attribute value added per attribute line on a product template, a new variant is created
Adding an attribute creates additional product variants (product.product) with the new value.
Adding multiple attributes increases the count of product variants (product.product)