请教大家个问题,我在跟着赵老师的教程学习odoo18时,为什么加了这行代码( [(‘property_type_id’,‘=’,active_id)])限定域的时候点击房屋类型,就报错了。
<record id="estate_property_offer_act_window" model="ir.actions.act_window">
<field name="name">房屋报价</field>
<field name="res_model">estate.property.offer</field>
<field name="view_mode">list</field>
<field name="domain">[('property_type_id','=',active_id)]</field>
</record>
提示actived_id未定义,但是这个是内置的变量。
现在的问题是,我把这行删了,重启服务,强制刷新前端甚至删除缓存后,点击设置-房屋类型的时候仍然报这个错,代码里面已经没有这行了,为什么还是报错呢?
Odoo客户端错误
UncaughtPromiseError > EvalError
Uncaught Promise > Can not evaluate python expression: ([('property_type_id','=',active_id)]) Error: Name 'active_id' is not defined
Occured on 192.168.2.110 on 2026-01-09 09:34:19 GMT
EvalError: Can not evaluate python expression: ([('property_type_id','=',active_id)])
Error: Name 'active_id' is not defined
EvalError: Can not evaluate python expression: ([('property_type_id','=',active_id)])
Error: Name 'active_id' is not defined
at evaluateExpr (http://192.168.2.110/web/assets/9c492e7/web.assets_web.min.js:3364:54)
at _preprocessAction (http://192.168.2.110/web/assets/9c492e7/web.assets_web.min.js:10016:137)
at Object.doAction (http://192.168.2.110/web/assets/9c492e7/web.assets_web.min.js:10109:170)
at async Object.selectMenu (http://192.168.2.110/web/assets/9c492e7/web.assets_web.min.js:10309:1)