【发布时间】:2021-09-05 04:41:29
【问题描述】:
我想添加一个具有'stock.production.lot' 的Many2many 字段的向导,仅显示具有双倍Lot/Serial Number 的记录
我做了获取过滤记录的功能,现在我需要显示它
class DoublingNumber(models.TransientModel):
_name = 'doubling.number'
double_number_id =fields.Many2many('stock.production.lot' ,string="Numéros en doublant" )
@api.multi
def _default_double_number(self):
log.warning("Hola")
double_record = []
records =self.env['stock.production.lot'].search([])
for record in records :
for record2 in records :
if record.name == record2.name and record.product_id != record2.product_id :
double_record.append(record2)
break
return double_record
现在怎么显示??!
【问题讨论】: