Attributes are corrupted when names are not unique
Tryton client does not send the domain on the field when requesting attributes.
Here is an example of request sent from Tryton client:
INFO:tryton.rpc:model.product.attribute.search(1, u'sessid', [('name', '=', u'Size')], 0, 1000, None, {context})
The response would be all the attributes named Size irrespective of the attribute set and the client seems to display the first set of keys it receives in return from the server, which then leads to the wrong value being set.
If there are multiple attributes like "Size" which may mean different values in different attribute sets (Shirt - S, M, L, XL|Shoes - 4, 5, 6, 7, 8), this corrupts the attributes display on the tryton client and on subsequently saving the product, the data in database as well.
Seems like a client bug to me rather than having a unique constraint on name of the attribute.