1、序列号模型添加Rfid字段的重复校验;功能刀具模型优化搜索视图的字段;优功能刀具组装流程的值

This commit is contained in:
yuxianghui
2024-05-16 09:41:57 +08:00
parent 002c5c06b4
commit 1c441d388f
4 changed files with 25 additions and 30 deletions

View File

@@ -615,17 +615,17 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
self.env['stock.picking'].create_stocking_picking(stock_lot, functional_tool_assembly, self)
# 刀具物料出库
if self.handle_code_id:
product_id.tool_material_stock_moves(self.handle_code_id)
product_id.tool_material_stock_moves(self.handle_code_id, self.assembly_order_code)
if self.integral_product_id:
self.integral_product_id.material_stock_moves(self.integral_freight_barcode)
self.integral_product_id.material_stock_moves(self.integral_freight_barcode,self.assembly_order_code)
if self.blade_product_id:
self.blade_product_id.material_stock_moves(self.blade_freight_barcode)
self.blade_product_id.material_stock_moves(self.blade_freight_barcode,self.assembly_order_code)
if self.bar_product_id:
self.bar_product_id.material_stock_moves(self.bar_freight_barcode)
self.bar_product_id.material_stock_moves(self.bar_freight_barcode,self.assembly_order_code)
if self.pad_product_id:
self.pad_product_id.material_stock_moves(self.pad_freight_barcode)
self.pad_product_id.material_stock_moves(self.pad_freight_barcode,self.assembly_order_code)
if self.chuck_product_id:
self.chuck_product_id.material_stock_moves(self.chuck_freight_barcode)
self.chuck_product_id.material_stock_moves(self.chuck_freight_barcode,self.assembly_order_code)
# ============================创建功能刀具列表、安全库存记录===============================
# 封装功能刀具数据
@@ -820,7 +820,7 @@ class ProductProduct(models.Model):
stock_location_id = self.env['stock.location'].search([('name', '=', '组装后')])
# 创建功能刀具该批次/序列号 库存移动和移动历史
stock_lot.create_stock_quant(location_inventory_id, stock_location_id, functional_tool_assembly.id,
'功能刀具组装', obj, obj.after_tool_groups_id)
self.assembly_order_code, obj, obj.after_tool_groups_id)
return stock_lot
@@ -846,7 +846,7 @@ class ProductProduct(models.Model):
num = "%03d" % m
return code + str(num)
def tool_material_stock_moves(self, tool_material):
def tool_material_stock_moves(self, tool_material, assembly_order_code):
"""
对刀具物料进行库存移动到 刀具组装位置
"""
@@ -854,12 +854,12 @@ class ProductProduct(models.Model):
location_inventory_id = tool_material.quant_ids.location_id[-1]
stock_location_id = self.env['stock.location'].search([('name', '=', '刀具组装位置')])
# 创建功能刀具该批次/序列号 库存移动和移动历史
tool_material.create_stock_quant(location_inventory_id, stock_location_id, None, '功能刀具组装', False, False)
tool_material.create_stock_quant(location_inventory_id, stock_location_id, None, assembly_order_code, False, False)
def material_stock_moves(self, shelf_location_barcode):
def material_stock_moves(self, shelf_location_barcode, assembly_order_code):
# 创建库存移动记录
stock_move_id = self.env['stock.move'].sudo().create({
'name': '功能刀具组装',
'name': assembly_order_code,
'product_id': self.id,
'location_id': self.env['stock.location'].search([('name', '=', '刀具房')]).id,
'location_dest_id': self.env['stock.location'].search([('name', '=', '刀具组装位置')]).id,