Accept Merge Request #1755: (feature/customer_supply -> develop)
Merge Request: 采购单重复产品限制去除 Created By: @廖丹龙 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @胡尧 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1755
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