Odoo Help

Welcome!

This community 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.

0

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

By
Julian Solorzano
on 10/1/14, 4:14 PM 784 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'}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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