Update product.attribute value

Hello,

Thanks for the Tryton. I’m using the tryton within flask module.

Tried to update existing product.attributes with following approach:

product.attributes['width'] = Decimal('100')
product.save()

But the product.attributes remained untouched. What is the correct way to do this or to add another from the same product.attribute.set?
I checked the column of product.attributes is kind of json dump. So there must be proper way to update this column.

Thanks,

M+

The Tryton ORM can not detect (for now) that the dictionary has been updated. So you must trigger the change manually with for example:

product.attributes['width'] = Decimal('100')
product.attributes = product.attributes  # Trigger change
product.save()
2 Likes

thanks, it works perfectly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.