Search code examples
pythonodoo-10

How do I see key/value in an odoo 10 recordset?


I'm using pdb to debug a problem with my odoo. I can see the recordset I'm interested in, but I need to know what keys are available in it. Sure, I could guess that it'll probably have "name", "create date", and "id" - but what other useful things might be in there?

    (Pdb) variant.attribute_value_ids
    product.attribute.value(15,)
    (Pdb)

Solution

  •     (Pdb) pp variant.attribute_value_ids.read()
        [{'__last_update': '2018-02-12 14:46:37',
        'attribute_id': (3, u'5-20 Acres'),
        'create_date': '2018-02-12 14:45:42',
        'create_uid': (40, u'User Name'),
        'display_name': u'5-20 Acres: 15-25',
        'id': 15,
        'name': u'15-25',
        'price_extra': 0.0,
        'price_ids': [],
        'product_ids': [195, 211, 235, 183, 189],
        'sequence': 3,
        'write_date': '2018-02-12 14:46:37',
        'write_uid': (40, u'User Name')}]
        (Pdb)