Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化agv接口

This commit is contained in:
jinling.yang
2024-03-11 17:30:46 +08:00
35 changed files with 897 additions and 360 deletions

View File

@@ -20,6 +20,8 @@ class MrpProduction(models.Model):
model_file = fields.Binary('模型文件', related='product_id.model_file')
schedule_state = fields.Selection([('未排', '未排'), ('已排', '已排'), ('已完成', '已完成')],
string='排程状态', default='未排')
work_order_state = fields.Selection([('未排', '未排'), ('已排', '已排'), ('已完成', '已完成')],
string='工单状态', default='未排')
# state = fields.Selection(selection_add=[
# ('pending_scheduling', '待排程'),
@@ -53,8 +55,7 @@ class MrpProduction(models.Model):
production_line_id = fields.Many2one('sf.production.line', string='生产线')
plan_start_processing_time = fields.Datetime('计划开始加工时间')
production_line_state = fields.Selection([('待上产线', '待上产线'), ('已上产线', '已上产线'), ('已下产线', '已下产线')],
string='上/下产线', default='待上产线')
string='上/下产线', default='待上产线')
@api.depends(
'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
@@ -94,7 +95,9 @@ class MrpProduction(models.Model):
production.state = 'pending_processing'
# elif production.state == 'progress' and production.schedule_state == '已完成':
# production.state = 'completed'
elif production.state == 'pending_processing' and production.schedule_state == '已完成':
elif production.state == 'pending_processing' and production.work_order_state == '已完成':
production.state = 'completed'
elif production.state == 'progress' and production.work_order_state == '已完成':
production.state = 'completed'
def action_check(self):

View File

@@ -134,6 +134,7 @@ class ResMrpWorkOrder(models.Model):
workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'workorder_id', '工件配送')
is_delivery = fields.Boolean('是否配送完成', default=False)
rfid_code = fields.Char('RFID码')
rfid_code_old = fields.Char('RFID码(已解除)')
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
string='生产线', store=True)
production_line_state = fields.Selection(related='production_id.production_line_state',
@@ -633,6 +634,7 @@ class ResMrpWorkOrder(models.Model):
is_production_id = False
if is_production_id == True and self.name == '解除装夹':
for workorder in self.production_id.workorder_ids:
workorder.rfid_code_old = workorder.rfid_code
workorder.rfid_code = None
for move_raw_id in self.production_id.move_raw_ids:
move_raw_id.quantity_done = move_raw_id.product_uom_qty