1、机台换刀申请tree视图隐藏机床字段,机台号字段内容自动同步位机床名称;功能刀具出入库记录模型机台号字段内容自动同步位机床名称;2、解决功能刀具有的出入库记录机床字段没有内容的问题;3、新增继承机床刀位模型,将新建机床刀位时创建机台换刀申请记录从原机床刀位模型移动到继承后的机床刀位模型中;
This commit is contained in:
@@ -378,7 +378,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
# 创建功能刀具批次/序列号记录
|
||||
stock_lot = product_id.create_assemble_warehouse_receipt(self.id, functional_tool_assembly)
|
||||
# 创建刀具组装入库单
|
||||
self.create_stocking_picking(stock_lot)
|
||||
self.create_stocking_picking(stock_lot, functional_tool_assembly)
|
||||
# 刀具物料出库
|
||||
if self.integral_code_id:
|
||||
product_id.tool_material_stock_moves(self.integral_code_id)
|
||||
@@ -436,7 +436,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
if not self.bar_code_id and not self.pad_code_id:
|
||||
raise ValidationError('【刀盘】和【刀杆】必须填写一个!')
|
||||
|
||||
def create_stocking_picking(self, stock_lot):
|
||||
def create_stocking_picking(self, stock_lot, functional_tool_assembly):
|
||||
"""
|
||||
创建刀具组装入库单
|
||||
"""
|
||||
@@ -450,7 +450,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
self.env['stock.move.line'].create({
|
||||
'picking_id': picking_id.id,
|
||||
'product_id': stock_lot.product_id.id,
|
||||
'lot_id': stock_lot.id
|
||||
'lot_id': stock_lot.id,
|
||||
'functional_tool_name_id': functional_tool_assembly.id
|
||||
})
|
||||
# 将刀具组装入库单的状态更改为就绪
|
||||
picking_id.action_confirm()
|
||||
@@ -572,7 +573,6 @@ class ProductProduct(models.Model):
|
||||
"""
|
||||
# 获取位置对象
|
||||
location_inventory_id = tool_material.quant_ids.location_id[-1]
|
||||
print(location_inventory_id)
|
||||
stock_location_id = self.env['stock.location'].search([('name', '=', '刀具组装位置')])
|
||||
# 创建功能刀具该批次/序列号 库存移动和移动历史
|
||||
tool_material.create_stock_quant(location_inventory_id, stock_location_id, None)
|
||||
|
||||
Reference in New Issue
Block a user