采购单重复产品限制去除

This commit is contained in:
liaodanlong
2025-01-14 15:10:22 +08:00
parent 9d6baee082
commit e5f15661ce

View File

@@ -371,15 +371,15 @@ class RePurchaseOrder(models.Model):
pp.purchase_id = [(6, 0, [purchase_order.id])]
# self.env.cr.commit()
@api.onchange('order_line')
def _onchange_order_line(self):
for order in self:
if order.order_line:
line = order.order_line
product = line.product_id
product_id = product.ids
if len(product_id) != len(line):
raise ValidationError('%s】已存在,请勿重复添加' % product[-1].name)
# @api.onchange('order_line')
# def _onchange_order_line(self):
# for order in self:
# if order.order_line:
# line = order.order_line
# product = line.product_id
# product_id = product.ids
# if len(product_id) != len(line):
# raise ValidationError('【%s】已存在请勿重复添加' % product[-1].name)
def button_confirm(self):
result = super(RePurchaseOrder, self).button_confirm()