From bd642812a9afbde48bc88d44fa03671eda0fdbcc Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Tue, 16 Jul 2024 10:45:00 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=94=80=E5=94=AE?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E9=94=80?=
=?UTF-8?q?=E5=94=AE=E6=98=8E=E7=BB=86=E4=BF=A1=E6=81=AF=E2=80=98=E5=A4=87?=
=?UTF-8?q?=E6=B3=A8=E2=80=99=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_sale/models/sale_order.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py
index f3969dfe..e8f57b18 100644
--- a/sf_sale/models/sale_order.py
+++ b/sf_sale/models/sale_order.py
@@ -113,6 +113,7 @@ class ReSaleOrder(models.Model):
'price_unit': product.list_price,
'product_uom_qty': item['number'],
'model_glb_file': base64.b64decode(item['model_file']),
+ 'remark': item.get('remark')
}
return self.env['sale.order.line'].with_context(skip_procurement=True).create(vals)
From 83334e2915e891291c032bb5b6649237f8588631 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Tue, 16 Jul 2024 14:10:14 +0800
Subject: [PATCH 2/3] =?UTF-8?q?1=E3=80=81=E8=A1=A8=E9=9D=A2=E5=B7=A5?=
=?UTF-8?q?=E8=89=BA=E5=8F=8A=E5=90=8C=E6=AD=A5=E6=8E=A5=E5=8F=A3=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E2=80=98=E5=8A=A0=E5=B7=A5=E5=A4=A9=E6=95=B0=E2=80=99?=
=?UTF-8?q?=E3=80=81=E2=80=98=E8=B7=AF=E9=80=94=E5=A4=A9=E6=95=B0=E2=80=99?=
=?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=9B2=E3=80=81=E8=A1=A8=E9=9D=A2?=
=?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=8F=AF=E9=80=89=E5=8F=82=E6=95=B0=E5=8F=8A?=
=?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E2=80=98?=
=?UTF-8?q?=E5=B7=A5=E8=89=BA=E6=8F=8F=E8=BF=B0=E2=80=99=E3=80=81=E2=80=98?=
=?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=A4=A9=E6=95=B0=E2=80=99=E3=80=81=E2=80=98?=
=?UTF-8?q?=E8=B7=AF=E9=80=94=E5=A4=A9=E6=95=B0=E2=80=99=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_base/models/common.py | 7 ++-
sf_base/views/common_view.xml | 77 ++++++++++++++++------------
sf_mrs_connect/models/sync_common.py | 20 ++++++++
3 files changed, 69 insertions(+), 35 deletions(-)
diff --git a/sf_base/models/common.py b/sf_base/models/common.py
index 888f3eaf..65dfe13d 100644
--- a/sf_base/models/common.py
+++ b/sf_base/models/common.py
@@ -92,8 +92,10 @@ class MrsProductionProcess(models.Model):
partner_process_ids = fields.Many2many('res.partner', 'process_ids', '加工工厂')
active = fields.Boolean('有效', default=True)
parameter_ids = fields.One2many('sf.production.process.parameter', 'process_id', string='可选参数')
- category_id = fields.Many2one('sf.production.process.category')
+ category_id = fields.Many2one('sf.production.process.category', string='表面工艺类别')
# workcenter_ids = fields.Many2many('mrp.workcenter', 'rel_workcenter_process', required=True)
+ processing_day = fields.Float('加工天数/d')
+ travel_day = fields.Float('路途天数/d')
# class MrsProcessingTechnology(models.Model):
@@ -141,7 +143,10 @@ class MrsProductionProcessParameter(models.Model):
is_check = fields.Boolean(default=False)
# price = fields.Float('单价')
process_id = fields.Many2one('sf.production.process', string='表面工艺')
+ process_description = fields.Char(string='工艺描述')
materials_model_ids = fields.Many2many('sf.materials.model', 'applicable_material', string='适用材料')
+ processing_day = fields.Float('加工天数/d')
+ travel_day = fields.Float('路途天数/d')
active = fields.Boolean('有效', default=True)
def name_get(self):
diff --git a/sf_base/views/common_view.xml b/sf_base/views/common_view.xml
index a7cbcf9e..533a3e04 100644
--- a/sf_base/views/common_view.xml
+++ b/sf_base/views/common_view.xml
@@ -27,9 +27,13 @@
+
-
+
+
+
+
@@ -179,41 +183,46 @@
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py
index e3ca710b..e37d460a 100644
--- a/sf_mrs_connect/models/sync_common.py
+++ b/sf_mrs_connect/models/sync_common.py
@@ -326,6 +326,8 @@ class sfProductionProcess(models.Model):
production_process.name = item['name']
production_process.category_id = category.id
production_process.remark = item['remark']
+ production_process.processing_day = item['processing_day']
+ production_process.travel_day = item['travel_day']
production_process.active = item['active']
else:
self.create({
@@ -333,6 +335,8 @@ class sfProductionProcess(models.Model):
"category_id": category.id,
"code": item['code'],
"remark": item['remark'],
+ "processing_day": item['processing_day'],
+ "travel_day": item['travel_day'],
"active": item['active'],
})
else:
@@ -358,12 +362,16 @@ class sfProductionProcess(models.Model):
"category_id": category.id,
"code": item['code'],
"remark": item['remark'],
+ "processing_day": item['processing_day'],
+ "travel_day": item['travel_day'],
"active": item['active'],
})
else:
production_process.name = item['name']
production_process.category_id = category.id
production_process.remark = item['remark']
+ production_process.processing_day = item['processing_day']
+ production_process.travel_day = item['travel_day']
production_process.active = item['active']
else:
raise ValidationError("表面工艺认证未通过")
@@ -1073,6 +1081,9 @@ class sfProductionProcessParameter(models.Model):
[('code', '=', item['process_id_code'])])
if production_process_parameter:
production_process_parameter.name = item['name']
+ production_process_parameter.process_description = item['process_description']
+ production_process_parameter.processing_day = item['processing_day']
+ production_process_parameter.travel_day = item['travel_day']
production_process_parameter.active = item['active']
production_process_parameter.process_id = process.id
production_process_parameter.materials_model_ids = self.env['sf.materials.model'].search(
@@ -1080,6 +1091,9 @@ class sfProductionProcessParameter(models.Model):
else:
self.create({
"name": item['name'],
+ "process_description": item['process_description'],
+ "processing_day": item['processing_day'],
+ "travel_day": item['travel_day'],
"code": item['code'],
"active": item['active'],
"process_id": process.id,
@@ -1107,6 +1121,9 @@ class sfProductionProcessParameter(models.Model):
if not production_process_parameter:
self.create({
"name": item['name'],
+ "process_description": item['process_description'],
+ "processing_day": item['processing_day'],
+ "travel_day": item['travel_day'],
"code": item['code'],
"active": item['active'],
"process_id": process.id,
@@ -1115,6 +1132,9 @@ class sfProductionProcessParameter(models.Model):
})
else:
production_process_parameter.name = item['name']
+ production_process_parameter.process_description = item['process_description']
+ production_process_parameter.processing_day = item['processing_day']
+ production_process_parameter.travel_day = item['travel_day']
production_process_parameter.process_id = process.id
production_process_parameter.materials_model_ids = self.env['sf.materials.model'].search(
[('materials_no', 'in', item['materials_model_ids_codes'])])
From 81158e2fb42c85eec3fea02e1627a8be28256615 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Tue, 16 Jul 2024 16:31:18 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=B6=E9=80=A0?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_production.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index 6ccd40df..09f55db7 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -122,9 +122,9 @@ class MrpProduction(models.Model):
if production.state == 'progress':
if all(wo_state not in ('progress', 'done') for wo_state in production.workorder_ids.mapped('state')):
production.state = 'pending_cam'
- if production.state == 'pending_cam':
- if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
- production.state = 'done'
+ # if production.state == 'pending_cam':
+ # if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
+ # production.state = 'done'
def action_check(self):
"""