Writing attributes
Write the values back to Odoo
When writing values to Odoo you require the following pieces to put the puzzle together:
The attribute line id
The attribute value operation to perform (add / update / delete)
The value to set (e.g. Color = Red or Legs = Steel)
This setup requires the following mappings:
At least 1 Property Mapping for the secondary accessor
product.template.attribute_line_ids
At least 1 Property Mapping for the new or existing value to use (single value)
At least a mapping that sets
product.template.default_code
(or your primary search identifier in the datasource if its notdefault_code
Until further notice we do not support multiple value updates while setting the default_code
. Should you choose to still sync multiple values (it is possible), please note that we will not be able to provide support. It doesn't mean it can't be done - we just can't support you right now.
Create a new Property Mapping for a single attribute line id. Follow the guide to Display Single Attribute Names.
Your display in SharpSync and Odoo should now look something like this:
Example: Legs
The data we want to send to Odoo is:
1
The attribute (this is the ID for Legs)
2
The attribute value id (this is the ID for Aluminium)
[[ 1, [2] ]]
The combined attribute id and value id
[
[ 1, [2] ],
[ 2, [11,12] ]
]
The combined attribute ids and value ids. Attribute 1 (Legs), Value ID 2 (Aluminium) Attribute 2 (Color), Value ID 5 and 8 (Red, Satin Black)
To do this, we create a mapping for the Legs (See Display Single Attribute Names )
Once this is setup, we have the ID of the attribute 'Legs', which is the value 1
Then we take the value 1
and combine it with the possible values from the attribute value ids
Last updated