1、组装单添加按是否组装排序;2、修改功能刀具组装流程中搜索功能刀具产品的条件

This commit is contained in:
yuxianghui
2024-05-18 17:05:39 +08:00
parent d1c08023b9
commit f05301320c
3 changed files with 6 additions and 5 deletions

View File

@@ -802,12 +802,13 @@ class ProductProduct(models.Model):
"""
创建功能刀具批次/序列号记录
"""
product_id = self.env['product.product'].search([('name', '=', '功能刀具')])
product_id = self.env['product.product'].search([('categ_type', '=', '功能刀具'), ('tracking', '=', 'serial')])
if not product_id:
logging.info('没有搜索到功能刀具产品:%s' % product_id)
raise ValidationError('没有找到按唯一序列号追溯的功能刀具产品信息!')
stock_lot = self.env['stock.lot'].create({
'name': self.get_stock_lot_name(tool_assembly_order_id),
'product_id': product_id.id,
'product_id': product_id[0].id,
'company_id': self.env.company.id
})
# 获取位置对象