1、调整功能刀具清单模型的菜单代码位置,解决依赖冲突问题;2、产品采购时,添加一个订单同时采购多个相同产品的校验;3、优化刀柄采购入库时,自动生成的序列号规则;
This commit is contained in:
@@ -206,6 +206,16 @@ class RePurchaseOrder(models.Model):
|
||||
order.message_subscribe([order.partner_id.id])
|
||||
return True
|
||||
|
||||
@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)
|
||||
|
||||
|
||||
class ResPartnerToSale(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
Reference in New Issue
Block a user