From 0a1da794873d1acf0f22896df625f645ce60e383 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Tue, 26 Nov 2024 11:14:45 +0800
Subject: [PATCH 1/3] =?UTF-8?q?1=E3=80=81=E8=BF=94=E5=B7=A5=E5=90=91?=
=?UTF-8?q?=E5=AF=BC=E6=A8=A1=E5=9E=8B=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84?=
=?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=AD=97=E6=AE=B5=EF=BC=9B2=E3=80=81?=
=?UTF-8?q?=E5=B7=A5=E5=8D=95tree=E8=A7=86=E5=9B=BE=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E5=B7=A5=E5=88=86=E7=B1=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_machine_connect/views/WorkCenterBarcodes.xml | 1 +
sf_manufacturing/models/mrp_workorder.py | 11 +++++++++--
sf_manufacturing/views/mrp_workorder_view.xml | 1 +
sf_manufacturing/wizard/rework_wizard.py | 2 ++
sf_manufacturing/wizard/rework_wizard_views.xml | 1 +
5 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/sf_machine_connect/views/WorkCenterBarcodes.xml b/sf_machine_connect/views/WorkCenterBarcodes.xml
index 90058b59..a1a5a5ea 100644
--- a/sf_machine_connect/views/WorkCenterBarcodes.xml
+++ b/sf_machine_connect/views/WorkCenterBarcodes.xml
@@ -12,6 +12,7 @@
+
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 2bc90f1d..1e006f3c 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -141,8 +141,8 @@ class ResMrpWorkOrder(models.Model):
# 是否绑定托盘
is_trayed = fields.Boolean(string='是否绑定托盘', default=False)
-
tag_type = fields.Selection([("重新加工", "重新加工")], string="标签", tracking=True)
+
technology_design_id = fields.Many2one('sf.technology.design')
def _compute_default_construction_period_status(self):
@@ -281,7 +281,7 @@ class ResMrpWorkOrder(models.Model):
# if technology_design.is_auto is False:
# domain = [('origin', '=', order.production_id.name)]
# else:
- domain = [('purchase_type', '=', 'consignment'),('origin', '=', ','.join(production_list))]
+ domain = [('purchase_type', '=', 'consignment'), ('origin', '=', ','.join(production_list))]
purchase = self.env['purchase.order'].search(domain)
if not purchase:
order.surface_technics_purchase_count = 0
@@ -1075,6 +1075,13 @@ class ResMrpWorkOrder(models.Model):
if workorder.state != 'pending':
workorder.state = 'pending'
continue
+ # ================= 如果制造订单制造类型为【人工线下加工】==========================
+ if (workorder.production_id.production_type == '人工线下加工'
+ and workorder.production_id.schedule_state == '已排'
+ and len(workorder.production_id.picking_ids.filtered(
+ lambda w: w.state not in ['done', 'cancel'])) == 0):
+ workorder.state = 'ready'
+ continue
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
or workorder.production_id.schedule_state != '已排'
diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml
index 1faec0ac..4c856a41 100644
--- a/sf_manufacturing/views/mrp_workorder_view.xml
+++ b/sf_manufacturing/views/mrp_workorder_view.xml
@@ -32,6 +32,7 @@
+
+
From 09a476ffa5d229aef6f1c64fab9823211000b04a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?=
Date: Tue, 26 Nov 2024 11:26:17 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=90=E5=88=B6?=
=?UTF-8?q?=E9=80=A0=E8=AE=A2=E5=8D=95=E7=9A=84=E9=94=80=E5=94=AE=E8=AE=A2?=
=?UTF-8?q?=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/stock.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py
index 031672b8..fb42da12 100644
--- a/sf_manufacturing/models/stock.py
+++ b/sf_manufacturing/models/stock.py
@@ -286,6 +286,8 @@ class StockRule(models.Model):
mrp_production = self.env['mrp.production'].sudo().search([('name', '=', production.origin)], limit=1)
if mrp_production:
sale_order = self.env['sale.order'].sudo().search([('name', '=', mrp_production.origin)])
+ else:
+ mrp_production = production
if sale_order:
# sale_order.write({'schedule_status': 'to schedule'})
self.env['sf.production.plan'].sudo().with_company(company_id).create({
@@ -293,7 +295,7 @@ class StockRule(models.Model):
'order_deadline': sale_order.deadline_of_delivery,
'production_id': production.id,
'date_planned_start': production.date_planned_start,
- 'origin': production.origin,
+ 'origin': mrp_production.origin,
'product_qty': production.product_qty,
'product_id': production.product_id.id,
'state': 'draft',
From 087bb0e8fec143f6aeeb202e6af51bbe07c16979 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?=
Date: Tue, 26 Nov 2024 11:51:09 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=88=B6=E9=80=A0?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8E=92=E7=A8=8B=E6=97=B6=EF=BC=8C=E5=B0=86?=
=?UTF-8?q?=E5=85=B6=E4=B8=8B=E6=89=80=E6=9C=89=E5=AD=90=E5=88=B6=E9=80=A0?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=94=B9=E4=B8=BA=E5=B7=B2=E6=8E=92=E7=8A=B6?=
=?UTF-8?q?=E6=80=81=E7=9A=84=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_plan/models/custom_plan.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py
index e357f93e..f0214c9a 100644
--- a/sf_plan/models/custom_plan.py
+++ b/sf_plan/models/custom_plan.py
@@ -259,10 +259,10 @@ class sf_production_plan(models.Model):
# sale_obj = self.env['sale.order'].search([('name', '=', record.origin)])
# if 'S' in sale_obj.name:
# sale_obj.schedule_status = 'to process'
- mrp_production_ids = record.production_id._get_children().ids
- print('mrp_production_ids', mrp_production_ids)
- for i in mrp_production_ids:
- record.env['mrp.production'].sudo().browse(i).schedule_state = '已排'
+ # mrp_production_ids = record.production_id._get_children().ids
+ # print('mrp_production_ids', mrp_production_ids)
+ # for i in mrp_production_ids:
+ # record.env['mrp.production'].sudo().browse(i).schedule_state = '已排'
# record.production_id.date_planned_start = record.date_planned_start
# record.production_id.date_planned_finished = record.date_planned_finished
record.sudo().production_id.production_line_id = record.production_line_id.id