你好,我已经写了一条记录规则如下
domain=['|',('type', '!=', 'private'),('is_prescription', '=', True)])在变量中使用它,如下所示
`product_id = fields.Many2one('product.product', ondelete="cascade", string='Product', required=True, domain=['|',('type', '!=', 'private'),('is_prescription', '=', True)])`把一切都拆散
('|',('type', '!=', 'private'),('type', '=', False))帮助我绕过多公司产品的默认规则。
记录规则('is_prescription', '=', True)帮助我获得特定的产品。
但是domain=['|','|',('type', '!=', 'private'),('type', '=', False),('is_prescription', '=', True)]的规则并不能帮助获得一个特定的产品,即处方,它能得到所有的产品。
我想要达到的是绕过默认规则,然后得到一个产品,即处方,无论产品属于哪个公司,用户也在。
请帮帮我,我是新来的奥多
发布于 2022-01-07 20:46:13
将您的处方规则与"AND-condition“一起与其他规则一起使用,而不是"OR-condition”
domain=[('is_prescription', '=', True),'|',('type', '!=', 'private'),('type', '=', False)]https://stackoverflow.com/questions/70610219
复制相似问题