采购单重复产品限制去除
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user