콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5171 화면


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.


아바타
취소
베스트 답변

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>
아바타
취소