From 314d7384120b2838c5fc5e392b316966bb3bf47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Fri, 25 Apr 2025 15:59:11 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_work_reporting_api/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jikimo_work_reporting_api/controllers/main.py b/jikimo_work_reporting_api/controllers/main.py index c3ea7daa..54cd4cc6 100644 --- a/jikimo_work_reporting_api/controllers/main.py +++ b/jikimo_work_reporting_api/controllers/main.py @@ -6,7 +6,7 @@ from odoo.addons.sf_base.decorators.api_log import api_log class MainController(http.Controller): - @http.route('/api/manual_download_program', type='json', methods=['POST'], auth='public', cors='*') + @http.route('/api/manual_download_program', type='json', methods=['POST'], auth='wechat_token', cors='*') @api_log('人工线下加工编程文件传输', requester='报工系统') def manual_download_program(self): """ From 82bd50cb9767fb974b4a4cc4feb41b35ff08bac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Fri, 25 Apr 2025 17:30:51 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BC=A0=E8=BE=93=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_work_reporting_api/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jikimo_work_reporting_api/controllers/main.py b/jikimo_work_reporting_api/controllers/main.py index 54cd4cc6..5bdef967 100644 --- a/jikimo_work_reporting_api/controllers/main.py +++ b/jikimo_work_reporting_api/controllers/main.py @@ -59,7 +59,7 @@ class MainController(http.Controller): target_ftp_info, '/' + str(model_id), '/', - match_str=r'^\d*_\d*-' + tool_groups_id.name + r'-\w{2}-all\.nc$' + match_str=r'^\d*-' + tool_groups_id.name + r'-\w{2}-all\.nc$' ) if len(result) > 0: return {'code': 200, 'message': '传输成功', 'file_list': result} From 7d7c7b0fcf8af826bad727563457c08f45d7dee4 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 09:09:48 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/sale_order.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index ea02f9ce..4a53007d 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -343,10 +343,10 @@ class RePurchaseOrder(models.Model): if order_line.product_id.id in product_list: purchase.purchase_type = 'outsourcing' break - request_lines = self.order_line.mapped('purchase_request_lines') - # 检查是否存在 is_subcontract 为 True 的行 - if any(line.is_subcontract for line in request_lines): - purchase.purchase_type = 'consignment' + # request_lines = self.order_line.mapped('purchase_request_lines') + # # 检查是否存在 is_subcontract 为 True 的行 + # if any(line.is_subcontract for line in request_lines): + # purchase.purchase_type = 'consignment' delivery_warning = fields.Selection([('normal', '正常'), ('warning', '预警'), ('overdue', '已逾期')], From 51a633594f49283cc00af88558b31ed0ddbfec4b Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 09:24:39 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_request/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jikimo_purchase_request/models/mrp_production.py b/jikimo_purchase_request/models/mrp_production.py index 50fe65c0..e418a670 100644 --- a/jikimo_purchase_request/models/mrp_production.py +++ b/jikimo_purchase_request/models/mrp_production.py @@ -9,7 +9,7 @@ class MrpProduction(models.Model): @api.depends('state') def _compute_pr_mp_count(self): for item in self: - pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', item.name), ('is_subcontract', '!=', 'True')]) + pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', item.name)]) if pr_ids: item.pr_mp_count = len(pr_ids) else: From bf9f4c1276eb3dd91b45880a3d8e2053c6c7bd1d Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 10:20:45 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_plan/models/custom_plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py index af5b387f..9e323a7f 100644 --- a/sf_plan/models/custom_plan.py +++ b/sf_plan/models/custom_plan.py @@ -228,7 +228,7 @@ class sf_production_plan(models.Model): """ 排程方法 """ - self.deal_processing_schedule(self.date_planned_start) + self.deal_processing_schedule(self[0].date_planned_start) for record in self: if not record.production_line_id: raise ValidationError("未选择生产线") From 94f179a6d6cc5acdb84866c389905bb8026f255f Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 10:46:48 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/wizard/rework_wizard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py index 6061dda8..ead8c5c1 100644 --- a/sf_manufacturing/wizard/rework_wizard.py +++ b/sf_manufacturing/wizard/rework_wizard.py @@ -303,11 +303,12 @@ class ReworkWizard(models.TransientModel): @api.onchange('production_id') def onchange_processing_panel_id(self): for item in self: + panel_ids = [] domain = [('id', '=', False)] production_id = item.production_id if production_id: if self.env.user.has_group('sf_base.group_sf_order_user'): - panel_ids = [] + panel_arr = production_id.product_id.model_processing_panel if panel_arr is False: break From e2e820267eb220b14cae416c62a938869e51ebff Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 11:04:09 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/wizard/rework_wizard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py index ead8c5c1..6c9a9f25 100644 --- a/sf_manufacturing/wizard/rework_wizard.py +++ b/sf_manufacturing/wizard/rework_wizard.py @@ -315,7 +315,10 @@ class ReworkWizard(models.TransientModel): for p in production_id.detection_result_ids.filtered( lambda ap1: ap1.handle_result == '待处理'): if p.processing_panel is not False and p.processing_panel not in panel_arr: - panel_arr += ','.join(p.processing_panel) + if len(panel_arr)>0: + panel_arr += ','.join(p.processing_panel) + else: + panel_arr = p.processing_panel for item in panel_arr.split(','): panel = self.env['sf.processing.panel'].search( [('name', 'ilike', item)]) From defd7792790c2beb3bd34df23e54bc8a2f6ced6e Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 11:35:29 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E8=BF=94=E5=B7=A5=20=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=BC=96=E7=A8=8B=20cnc=E5=8A=A0=E5=B7=A5=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=B2=A1=E6=9C=89=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/wizard/rework_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py index 6c9a9f25..0ce52f41 100644 --- a/sf_manufacturing/wizard/rework_wizard.py +++ b/sf_manufacturing/wizard/rework_wizard.py @@ -211,7 +211,7 @@ class ReworkWizard(models.TransientModel): if self.reprogramming_num >= 1 and self.programming_state == '已编程': for panel_name in panels: self.production_id.get_new_program(panel_name) - if self.reprogramming_num >= 0 and self.programming_state == '已下发': + if self.reprogramming_num >= 0 and self.programming_state == '已编程': # ============= 处理CNC加工加工工单的 CNC程序和cmm程序 信息============= for cnc_work in new_work_ids.filtered(lambda wk: wk.name == 'CNC加工'): ret = {'programming_list': []} From 5f79d2038c384c201b6be58c9d0044867069417e Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 11:49:56 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E5=A4=96=E5=8D=8F?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=8D=95=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 60d17052..070ff404 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -513,11 +513,10 @@ class ResMrpWorkOrder(models.Model): return result def _get_surface_technics_purchase_ids(self): - domain = [('origin', 'like', '%' + self.production_id.name + '%'), ('purchase_type', '=', 'consignment')] + domain = [('origin', 'like', '%' + self.production_id.name + '%'), ('purchase_type', '=', 'consignment'), ('state', '!=', 'cancel')] # domain = [('origin', 'like', '%' + self.production_id.name + '%'), ('purchase_type', '=', 'consignment')] # domain = [('group_id', '=', self.production_id.procurement_group_id.id), ('purchase_type', '=', 'consignment')] - purchase_orders = self.env['purchase.order'].search(domain, order='id desc', # 按创建时间降序(最新的在前) - limit=1) + purchase_orders = self.env['purchase.order'].search(domain, order='id desc') purchase_orders_id = self.env['purchase.order'] for po in purchase_orders: for line in po.order_line: From ce79016befc8d870397ad0c41c47fb7f7d804d05 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sun, 27 Apr 2025 17:20:15 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E8=BF=94=E5=B7=A5=E6=9C=AA=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E9=87=8D=E6=96=B0=E7=BC=96=E7=A8=8B=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E5=A4=8D=E5=88=B6=E7=A8=8B=E5=BA=8F=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/wizard/rework_wizard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py index 0ce52f41..b6b657c1 100644 --- a/sf_manufacturing/wizard/rework_wizard.py +++ b/sf_manufacturing/wizard/rework_wizard.py @@ -211,13 +211,13 @@ class ReworkWizard(models.TransientModel): if self.reprogramming_num >= 1 and self.programming_state == '已编程': for panel_name in panels: self.production_id.get_new_program(panel_name) - if self.reprogramming_num >= 0 and self.programming_state == '已编程': + if self.reprogramming_num >= 0 and self.programming_state == '已下发': # ============= 处理CNC加工加工工单的 CNC程序和cmm程序 信息============= - for cnc_work in new_work_ids.filtered(lambda wk: wk.name == 'CNC加工'): + for cnc_work in new_work_ids.filtered(lambda wk: wk.name == 'CNC加工' or wk.name == '人工线下加工'): ret = {'programming_list': []} old_cnc_rework = max(self.production_id.workorder_ids.filtered( lambda crw: crw.processing_panel == cnc_work.processing_panel - and crw.state == 'rework' and crw.routing_type == 'CNC加工'), + and crw.state == 'rework' and (crw.routing_type == 'CNC加工' or crw.routing_type == '人工线下加工')), key=lambda w: w.create_date ) # 获取当前工单的CNC程序和cmm程序 @@ -259,7 +259,7 @@ class ReworkWizard(models.TransientModel): new_cnc_workorder = self.production_id.workorder_ids.filtered( lambda ap1: ap1.processing_panel == cnc_work.processing_panel and ap1.state not in ( - 'rework', 'done') and ap1.routing_type == 'CNC加工' + 'rework', 'done') and (ap1.routing_type == 'CNC加工' or ap1.routing_type == '人工线下加工') ) if not new_cnc_workorder.cnc_ids: new_cnc_workorder.write({ From ecf5dcf2f207ce3257b689557c5a74aaa348643b Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Mon, 28 Apr 2025 09:43:25 +0800 Subject: [PATCH 11/11] =?UTF-8?q?sf=20.r-=E9=87=87=E8=B4=AD-=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95-=E5=9D=AF=E6=96=99=E5=A7=94?= =?UTF-8?q?=E5=A4=96=E5=8A=A0=E5=B7=A5=E7=94=9F=E6=88=90=E7=9A=84=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E7=94=B3=E8=AF=B7=E5=88=9B=E5=BB=BA=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9A=84=E7=B1=BB=E5=9E=8B=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/sale_order.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 4a53007d..ced49414 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -343,6 +343,9 @@ class RePurchaseOrder(models.Model): if order_line.product_id.id in product_list: purchase.purchase_type = 'outsourcing' break + if purchase.order_line[0].product_id.categ_id.name == '坯料': + if purchase.order_line[0].product_id.materials_type_id.gain_way == '外协': + purchase.purchase_type = 'outsourcing' # request_lines = self.order_line.mapped('purchase_request_lines') # # 检查是否存在 is_subcontract 为 True 的行 # if any(line.is_subcontract for line in request_lines):