【发布时间】:2022-01-06 16:21:59
【问题描述】:
美好的一天, 我写了一个记录规则如下
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)] 规则无助于获得作为处方的特定产品,它的作用是获得所有产品。
我想要实现的是绕过默认规则,然后无论产品属于哪家公司和用户在哪家公司,都得到一个处方产品。
请帮助我,我是 Odoo 的新手
【问题讨论】: