我如何在域过滤器odoo中获得超过7个字段
How can i get more than 7 fields in domain filter odoo
这是代码,它过滤了 7 个字段我需要超过 7 个如何实现它。请我缩进
class sem(models.Model):
_name = 'module4_sem'
_rec_name = 'id'
sem_no = fields.Char("Semester No")
class Semester(models.Model):
_name = 'module4_semester'
_description = 'semester info'
cou = fields.Many2one('module4_course',"Course")
sem_tot = fields.Integer(related = 'cou.sem_no',string = "Total Semester")
sem_no = fields.Many2one('module4_sem',string="Semester no")
@api.onchange('sem_tot')
def sem_count(self):
for rec in self:
rec.sem_no = False
s = self.env['module4_sem'].sudo().search([('id','<=',rec.sem_tot)])
return {'domain':{'sem_no':[('id','in',s.ids)]}}
@api.onchange('sem_tot')
def sem_count(self):
model = self.env['module4_sem'].sudo()
s_ids = []
for rec in self:
rec.sem_no = False
s = model.search([('id', '<=', rec.sem_tot)])
s_ids.extend(s.ids)
return {'domain':{'sem_no': [('id', 'in', s_ids)]}}
这是代码,它过滤了 7 个字段我需要超过 7 个如何实现它。请我缩进
class sem(models.Model):
_name = 'module4_sem'
_rec_name = 'id'
sem_no = fields.Char("Semester No")
class Semester(models.Model):
_name = 'module4_semester'
_description = 'semester info'
cou = fields.Many2one('module4_course',"Course")
sem_tot = fields.Integer(related = 'cou.sem_no',string = "Total Semester")
sem_no = fields.Many2one('module4_sem',string="Semester no")
@api.onchange('sem_tot')
def sem_count(self):
for rec in self:
rec.sem_no = False
s = self.env['module4_sem'].sudo().search([('id','<=',rec.sem_tot)])
return {'domain':{'sem_no':[('id','in',s.ids)]}}
@api.onchange('sem_tot')
def sem_count(self):
model = self.env['module4_sem'].sudo()
s_ids = []
for rec in self:
rec.sem_no = False
s = model.search([('id', '<=', rec.sem_tot)])
s_ids.extend(s.ids)
return {'domain':{'sem_no': [('id', 'in', s_ids)]}}