0

嗨,当我尝试在 odoo 10 中获取 one2many track_visibility 的功能时,当我点击保存时,它会抛出这个错误:

NameError:未定义全局名称“Anything”

这是我的代码:

class TransportManagementLines(models.Model):

    
    _name = 'transport.management.lines'
    _inherit = ['mail.thread','ir.needaction_mixin']
    _description = 'Transport Management Lines'
    _rec_name = 'chauffeur'
    

    lines_id = fields.Many2one('transport.management',string="Crée Par")
    chauffeur = fields.Many2one('transport.management.matricule',string='Nom Chauffeur', required="1")

这是我使用的功能:

 @api.model
    def create(self, vals):
                res = super(Anything, self).create(vals)
                if vals:
                    message = "Changes info"
                    res.lines_id.message_post(message)
                return res

4

0 回答 0