In purchase order lines I want to have 2 fields either readonly or not depending on the product selected.
I understand how to determine which product is selected in the onchange function, but i don't know how to make those fields readonly.
I imagine it is something like:
res = {'value': {'price_unit': price_unit or 0.0, 'name': name or '', 'product_uom' : uom_id or False}, 'readonly': {'diameter': 1}
res = {'value': {'price_unit': price_unit or 0.0, 'name': name or '', 'product_uom' : uom_id or False}, 'attrs': {'diameter':[('readonly', True)],}}
But neither of these lines of code make the field diameter on the purchase order line read only.
What am I missing?
Anything new on how to update field attributes in python rather than XML?