Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
5148 Ansichten


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.


Avatar
Verwerfen
Beste Antwort

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>
Avatar
Verwerfen