Odoo Help

0

Error: QWeb2 - template['ListView.rows']: Runtime Error: Error: QWeb2 - template['ListView.row']: Runtime Error: Error: Campo desconocido state en el dominio [["state","in",["draft"]]]

By
Vladimir
on 11/10/16, 10:11 AM 678 views


Hello everyone, I have the following Error,
Error: QWeb2 - template['ListView.rows']: Runtime Error: Error: QWeb2 - template['ListView.row']: Runtime Error: Error: Campo desconocido state en el dominio [["state","in",["draft"]]]
this is the view code:
<group col="2" colspan="2">
        <field name="id_orden_servicio" />
</group>
and in a .py file.
state = fields.Selection([('draft', 'draft')], default='draft')
id_orden_servicio = fields.Many2one("dfsismet_orden_servicio", onupdate='cascade', ondelete='cascade',                                    string="Orden Servicio",                                    index=True, required=True,                                    states={'draft': [('readonly', True)]},                                    domain="""[('state','!=','Calibracion'),                                    ('id_calibrar_orden', '=', False),('instrumento_tipo','=','1')]""")

Thanks a lot.


0
deep
On 11/11/16, 2:03 AM

Define state field in the view, if it is not need, still define and make it invisible.

Because whenever you add state property in your .py to control the field, then odoo builds the XML Views Arch with modifers stating the state property, so in order to achieve that odoo tries to find the value of state, but when it couldn't  find  the state field itself, then the above error will be raised.

So change your view accordingly as below

    <field name="id_orden_servicio" />
<field name="state" invisible="1"/>
</group>

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.

Register

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)

Stats

Asked: 11/10/16, 10:11 AM
Seen: 678 times
Last updated: 11/11/16, 7:56 AM