Openerp 搜索多个字段

Openerp 搜索多个字段,openerp,odoo-10,Openerp,Odoo 10,employee\u idv01是一个many2many字段,employee是一个Many2one字段 records\u shift=self.env['shift\u affectation'].search([('employee\u idv01','=',employee.name),('date\u r2','>=',date1),('date\u r1',”您可以尝试以下代码: records_shift =self.env['shift_affectation'].search

employee\u idv01
是一个
many2many
字段,
employee
是一个
Many2one
字段

records\u shift=self.env['shift\u affectation'].search([('employee\u idv01','=',employee.name),('date\u r2','>=',date1),('date\u r1',”您可以尝试以下代码:

records_shift =self.env['shift_affectation'].search([('employee_idv01','=',self.employee.id),('date_r2','>=',self.date1),('date_r1','<=',self.date2)])

records\u shift=self.env['shift\u affectation'].search([('employee\u idv01','=',self.employee.id),('date\u r2','>=',self.date1),('date\u r1','您可以删除域中最后一个(,)错误:records\u shift=self.env['shift\u affectation'.search]([('employee_idv01','=',self.employee_id.id),('date_r2','>=',date1),('date_r1','employee_idv01'是一个M2m字段,因此使用a='不符合逻辑。请尝试此代码记录self.env['shift_affectation']。搜索([('employee_idv01','=','self.employee.id),('date r2','>=','self.date1),('date"date)u','date),不幸的是,再次记录了一个错误:self self self self.shift['shift\u affectation'].搜索([('employee\u idv01','=',self.employee\u id.id),('date\u r2','>=',date1),('date\u r1','