1、功能刀具拆解单拆解流程优化;2、优化货位看板显示;
This commit is contained in:
@@ -335,8 +335,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
|
||||
# =================夹头型号==============
|
||||
chuck_freight_barcode_id = fields.Many2one('sf.shelf.location', string='夹头货位',
|
||||
domain="[('product_id.cutting_tool_material_id.name', '=', '刀盘'),('product_num', '>', 0)]")
|
||||
chuck_freight_lot_id = fields.Many2one('sf.shelf.location.lot', string='刀盘批次',
|
||||
domain="[('product_id.cutting_tool_material_id.name', '=', '夹头'),('product_num', '>', 0)]")
|
||||
chuck_freight_lot_id = fields.Many2one('sf.shelf.location.lot', string='夹头批次',
|
||||
domain="[('shelf_location_id', '=', chuck_freight_barcode_id)]")
|
||||
chuck_product_id = fields.Many2one('product.product', string='夹头名称', compute='_compute_chuck_product_id',
|
||||
store=True)
|
||||
@@ -826,18 +826,12 @@ class ProductProduct(models.Model):
|
||||
stock_move_line_id = self.env['stock.move.line'].sudo().create({
|
||||
'product_id': self.id,
|
||||
'move_id': stock_move_id.id,
|
||||
'lot_id': lot_id.id,
|
||||
'lot_id': lot_id.lot_id.id,
|
||||
'current_location_id': shelf_location_barcode_id.id,
|
||||
'install_tool_time': fields.Datetime.now(),
|
||||
'qty_done': 1.0,
|
||||
'state': 'done',
|
||||
})
|
||||
if shelf_location_barcode_id.product_num > 0:
|
||||
shelf_location_barcode_id.product_num = shelf_location_barcode_id.product_num - 1
|
||||
else:
|
||||
raise ValidationError(
|
||||
'【%s】货位的【%s】产品库存数量为零,请采购入库后再重新组装!' % (
|
||||
shelf_location_barcode_id.barcode, shelf_location_barcode_id.product_id.name))
|
||||
return stock_move_id, stock_move_line_id
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user