'NoneType'对象没有带继承的属性'_columns'

时间:2015-11-18 00:12:14

标签: openerp openerp-7

当我的手机只有一名员工时,我真的很想知道 当它的gps只有一辆车,当它的gprs只有一个客户 没有告诉一个单一的关系,它出现了这个错误 'NoneType'对象没有属性'_columns'

 class dispositivos(osv.osv):
    _name = 'dispositivos'
    _description = 'Inventario Dispositivos'
    _inherits = {'chips': "chips_id",
                 'fleet.vehicle': 'fleet.vehicle_id',
                 'base.res_partner': 'base.partner_id',
                 'hr.employee': 'hr.employee_id' }

    _columns = {         
                'name' : fields.selection ([('phone','Telefono'),
                                            ('gps','GPS'),                 
                                            ('gprs','GPRS')],
                                        'Tipo de dispositivo',
                                        track_visibility='onchange',
                                        order = True), 
                'imei':fields.char('Imei',required = True),              
                'num_serie' : fields.char('Numero  dispositivo'),              
                'marca' : fields.char('Marca del dispositivo'),
                'modelo' : fields.char('Modelo del dispositivo'),
                'ide_gps' : fields.char('IDE del dispositivo'),
                'num_serie_bateria' : fields.char('Bateria del telefono'),
                'chips_id' : fields.many2one('chips','Chip del dispositivo'),
                'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehiculo'),
                'partner_id' :fields.many2one'res.partner', 'Cliente',domain="[('costumer','=',True)]"),
                'employee_id' : fields.many2one('hr.employee', 'Empleado'),
                'activo' : fields.boolean('Dispositivo en uso'),

           }

     _defaults = {
             'activo' : False,
             }

dispositivos()

class chips(osv.osv):
    _name = 'chips'
    _description = 'Inventario Chips'

    _columns = {                         
            'name' : fields.char('Imei del Chip', required=      True),               
            'numero_tel' : fields.char('Numero de telefono'),
            'marca' : fields.char('Compañia'),
            'activo' : fields.boolean('Dispositivo en uso'),               
           }

    _defaults = {
             'activo' : False,
             }

chips()

2 个答案:

答案 0 :(得分:0)

你可以试试这段代码:

class dispositivos(osv.osv):
    _name = 'dispositivos'
    _description = 'Inventario Dispositivos'
    _inherits = {'chips': "chips_id",
             'fleet.vehicle': 'vehicle_id',
             'base.res_partner': 'res_partner_id',
             'hr.employee': 'employee_id' }

答案 1 :(得分:0)

解决方案是简单的我在课堂上移动了类芯片并且感谢所有