From ccdbfda0192a81dfb1c89140f3df46cceab49a1a Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Tue, 2 Jan 2024 17:55:02 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A3=80=E6=B5=8B=E4=BA=BA=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_machine_connect/views/machine_monitor.xml | 156 +++++++++----------
sf_manufacturing/models/mrp_workorder.py | 5 +-
sf_manufacturing/models/stock.py | 3 +-
3 files changed, 83 insertions(+), 81 deletions(-)
diff --git a/sf_machine_connect/views/machine_monitor.xml b/sf_machine_connect/views/machine_monitor.xml
index 83b89598..9c9a21a3 100644
--- a/sf_machine_connect/views/machine_monitor.xml
+++ b/sf_machine_connect/views/machine_monitor.xml
@@ -29,44 +29,44 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -216,46 +216,46 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 1edbb62f..48edcf7f 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -137,7 +137,10 @@ class ResMrpWorkOrder(models.Model):
"""
检测is_ok(是否合格)被修改的话,就将当前用户赋值给inspection_user_id
"""
- self.inspection_user_id = self.env.user.id
+ if not self.inspection_user_id:
+ self.inspection_user_id = self.env.user.id
+ else:
+ self.inspection_user_id = False
@api.onchange('functional_fixture_id')
def _onchange_functional_fixture_id(self):
diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py
index 4f2c43f3..27edc40f 100644
--- a/sf_manufacturing/models/stock.py
+++ b/sf_manufacturing/models/stock.py
@@ -202,8 +202,7 @@ class StockRule(models.Model):
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
if sale_order:
sale_order.write({'schedule_status': 'to schedule'})
- self.env['sf.production.plan'].sudo().with_company(company_id). \
- create({
+ self.env['sf.production.plan'].sudo().with_company(company_id).create({
'name': production.name,
'order_deadline': sale_order.deadline_of_delivery,
'production_id': production.id,