Odoo Help


Why is the name of my dynamically generated fields not appearing in the list view?

Julian Solorzano
on 10/1/14, 4:14 PM 1,113 views

In the image it can be seen that the last three columns don't have headers. These last three fields were created dynamically like so:

def __init__(self, pool, cr):
        cr.execute("select id,name from stock_warehouse")
        for row in cr.fetchall():
            self._columns["qty_warehouse_%s"%row[0]] = fields.function(get_qty_warehouse, type="float", method=False, string=row[1], multi="qtys")
        return super(reporte_almacenes, self).__init__(pool, cr)

The output of the fields_get method called when the view is to be displayed shows that the correct string is being passed so what could be the problem? What else does the web client needs to correctly display a field?

Output of fields get:

qty_warehouse_2 {'function': 'get_qty_warehouse', 'digits': (16, 2), 'fnct_inv': False, 'fnct_inv_arg': False, 'readonly': 1, 'fnct_search': False, 'type': 'float', 'store': False, 'string': u'Bodega'}
qty_warehouse_3 {'function': 'get_qty_warehouse', 'digits': (16, 2), 'fnct_inv': False, 'fnct_inv_arg': False, 'readonly': 1, 'fnct_search': False, 'type': 'float', 'store': False, 'string': u'Tienda'}
qty_warehouse_1 {'function': 'get_qty_warehouse', 'digits': (16, 2), 'fnct_inv': False, 'fnct_inv_arg': False, 'readonly': 1, 'fnct_search': False, 'type': 'float', 'store': False, 'string': u'Your Company'}

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/1/14, 4:14 PM
Seen: 1113 times
Last updated: 3/16/15, 8:10 AM