我如何继承mail.thread类

时间:2014-05-20 07:21:37

标签: python-2.7 openerp

TypeError:模型“workflow.example”指定一个不存在的父类“mail.thread” 您可能需要在父类的模块上添加依赖项。

    _name = 'workflow.example'
    _inherit = ['mail.thread']
    _columns = {
        'abc':fields.char('abc', size=20),
        'state': fields.selection([
        ('new','New'),
        ('assigned','Assigned'),
        ('negotiation','Negotiation'),
        ('won','Won'),
        ('lost','Lost')], 'Stage', readonly=True, track_visibility='onchange'),
        'field_1': fields.char('Field_1', size=20),
        'field_2': fields.char('Field_2', size=16),        
    }

 workflow_example()

1 个答案:

答案 0 :(得分:4)

错误消息说,您必须更新__openerp__.py文件并将“mail”添加到“depends”参数:

"depends" : ["base", "mail"],