关于active_id报错问题

请教大家个问题,我在跟着赵老师的教程学习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)

升级模块再刷新。

谢谢,我尝试了升级模块,但并未解决这个问题。

ame ‘active_id’ is not defined 你是想用本记录的 id 么?还是单独有一个字段叫active_id呀?你试试直接用 id 呢?

去数据库把这个动作数据删除重新升级

激活开发者模式,删除模块,重新安装