Hello.
I am using a wizard and not how to access data in a field many2one available to the active object. The problem is that if you can not do this kind of query in a wizard, or if you can, as I can pass the field reference for consulting many2one fields available.
The code is as follows:
Code:
def _createName(self, cr, uid, data, context):
product_obj = pooler.get_pool(cr.dbname).get('product.product')
for product in product_obj.browse(cr, uid, data['ids'], context=context):
reads = product_obj.read(cr, uid, [product.id])
for record in reads:
name = record['acabado'].name ##acces field many2one
code = record['default_code'] ##acces field char
The error I get is:
name = record['acabado'].name
AttributeError: 'tuple' object has no attribute 'name'
Any help?? Thanks!!