From 19e1b16122501fd352bc3c91b594b2e0268accb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Fri, 17 Jan 2025 09:27:38 +0800 Subject: [PATCH 001/134] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E5=B0=86=E5=88=B6?= =?UTF-8?q?=E9=80=A0=E8=AE=A2=E5=8D=95=E7=9A=84=E8=A1=A5=E8=B4=A7=E7=BB=84?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=B8=8D=E5=90=8C=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index d19d7f92..f7de6edf 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -180,14 +180,14 @@ class StockRule(models.Model): productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create( productions_values) # 将这一批制造订单的采购组根据成品设置为不同的采购组 - product_group_id = {} - for index, production in enumerate(productions): - if production.product_id.id not in product_group_id.keys(): - product_group_id[production.product_id.id] = production.procurement_group_id.id - else: - productions_values[index].update({'name': production.name}) - procurement_group_vals = production._prepare_procurement_group_vals(productions_values[index]) - production.procurement_group_id = self.env["procurement.group"].create(procurement_group_vals).id + # product_group_id = {} + # for index, production in enumerate(productions): + # if production.product_id.id not in product_group_id.keys(): + # product_group_id[production.product_id.id] = production.procurement_group_id.id + # else: + # productions_values[index].update({'name': production.name}) + # procurement_group_vals = production._prepare_procurement_group_vals(productions_values[index]) + # production.procurement_group_id = self.env["procurement.group"].create(procurement_group_vals).id # self.env['stock.move'].sudo().create(productions._get_moves_raw_values()) # self.env['stock.move'].sudo().create(productions._get_moves_finished_values()) From e39e9d8812fabbc403993644f4569744c0c5a238 Mon Sep 17 00:00:00 2001 From: hyyy <123@qq.com> Date: Fri, 17 Jan 2025 14:17:46 +0800 Subject: [PATCH 002/134] =?UTF-8?q?=E6=94=BE=E5=BC=83=E4=BF=9D=E5=AD=98=20?= =?UTF-8?q?->=20=E4=B8=8D=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_frontend/static/src/js/custom_form_status_indicator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jikimo_frontend/static/src/js/custom_form_status_indicator.js b/jikimo_frontend/static/src/js/custom_form_status_indicator.js index ec64e553..0b6a6b50 100644 --- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js +++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js @@ -62,7 +62,7 @@ patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', { const dom1 = buttonsDom.children('.o_form_button_save') const dom2 = buttonsDom.children('.o_form_button_cancel') dom1.append('保存') - dom2.append('放弃保存') + dom2.append('不保存') } } catch (e) { console.log(e) From dbcf8b10898b80805e15012a7f54a0f2a858876c Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 20 Jan 2025 14:02:54 +0800 Subject: [PATCH 003/134] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 1bfa5f07..d7c6d53d 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1674,13 +1674,13 @@ class MrpProduction(models.Model): url = '/api/intelligent_programming/reset_state_again' config_url = configsettings['sf_url'] + url ret = requests.post(config_url, json=res, data=None, headers=config_header) - ret = ret.json() - result = json.loads(ret['result']) - logging.info('update_programming_state-ret:%s' % result) - if result['status'] == 1: - self.write({'is_rework': True}) - else: - raise UserError(ret['message']) + # ret = ret.json() + # result = json.loads(ret['result']) + # logging.info('update_programming_state-ret:%s' % result) + # if result['status'] == 1: + # self.write({'is_rework': True}) + # else: + # raise UserError(ret['message']) except Exception as e: logging.info('update_programming_state error:%s' % e) raise UserError("更新编程单状态失败,请联系管理员") From a9b4c5d91babcac43594341795b6712698d8f091 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Tue, 21 Jan 2025 16:04:16 +0800 Subject: [PATCH 004/134] =?UTF-8?q?=E4=BF=9D=E6=8C=81=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E5=B7=A5=E5=8E=82=E5=88=80=E5=85=B7=E6=A0=87=E5=87=86=E5=BA=93?= =?UTF-8?q?=E4=B8=8Ecloud=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_mrs_connect/models/sync_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py index 835183b3..ddd7c3c4 100644 --- a/sf_mrs_connect/models/sync_common.py +++ b/sf_mrs_connect/models/sync_common.py @@ -2302,7 +2302,7 @@ class Cutting_tool_standard_library(models.Model): if result['status'] == 1: for item in result['cutting_tool_standard_library_all_list']: cutting_tool_standard_library = self.search( - [("code", '=', item['code'].replace("JKM", result['factory_short_name'])), + [("code", '=', item['code']), ("active", 'in', [True, False])]) cutting_tool_type = self.env['sf.cutting.tool.type'].search( [("code", '=', item['cutting_tool_type_code'])]) @@ -2313,7 +2313,7 @@ class Cutting_tool_standard_library(models.Model): brand = self.env['sf.machine.brand'].search([("code", '=', item['brand_code'])]) if not cutting_tool_standard_library: self.create({ - "code": item['code'].replace("JKM", result['factory_short_name']), + "code": item['code'], "name": item['name'], "cutting_tool_material_id": cutting_tool_material.id, "cutting_tool_type_id": cutting_tool_type.id, From b604209df4e5ba1b1346f1bb26c3b948c62727fe Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Tue, 21 Jan 2025 16:23:34 +0800 Subject: [PATCH 005/134] =?UTF-8?q?=E5=88=80=E5=85=B7=E6=A0=87=E5=87=86?= =?UTF-8?q?=E5=BA=93=E5=88=97=E8=A1=A8=E8=A7=86=E5=9B=BE=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E4=B8=8E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/views/tool_views.xml | 2 ++ sf_mrs_connect/models/sync_common.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sf_base/views/tool_views.xml b/sf_base/views/tool_views.xml index b2d53392..82365a9e 100644 --- a/sf_base/views/tool_views.xml +++ b/sf_base/views/tool_views.xml @@ -112,6 +112,8 @@ + + diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py index ddd7c3c4..d4aa3f36 100644 --- a/sf_mrs_connect/models/sync_common.py +++ b/sf_mrs_connect/models/sync_common.py @@ -2335,9 +2335,9 @@ class Cutting_tool_standard_library(models.Model): 'maintenance.equipment.image'].search( [('name', '=', item['fit_blade_shape'])]).id, "chuck_id": False if not item['chuck_code'] else self.search( - [('code', '=', item['chuck_code'].replace("JKM", result['factory_short_name']))]).id, + [('code', '=', item['chuck_code'])]).id, "handle_id": False if not item['handle_code'] else self.search( - [('code', '=', item['handle_code'].replace("JKM", result['factory_short_name']))]).id, + [('code', '=', item['handle_code'])]).id, "suitable_machining_method_ids": [(6, 0, [])] if not item.get( 'suitable_machining_method') else self.env['maintenance.equipment.image']._get_ids( item['suitable_machining_method']), @@ -2377,9 +2377,9 @@ class Cutting_tool_standard_library(models.Model): 'maintenance.equipment.image'].search( [('name', '=', item['fit_blade_shape'])]).id, "chuck_id": False if not item['chuck_code'] else self.search( - [('code', '=', item['chuck_code'].replace("JKM", result['factory_short_name']))]).id, + [('code', '=', item['chuck_code'])]).id, "handle_id": False if not item['handle_code'] else self.search( - [('code', '=', item['handle_code'].replace("JKM", result['factory_short_name']))]).id, + [('code', '=', item['handle_code'])]).id, "suitable_machining_method_ids": [(6, 0, [])] if not item.get( 'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids( item['suitable_machining_methods']), From 9b49edb290cca73637ee87efdabd1bfec0a8da7a Mon Sep 17 00:00:00 2001 From: guanhuan Date: Thu, 23 Jan 2025 13:55:35 +0800 Subject: [PATCH 006/134] =?UTF-8?q?=E8=A3=85=E5=A4=B9=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E8=BF=94=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 26 +++++++++++++++++++ sf_manufacturing/views/mrp_workorder_view.xml | 4 +++ 2 files changed, 30 insertions(+) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index f8197783..8d4dcaa4 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -455,6 +455,32 @@ class ResMrpWorkOrder(models.Model): ("technology", "工艺"), ("customer redrawing", "客户改图")], string="原因", tracking=True) detailed_reason = fields.Text('详细原因') is_rework = fields.Boolean(string='是否返工', default=False) + rework_flag = fields.Boolean(string='返工标志', compute='_compute_rework_flag') + + @api.depends('state', 'production_line_state') + def _compute_rework_flag(self): + for record in self: + if record.state == 'done' and record.routing_type == '装夹预调': + next_workorder = record.production_id.workorder_ids.filtered( + lambda w: w.sequence == record.sequence + 1) + if next_workorder and next_workorder.routing_type == 'CNC加工' and next_workorder.state in ['ready', + 'waiting', + 'pending'] and next_workorder.production_line_state == '待上产线': + record.rework_flag = False + elif next_workorder and next_workorder.routing_type == '表面工艺' and next_workorder.state in ['ready', + 'waiting', + 'pending']: + record.rework_flag = False + else: + record.rework_flag = True + else: + record.rework_flag = True + + def button_rework(self): + for item in self: + item.state = 'progress' + for time_id in item.time_ids: + time_id.write({'date_end': None}) def button_change_env(self): self.is_test_env = not self.is_test_env diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 971a39ad..07449124 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -163,6 +163,7 @@ + @@ -211,6 +212,9 @@ attrs="{'invisible': ['|', '|', '|', ('routing_type','!=','装夹预调'),('state','!=','progress'), ('is_trayed', '=', False), ('state', 'in', ('done'))]}"/> + diff --git a/sf_sale/views/purchase_requisition_view.xml b/sf_sale/views/purchase_requisition_view.xml new file mode 100644 index 00000000..e96e5c31 --- /dev/null +++ b/sf_sale/views/purchase_requisition_view.xml @@ -0,0 +1,75 @@ + + + + + purchase.requisition.form.inherit.sf + purchase.requisition + + + + + - diff --git a/sf_sale/views/purchase_requisition_view.xml b/sf_sale/views/purchase_requisition_view.xml deleted file mode 100644 index e96e5c31..00000000 --- a/sf_sale/views/purchase_requisition_view.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - purchase.requisition.form.inherit.sf - purchase.requisition - - - - - + + + True + + + True + + + \ No newline at end of file diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 66a32f20..b719ffd1 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -401,12 +401,6 @@ class RePurchaseOrder(models.Model): def button_confirm(self): result = super(RePurchaseOrder, self).button_confirm() for item in self: - # 确认订单时,自动分配序列号 - if item.picking_ids: - for picking_id in item.picking_ids: - if picking_id.move_ids: - for move_id in picking_id.move_ids: - move_id.put_move_line() for line in item.order_line: if line.product_id.categ_type == '表面工艺': if item.origin: diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index 581ef114..848b1f66 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -956,7 +956,7 @@ class SfStockPicking(models.Model): qc_ids = self.env['quality.check'].sudo().search( [('picking_id', 'in', sp_ids), ('quality_state', 'in', ['waiting', 'none'])]) if qc_ids: - raise ValidationError(f'单据{[qc.picking_id.name for qc in qc_ids]}未完成质量检查,完成后再试。') + raise ValidationError(f'单据{list(set(qc.picking_id.name for qc in qc_ids))}未完成质量检查,完成后再试。') for record in self: if record.state != 'assigned': continue diff --git a/sf_warehouse/views/change_stock_move_views.xml b/sf_warehouse/views/change_stock_move_views.xml index 8cde3ca3..8feacf75 100644 --- a/sf_warehouse/views/change_stock_move_views.xml +++ b/sf_warehouse/views/change_stock_move_views.xml @@ -79,6 +79,9 @@ + + True +