From 8a800e909f9cfb59d8bbfb9c5e5149d82a9a727e Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Mon, 11 Mar 2024 10:56:03 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95=E6=98=BE?=
=?UTF-8?q?=E9=9A=90=E6=8E=A7=E5=88=B6=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/controllers/controllers.py | 2 +-
sf_manufacturing/models/mrp_production.py | 9 +++++----
sf_manufacturing/views/mrp_workorder_view.xml | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py
index 9063f518..c548222a 100644
--- a/sf_manufacturing/controllers/controllers.py
+++ b/sf_manufacturing/controllers/controllers.py
@@ -210,7 +210,7 @@ class Manufacturing_Connect(http.Controller):
'state': 'finished'})
production_obj = request.env['mrp.production'].sudo().search([('name', '=', production_id)])
if production_obj:
- production_obj.sudo().schedule_state = '已完成'
+ production_obj.sudo().work_order_state = '已完成'
production_obj.write({'state': 'completed'})
request.env['sale.order'].sudo().search(
[('name', '=', production_obj.origin)]).write({'schedule_status': 'to deliver'})
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index d843c283..dff2763b 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -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,9 +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.schedule_state == '已完成':
+ elif production.state == 'progress' and production.work_order_state == '已完成':
production.state = 'completed'
def action_check(self):
diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml
index 68f75fe9..16863618 100644
--- a/sf_manufacturing/views/mrp_workorder_view.xml
+++ b/sf_manufacturing/views/mrp_workorder_view.xml
@@ -105,7 +105,7 @@
-