You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Odoo继承报错:AttributeError: 'super'对象无'action_send_email'属性

问题:关联维修工单时修改帮助台工单阶段报错

需求

在关联工单的维修视图中点击“维修”按钮时,修改帮助台工单的阶段。

操作步骤

  • 在自定义模块的manifest文件中添加对repair模块的依赖:
    'depends':['base', 'repair', 'helpdesk', 'stock'],
    
  • 在models目录下创建repair.py文件,代码如下:
    from odoo import api, fields, models
    class Repair(models.Model):
        _inherit = "repair.order"
        def action_send_mail(self):
            res = super().action_send_email()
    
            # 标记工单为“等待客户确认”
            mystuff
    
            return res
    

报错信息

AttributeError: 'super' object has no attribute 'action_send_email'

排查过程

尝试谷歌搜索、检查缩进空格、在super中传入类名等方法,均未解决问题。确认要继承的src/odoo/addons/repair/models/repair.py中的repair.order类存在action_send_mail方法,且能成功调用super().action_repair_confirm,但调用super().action_send_email仍报错。

问题根源

添加日志排查后发现:方法名拼写错误,action_send_mail与调用的action_send_email少了一个字母'e'。

内容的提问来源于stack exchange,提问作者free94

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 04:19:59