').append(message),
+ buttons: [
+ { text: "确认", classes: 'btn-primary jikimo_button_confirm', close: true, click: () => actionCleanDataConfirm(parent, params) },
+ { text: "取消", close: true },
+ ],
+ });
+ dialog.open();
+
+
+ async function actionCleanDataConfirm(parent, params) {
+ rpc.query({
+ model: 'jikimo.data.clean.wizard',
+ method: 'action_clean_data',
+ args: [params.active_id],
+ kwargs: {
+ context: params.context,
+ }
+ }).then(res => {
+ parent.services.action.doAction({
+ 'type': 'ir.actions.client',
+ 'tag': 'display_notification',
+ 'target': 'new',
+ 'params': {
+ 'message': '数据清理成功!',
+ 'type': 'success',
+ 'sticky': false,
+ 'next': {'type': 'ir.actions.act_window_close'},
+ }
+ });
+ })
+
+ }
+ }
+
+ core.action_registry.add('action_clean_data_confirm', action_clean_data_confirm);
+ return action_clean_data_confirm;
+});
diff --git a/jikimo_test_assistant/wizards/__init__.py b/jikimo_test_assistant/wizards/__init__.py
new file mode 100644
index 00000000..2dadb00b
--- /dev/null
+++ b/jikimo_test_assistant/wizards/__init__.py
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+from . import jikimo_data_clean_wizard
\ No newline at end of file
diff --git a/jikimo_test_assistant/wizards/jikimo_data_clean_wizard.py b/jikimo_test_assistant/wizards/jikimo_data_clean_wizard.py
new file mode 100644
index 00000000..f08b114e
--- /dev/null
+++ b/jikimo_test_assistant/wizards/jikimo_data_clean_wizard.py
@@ -0,0 +1,99 @@
+from odoo import models, fields, api
+from datetime import datetime
+
+import logging
+
+_logger = logging.getLogger(__name__)
+
+class JikimoDataCleanWizard(models.TransientModel):
+ _name = 'jikimo.data.clean.wizard'
+ _description = '业务数据清理'
+
+ date = fields.Date(string='截止日期', required=True, default=fields.Date.context_today)
+ model_ids = fields.Many2many('ir.model', string='业务模型', domain=[
+ ('model', 'in', [
+ 'sale.order', # 销售订单
+ 'purchase.order', # 采购订单
+ 'mrp.production', # 生产订单
+ 'stock.picking', # 库存调拨
+ 'account.move', # 会计凭证
+ ])
+ ])
+
+ def action_clean_data(self):
+ self.ensure_one()
+ model_list = self.model_ids.mapped('model')
+
+ # 销售订单清理(排除已交付,已锁定,已取消)
+ if 'sale.order' in model_list:
+ self.model_cancel('sale.order', except_states=['delivered', 'done', 'cancel'])
+
+ # 采购订单清理(排除采购订单,已锁定,已取消)
+ if 'purchase.order' in model_list:
+ self.model_cancel('purchase.order', except_states=['purchase', 'done', 'cancel'])
+
+ # 生产订单清理(排除返工,报废,完成,已取消)
+ if 'mrp.production' in model_list:
+ self.model_cancel('mrp.production', except_states=['rework', 'scrap', 'done', 'cancel'])
+
+ # 工单清理 (排除返工,完成,已取消)
+ if 'mrp.workorder' in model_list:
+ self.model_cancel('mrp.production', except_states=['rework', 'done', 'cancel'])
+
+ # 排程单清理 (排除已完成,已取消)
+ if 'mrp.workorder' in model_list:
+ self.model_cancel('mrp.production', except_states=['finished', 'cancel'])
+
+ # 工单库存移动 (排除完成,已取消)
+ if 'stock.move' in model_list:
+ self.model_cancel('stock.move')
+
+ # 库存调拨清理 (排除完成,已取消)
+ if 'stock.picking' in model_list:
+ self.model_cancel('stock.picking')
+
+ # 会计凭证清理 (排除已过账,已取消)
+ if 'account.move' in model_list:
+ self.model_cancel('account.move', except_states=['posted', 'cancel'])
+
+ return True
+
+ def model_cancel(self, model_name, state_field='state', to_state='cancel',except_states=('done', 'cancel')):
+ table = self.env[model_name]._table
+ if isinstance(except_states, list):
+ except_states = tuple(except_states)
+ sql = """
+ UPDATE
+ %s SET %s = '%s'
+ WHERE
+ create_date < '%s'
+ AND state NOT IN %s
+""" % (table, state_field, to_state, self.date.strftime('%Y-%m-%d'), except_states)
+ self.env.cr.execute(sql)
+ self.env.cr.commit()
+
+ @api.model
+ def get_confirm_message(self):
+ date_str = self.date.strftime('%Y-%m-%d') if self.date else ''
+ model_names = ', '.join([model.name for model in self.model_ids])
+ return {
+ 'date': date_str,
+ 'model_names': model_names
+ }
+
+ def action_clean_data_confirm(self):
+ model_names = self.model_ids.mapped('display_name')
+ return {
+ 'type': 'ir.actions.client',
+ 'tag': 'action_clean_data_confirm',
+ 'params': {
+ 'model_names': model_names,
+ 'date': self.date,
+ 'active_id': self.id,
+ 'context': self.env.context
+ }
+ }
+
+
+
+
diff --git a/jikimo_test_assistant/wizards/jikimo_data_clean_wizard.xml b/jikimo_test_assistant/wizards/jikimo_data_clean_wizard.xml
new file mode 100644
index 00000000..d297bb3c
--- /dev/null
+++ b/jikimo_test_assistant/wizards/jikimo_data_clean_wizard.xml
@@ -0,0 +1,47 @@
+
+
+
+
+ jikimo.data.clean.wizard.form
+ jikimo.data.clean.wizard
+
+
+
+
+
+
+
+ 业务数据清理
+ jikimo.data.clean.wizard
+ form
+ new
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sf_quality/views/quality_check_view.xml b/sf_quality/views/quality_check_view.xml
index 2b8143e6..00b139de 100644
--- a/sf_quality/views/quality_check_view.xml
+++ b/sf_quality/views/quality_check_view.xml
@@ -91,12 +91,14 @@
-
-
-
- {'is_web_request': True, 'search_default_waiting': 1}
+ {
+ 'is_web_request': True,
+ 'search_default_progress': 1,
+ 'search_default_passed': 1,
+ 'search_default_failed': 1,
+ }
\ No newline at end of file
From 827311a146480af9baae8ec60620e91f712fa816 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?=
Date: Thu, 13 Feb 2025 13:04:16 +0800
Subject: [PATCH 07/14] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E6=A3=80=E6=9F=A5?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B93=E4=B8=AA=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5=E7=9A=84=E9=9A=90=E8=97=8F=E9=BB=98=E8=AE=A4=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_quality/views/quality_check_view.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sf_quality/views/quality_check_view.xml b/sf_quality/views/quality_check_view.xml
index 00b139de..f69f2b65 100644
--- a/sf_quality/views/quality_check_view.xml
+++ b/sf_quality/views/quality_check_view.xml
@@ -77,6 +77,15 @@
+
+ hide
+
+
+ hide
+
+
+ hide
+
From 32ead7fa07bf842929b86ae01e0fcccac6127804 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?=
Date: Thu, 13 Feb 2025 13:29:54 +0800
Subject: [PATCH 08/14] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=AE=BE=E7=BD=AEtree?=
=?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=BA=E9=9A=90=E8=97=8F=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_quality/views/quality_check_view.xml | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/sf_quality/views/quality_check_view.xml b/sf_quality/views/quality_check_view.xml
index f69f2b65..00b139de 100644
--- a/sf_quality/views/quality_check_view.xml
+++ b/sf_quality/views/quality_check_view.xml
@@ -77,15 +77,6 @@
-
- hide
-
-
- hide
-
-
- hide
-
From a05885936db495a7e03a3b9da71f761e3bc6e377 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Thu, 13 Feb 2025 14:26:01 +0800
Subject: [PATCH 09/14] =?UTF-8?q?=E5=88=80=E5=85=B7=E6=A0=87=E5=87=86?=
=?UTF-8?q?=E5=BA=93=E5=8F=8A=E5=85=B3=E8=81=94=E6=A8=A1=E5=9E=8B=E5=90=8C?=
=?UTF-8?q?=E6=AD=A5=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_mrs_connect/models/sync_common.py | 55 ++++++++++++++++++++++++++--
1 file changed, 52 insertions(+), 3 deletions(-)
diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py
index 835183b3..9115bc65 100644
--- a/sf_mrs_connect/models/sync_common.py
+++ b/sf_mrs_connect/models/sync_common.py
@@ -1988,6 +1988,9 @@ class CuttingSpeed(models.Model):
})
else:
cutting_speed.write({
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'execution_standard_id': self.env['sf.international.standards'].search(
[('code', '=', item['execution_standard_code'])]).id,
'material_name_id': self.env['sf.materials.model'].search(
@@ -2040,6 +2043,9 @@ class CuttingSpeed(models.Model):
})
else:
cutting_speed.write({
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'execution_standard_id': self.env['sf.international.standards'].search(
[('code', '=', item['execution_standard_code'])]).id,
'material_name_id': self.env['sf.materials.model'].search(
@@ -2130,6 +2136,9 @@ class CuttingSpeed(models.Model):
})
else:
feed_per_tooth.write({
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'materials_type_id': self.env['sf.materials.model'].search(
[('materials_no', '=', item['materials_type_code'])]).id,
'cutting_width_depth_id': self.env['sf.cutting.width.depth'].search(
@@ -2168,6 +2177,9 @@ class CuttingSpeed(models.Model):
})
else:
feed_per_tooth.write({
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'materials_type_id': self.env['sf.materials.model'].search(
[('materials_no', '=', item['materials_type_code'])]).id,
'cutting_width_depth_id': self.env['sf.cutting.width.depth'].search(
@@ -2454,6 +2466,11 @@ class CuttingToolBasicParameters(models.Model):
else:
self.search([('code', '=', integral_tool_item['code'])]).write({
'name': integral_tool_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [(
+ 'code', '=',
+ integral_tool_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'total_length': integral_tool_item['total_length'],
'blade_diameter': integral_tool_item['blade_diameter'],
'blade_length': integral_tool_item['blade_length'],
@@ -2516,6 +2533,9 @@ class CuttingToolBasicParameters(models.Model):
else:
self.search([('code', '=', blade_item['code'])]).write({
'name': blade_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', blade_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'length': blade_item['length'],
'thickness': blade_item['thickness'],
'cutting_blade_length': blade_item['cutting_blade_length'],
@@ -2573,6 +2593,9 @@ class CuttingToolBasicParameters(models.Model):
else:
self.search([('code', '=', chuck_item['code'])]).write({
'name': chuck_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', chuck_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'er_size_model': chuck_item['size_model'],
'min_clamping_diameter': chuck_item['clamping_diameter_min'],
'max_clamping_diameter': chuck_item['clamping_diameter_max'],
@@ -2632,6 +2655,9 @@ class CuttingToolBasicParameters(models.Model):
else:
self.search([('code', '=', cutter_arbor_item['code'])]).write({
'name': cutter_arbor_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', cutter_arbor_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'height': cutter_arbor_item['height'],
'width': cutter_arbor_item['width'],
'total_length': cutter_arbor_item['total_length'],
@@ -2697,6 +2723,9 @@ class CuttingToolBasicParameters(models.Model):
else:
self.search([('code', '=', cutter_head_item['code'])]).write({
'name': cutter_head_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', cutter_head_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'install_blade_tip_num': cutter_head_item['number_blade_installed'],
'blade_diameter': cutter_head_item['blade_diameter'],
'cutter_head_diameter': cutter_head_item['cutter_diameter'],
@@ -2727,6 +2756,9 @@ class CuttingToolBasicParameters(models.Model):
[('code', '=', knife_handle_item['code']), ('active', 'in', [True, False])])
val = {
'name': knife_handle_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', knife_handle_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'taper_shank_model': knife_handle_item['taper_shank_model'],
'total_length': knife_handle_item['total_length'],
'flange_shank_length': knife_handle_item['flange_length'],
@@ -2751,9 +2783,6 @@ class CuttingToolBasicParameters(models.Model):
if not knife_handle:
val['code'] = knife_handle_item['code']
val['cutting_tool_type'] = '刀柄'
- val['standard_library_id'] = self.env['sf.cutting_tool.standard.library'].search(
- [('code', '=', knife_handle_item['standard_library_code'].replace("JKM", result[
- 'factory_short_name']))]).id
self.create(val)
else:
self.search([('code', '=', knife_handle_item['code'])]).write(val)
@@ -2809,6 +2838,11 @@ class CuttingToolBasicParameters(models.Model):
else:
integral_tool.write({
'name': integral_tool_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [(
+ 'code', '=',
+ integral_tool_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'total_length': integral_tool_item['total_length'],
'blade_diameter': integral_tool_item['blade_diameter'],
'blade_length': integral_tool_item['blade_length'],
@@ -2871,6 +2905,9 @@ class CuttingToolBasicParameters(models.Model):
else:
blade.write({
'name': blade_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', blade_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'length': blade_item['length'],
'thickness': blade_item['thickness'],
'cutting_blade_length': blade_item['cutting_blade_length'],
@@ -2928,6 +2965,9 @@ class CuttingToolBasicParameters(models.Model):
else:
chuck.write({
'name': chuck_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', chuck_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'er_size_model': chuck_item['size_model'],
'min_clamping_diameter': chuck_item['clamping_diameter_min'],
'max_clamping_diameter': chuck_item['clamping_diameter_max'],
@@ -2987,6 +3027,9 @@ class CuttingToolBasicParameters(models.Model):
else:
cutter_arbor.write({
'name': cutter_arbor_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', cutter_arbor_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'height': cutter_arbor_item['height'],
'width': cutter_arbor_item['width'],
'total_length': cutter_arbor_item['total_length'],
@@ -3053,6 +3096,9 @@ class CuttingToolBasicParameters(models.Model):
else:
cutter_head.write({
'name': cutter_head_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', cutter_head_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'install_blade_tip_num': cutter_head_item['number_blade_installed'],
'blade_diameter': cutter_head_item['blade_diameter'],
'cutter_head_diameter': cutter_head_item['cutter_diameter'],
@@ -3114,6 +3160,9 @@ class CuttingToolBasicParameters(models.Model):
else:
knife_handle.write({
'name': knife_handle_item['name'],
+ 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
+ [('code', '=', knife_handle_item['standard_library_code'].replace("JKM", result[
+ 'factory_short_name']))]).id,
'total_length': knife_handle_item['total_length'],
'taper_shank_model': knife_handle_item['taper_shank_model'],
'flange_shank_length': knife_handle_item['flange_length'],
From 3130ef4983589f897fab129c52f9da7b8e1f6ee1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?=
Date: Thu, 13 Feb 2025 15:48:41 +0800
Subject: [PATCH 10/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=A5=E5=8D=95?=
=?UTF-8?q?=E7=9A=84=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E5=B7=B2=E7=BB=8F?=
=?UTF-8?q?leave=5Fid=E5=AD=97=E6=AE=B5=E7=9A=84=E7=9B=91=E6=8E=A7?=
=?UTF-8?q?=EF=BC=8C=E5=BC=82=E5=B8=B8=E5=88=99=E5=8F=91=E9=80=81=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=B6=88=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_workorder.py | 1 +
sf_message/data/bussiness_node.xml | 8 ++++++++
sf_message/data/template_data.xml | 15 +++++++++++++++
sf_message/models/sf_message_workorder.py | 7 +++++++
4 files changed, 31 insertions(+)
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index ef121e1b..83f5210f 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -69,6 +69,7 @@ class ResMrpWorkOrder(models.Model):
delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], string='时效',
tracking=True)
+ date_planned_start = fields.Datetime(tracking=True)
@api.depends('processing_panel')
def _compute_processing_panel_selection(self):
diff --git a/sf_message/data/bussiness_node.xml b/sf_message/data/bussiness_node.xml
index b429d766..4003df45 100644
--- a/sf_message/data/bussiness_node.xml
+++ b/sf_message/data/bussiness_node.xml
@@ -156,4 +156,12 @@
product.product
+
+
+
+ 计划数据异常跟踪
+ mrp.workorder
+
+
+
\ No newline at end of file
diff --git a/sf_message/data/template_data.xml b/sf_message/data/template_data.xml
index 11f05a3c..c0e96d99 100644
--- a/sf_message/data/template_data.xml
+++ b/sf_message/data/template_data.xml
@@ -402,4 +402,19 @@
事项:有{{num}}个质检单需要处理。
+
+
+
+ 计划数据异常跟踪
+
+ mrp.workorder
+
+ markdown
+ normal
+ ### 工单计划数据异常删除:
+工单号:{{name}}
+异动时间:{{write_date}}
+
+
+
\ No newline at end of file
diff --git a/sf_message/models/sf_message_workorder.py b/sf_message/models/sf_message_workorder.py
index 653562e1..42b03139 100644
--- a/sf_message/models/sf_message_workorder.py
+++ b/sf_message/models/sf_message_workorder.py
@@ -188,3 +188,10 @@ class SFMessageWork(models.Model):
])
if message_queue_ids:
message_queue_ids.write({'message_status': 'cancel'})
+
+ def write(self, vals):
+ res = super(SFMessageWork, self).write(vals)
+ if ('leave_id' in vals and vals['leave_id'] is False or 'date_planned_start' in vals and vals['date_planned_start'] is False) \
+ and self.schedule_state != '未排':
+ self.add_queue('计划数据异常跟踪')
+ return res
From b117fde8c3dd0de78ced16f744bc00dc0aa8db89 Mon Sep 17 00:00:00 2001
From: hyyy <123@qq.com>
Date: Fri, 14 Feb 2025 17:31:19 +0800
Subject: [PATCH 11/14] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A8=A1=E5=9D=97?=
=?UTF-8?q?=EF=BC=8C=E7=A7=BB=E5=88=B0efms=E9=87=8C=E9=9D=A2=EF=BC=8C?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jikimo_frontend/__manifest__.py | 4 +-
.../many2one_radio_field.css | 3 -
.../many2one_radio_field.js | 53 ----------
.../many2one_radio_field.xml | 35 ------
.../custom_many2many_checkboxes.css | 100 ------------------
.../custom_many2many_checkboxes.js | 60 -----------
.../custom_many2many_checkboxes.xml | 23 ----
sf_base/static/js/updateTable.js | 80 +++-----------
sf_base/views/tool_views.xml | 4 +-
sf_manufacturing/views/sale_order_views.xml | 2 +-
sf_sale/static/src/css/purchase_list.css | 6 ++
sf_sale/views/sale_order_view.xml | 3 +-
.../static/src/js/3d_viewer.css | 3 +
.../static/src/js/3d_viewer.js | 5 +
.../static/src/js/3d_viewer.xml | 1 +
15 files changed, 36 insertions(+), 346 deletions(-)
delete mode 100644 jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.css
delete mode 100644 jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js
delete mode 100644 jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.xml
delete mode 100644 jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css
delete mode 100644 jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js
delete mode 100644 jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml
create mode 100644 web_widget_model_viewer/static/src/js/3d_viewer.css
diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py
index c3598323..b8b77eb1 100644
--- a/jikimo_frontend/__manifest__.py
+++ b/jikimo_frontend/__manifest__.py
@@ -21,8 +21,8 @@
'web.assets_qweb': [
],
'web.assets_backend': [
- 'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*',
- 'jikimo_frontend/static/src/fields/Many2OneRadioField/*',
+ # 'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*',
+ # 'jikimo_frontend/static/src/fields/Many2OneRadioField/*',
# 移除odoo相关标识
'jikimo_frontend/static/src/bye_odoo/*',
'jikimo_frontend/static/src/scss/custom_style.scss',
diff --git a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.css b/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.css
deleted file mode 100644
index 72d877a0..00000000
--- a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.many2one_radio_field {
- display: inline-block;
-}
\ No newline at end of file
diff --git a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js b/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js
deleted file mode 100644
index 8c2be97f..00000000
--- a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @odoo-module **/
-
-import { RadioField } from "@web/views/fields/radio/radio_field"; // 导入单选按钮组件
-import { registry } from "@web/core/registry";
-
-export class Many2OneRadioField extends RadioField {
- // 你可以重写或者添加一些方法和属性
- // 例如,你可以重写setup方法来添加一些事件监听器或者初始化一些变量
- setup() {
- super.setup(); // 调用父类的setup方法
- // 你自己的代码
- }
-
- onImageClick(event) {
- // 放大图片逻辑
- // 获取图片元素
- const img = event.target;
- const close = img.nextSibling;
- // 实现放大图片逻辑
- // 比如使用 CSS 放大
- img.parentElement.classList.add('zoomed');
- close.classList.add('img_close');
- }
-
- onCloseClick(event) {
- const close = event.target;
- const img = close.previousSibling;
- img.parentElement.classList.remove('zoomed');
- close.classList.remove('img_close');
- }
-
- get items() {
- return Many2OneRadioField.getItems(this.props.name, this.props.record);
- }
-
- static getItems(fieldName, record) {
- switch (record.fields[fieldName].type) {
- case "selection":
- return record.fields[fieldName].selection;
- case "many2one": {
- const value = record.preloadedData[fieldName] || [];
- return value.map((item) => [item.id, item.display_name, item.image]);
- }
- default:
- return [];
- }
- }
-}
-
-Many2OneRadioField.template = "jikimo_frontend.Many2OneRadioField";
-// MyCustomWidget.supportedTypes = ['many2many'];
-
-registry.category("fields").add("many2one_radio", Many2OneRadioField);
diff --git a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.xml b/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.xml
deleted file mode 100644
index 3d797eb0..00000000
--- a/jikimo_frontend/static/src/fields/Many2OneRadioField/many2one_radio_field.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css
deleted file mode 100644
index 20cb4c7e..00000000
--- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css
+++ /dev/null
@@ -1,100 +0,0 @@
-
-.processing-capabilities-grid {
- display: grid;
- grid-template-columns: repeat(6, 1fr);
- gap: 10px;
- width: 100%;
-}
-
-.grid-item {
- display: flex;
- align-items: center;
-}
-
-.item-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- text-align: center;
-}
-/*控制图片大小*/
-.item-icon {
- width: 50px;
- height: 50px;
- margin-bottom: 5px;
- margin-top: 15px;
-}
-
-.item-label {
- font-size: 12px;
- word-break: break-word;
-}
-
-@media (max-width: 1200px) {
- .processing-capabilities-grid {
- grid-template-columns: repeat(4, 1fr);
- }
-}
-
-@media (max-width: 768px) {
- .processing-capabilities-grid {
- grid-template-columns: repeat(3, 1fr);
- }
-}
-
-@media (max-width: 480px) {
- .processing-capabilities-grid {
- grid-template-columns: repeat(2, 1fr);
- }
-}
-.image-preview-container {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.9);
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 1000;
- opacity: 0;
- transition: opacity 0.3s ease;
-}
-
-.image-preview-container.show {
- opacity: 1;
-}
-
-.image-preview {
- max-width: 90%;
- max-height: 90%;
- object-fit: contain;
- box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
- border-radius: 5px;
- transform: scale(0.9);
- transition: transform 0.3s ease;
-}
-
-.image-preview-container.show .image-preview {
- transform: scale(1);
-}
-
-.image-preview-close {
- position: absolute;
- top: 20px;
- right: 30px;
- color: #fff;
- font-size: 40px;
- font-weight: bold;
- transition: 0.3s;
- cursor: pointer;
- opacity: 0.7;
-}
-
-.image-preview-close:hover,
-.image-preview-close:focus {
- opacity: 1;
- text-decoration: none;
- cursor: pointer;
-}
\ No newline at end of file
diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js
deleted file mode 100644
index dee78c5f..00000000
--- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @odoo-module **/
-
-import {Many2ManyCheckboxesField} from "@web/views/fields/many2many_checkboxes/many2many_checkboxes_field";
-import {registry} from "@web/core/registry";
-
-export class MyCustomWidget extends Many2ManyCheckboxesField {
- setup() {
- super.setup();
- }
-
- onImageClick(event, src) {
- event.preventDefault();
- event.stopPropagation();
-
- // 创建预览框
- const previewContainer = document.createElement('div');
- previewContainer.className = 'image-preview-container';
-
- const previewImg = document.createElement('img');
- previewImg.src = src;
- previewImg.className = 'image-preview';
- // 设置放大的预览图片大小
- previewImg.style.width = '600px';
- previewImg.style.height = 'auto'; // 保持宽高比
-
- const closeButton = document.createElement('span');
- closeButton.innerHTML = '×';
- closeButton.className = 'image-preview-close';
-
- previewContainer.appendChild(previewImg);
- previewContainer.appendChild(closeButton);
- document.body.appendChild(previewContainer);
-
- // 添加关闭预览的事件监听器
- const closePreview = () => {
- previewContainer.classList.remove('show');
- setTimeout(() => {
- document.body.removeChild(previewContainer);
- }, 300);
- };
-
- closeButton.addEventListener('click', closePreview);
-
- // 点击预览框外部也可以关闭
- previewContainer.addEventListener('click', (e) => {
- if (e.target === previewContainer) {
- closePreview();
- }
- });
-
- // 使用 setTimeout 来触发过渡效果
- setTimeout(() => {
- previewContainer.classList.add('show');
- }, 10);
- }
-}
-
-MyCustomWidget.template = "jikimo_frontend.MyCustomWidget";
-
-registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget);
\ No newline at end of file
diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml
deleted file mode 100644
index 9bb8797d..00000000
--- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
![]()
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/sf_base/static/js/updateTable.js b/sf_base/static/js/updateTable.js
index beec2c94..f76ff006 100644
--- a/sf_base/static/js/updateTable.js
+++ b/sf_base/static/js/updateTable.js
@@ -9,6 +9,7 @@ function getDomData() {
table.hide()
const thead = customTable.children('thead')
const tbody = customTable.children('tbody')
+ const tfooter = customTable.children('tfoot')
const tableData = []
const tbody_child = tbody.children()
@@ -16,30 +17,29 @@ function getDomData() {
for (let v = 0; v < tbody_child_len; v++) { // 将数据取出来到tableData里面
const data = tbody_child[v].innerText.split('\t')
- // console.log('dom data',data)
const [index, deep, name, Φ, value] = data
- tableData.push({index, deep, name, Φ, value})
+ tableData.push({ index, deep, name, Φ, value })
}
- const ΦList = [...new Set(tableData.map(_ => _.name))] // ΦList去重
+ const ΦList = [...new Set(tableData.map(_ => _.Φ))] // ΦList去重
const newTableData = {}
tableData.forEach(_ => {
- const key = _.deep + '|' + _.Φ
- !newTableData[key] ? newTableData[key] = {i: _.index} : '';
+ const key = _.deep + '|' + _.name
+ !newTableData[key] ? newTableData[key] = { i: _.index } : '';
if (_.Φ) { // 去除没有Φ的脏数据
newTableData[key]['Φ' + _.Φ] = _.value
newTableData[key]['Φ' + _.Φ + 'i'] = _.index
}
})
- // console.log('qwdh',tableData, ΦList, newTableData);
+ // console.log(tableData, ΦList, newTableData);
if (ΦList.filter(_ => _).length == 0) return;
- handleThead(thead, ΦList)
+ handleThead(thead, ΦList, tfooter)
- handleTbody(tbody, newTableData, ΦList, table)
+ handleTbody(tbody, newTableData, ΦList, table )
}
// 重新设置表头、
-function handleThead(thead, ΦList) {
+function handleThead(thead, ΦList, tfooter) {
const dom = thead.children().eq(0).children()
const len = dom.length
dom.eq(0).attr('rowspan', 2)
@@ -47,7 +47,11 @@ function handleThead(thead, ΦList) {
len == 5 ? dom.eq(2).attr('rowspan', 2) : ''
dom.eq(-2).attr('colspan', ΦList.length)
dom.eq(-1).remove()
-
+ if(tfooter && tfooter.length) {
+ tfooter.children().each(function () {
+ $(this).children().eq(-1).remove()
+ })
+ }
const tr = document.createElement('tr')
for (let v = 0; v < ΦList.length; v++) {
const th = document.createElement('th')
@@ -68,7 +72,6 @@ function handleTbody(tbody, newTableData, ΦList, table) {
// b = b.split('=')[1].split('%')[0]
// return a - b
// })
- // console.log('wqoqw ',ΦList)
data.forEach(_ => {
i++
const tr = $('
')
@@ -98,61 +101,6 @@ function handleTbody(tbody, newTableData, ΦList, table) {
// // }
tbody.append(tr)
})
- // $(document).click(function (e) {
- // if ($(e.target).attr('coustomTd')) {
- // const orginV = $('[coustomInput=1]').children('input').val()
- // $('[coustomInput=1]').parent().html(orginV)
- // const v = $(e.target).attr('val')
- // console.log($(e.target));
- // $(e.target).html('')
- // const input = $('')
- // input.children('input').val(v)
- // $(e.target).append(input)
- // input.children('input').focus()
- // input.children('input').select()
- // } else if ($(e.target).attr('coustomInput')) {
- //
- // } else {
- // const orginV = $('[coustomInput=1]').children('input').val()
- // $('[coustomInput=1]').parent().html(orginV)
- // const v = $(e.target).attr('val')
- // }
- // })
- // $(document).off('change') // 防止重复绑定
-// $(document).on('change', '[coustomInput] input', function () {
-// $(this).parents('td').attr('val', $(this).val());
-// var eve1 = new Event('change');
-// var eve2 = new Event('input');
-// var eve3 = new Event('click');
-// const i = $(this).parents('td').attr('col');
-// let patchDom = table.find('tbody').children('tr').eq(i - 1);
-//
-// if (patchDom.length === 0) {
-// console.error('No such row found');
-// return;
-// }
-//
-// patchDom = patchDom.children().eq(-1);
-//
-// setTimeout(() => {
-// if (patchDom.length === 0) {
-// console.error('No such cell found');
-// return;
-// }
-// patchDom[0].dispatchEvent(eve3); // Simulate click event
-//
-// setTimeout(() => {
-// patchDom = patchDom.find('input');
-// if (patchDom.length === 0) {
-// console.error('No input found in the target cell');
-// return;
-// }
-// patchDom.val($(this).val());
-// patchDom[0].dispatchEvent(eve2);
-// patchDom[0].dispatchEvent(eve1);
-// }, 200);
-// }, 500);
-// });
}
diff --git a/sf_base/views/tool_views.xml b/sf_base/views/tool_views.xml
index b2d53392..e0679e55 100644
--- a/sf_base/views/tool_views.xml
+++ b/sf_base/views/tool_views.xml
@@ -177,12 +177,12 @@
-
+
+ widget="custom_many2many_checkboxes" attrs="{'showExpand': True}"/>
diff --git a/sf_manufacturing/views/sale_order_views.xml b/sf_manufacturing/views/sale_order_views.xml
index 8e1d1061..ceaa09ab 100644
--- a/sf_manufacturing/views/sale_order_views.xml
+++ b/sf_manufacturing/views/sale_order_views.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/sf_sale/static/src/css/purchase_list.css b/sf_sale/static/src/css/purchase_list.css
index 2deacb9c..5e2aa86e 100644
--- a/sf_sale/static/src/css/purchase_list.css
+++ b/sf_sale/static/src/css/purchase_list.css
@@ -1,3 +1,9 @@
.purchase_order_list_name {
min-width: 62px !important;
+}
+
+.section_and_note_text span{
+ white-space: wrap!important;
+ overflow: auto!important;
+ text-overflow: unset!important;
}
\ No newline at end of file
diff --git a/sf_sale/views/sale_order_view.xml b/sf_sale/views/sale_order_view.xml
index 24e8f3ef..d408e807 100644
--- a/sf_sale/views/sale_order_view.xml
+++ b/sf_sale/views/sale_order_view.xml
@@ -102,7 +102,7 @@
+ string="模型文件" attrs="{'readonly': [('state', 'in', ['draft'])], 'isInList': True}"/>
@@ -112,6 +112,7 @@
{'no_create': True}
{'is_sale_order_line': True }
+ section_and_note_text
{'readonly': [('state', 'in', ['cancel','sale'])]}
diff --git a/web_widget_model_viewer/static/src/js/3d_viewer.css b/web_widget_model_viewer/static/src/js/3d_viewer.css
new file mode 100644
index 00000000..238f793d
--- /dev/null
+++ b/web_widget_model_viewer/static/src/js/3d_viewer.css
@@ -0,0 +1,3 @@
+.model-viewer-in-list {
+ width: 150px;
+}
\ No newline at end of file
diff --git a/web_widget_model_viewer/static/src/js/3d_viewer.js b/web_widget_model_viewer/static/src/js/3d_viewer.js
index 4ed9dcc1..6e4b969c 100644
--- a/web_widget_model_viewer/static/src/js/3d_viewer.js
+++ b/web_widget_model_viewer/static/src/js/3d_viewer.js
@@ -63,11 +63,16 @@ StepViewer.supportedTypes = ["binary"];
StepViewer.props = {
...standardFieldProps,
url: {type: String, optional: true},
+ isInList: {type: Boolean, optional: true},
};
StepViewer.extractProps = ({attrs}) => {
+ const modifiedAttrs = JSON.parse(attrs.modifiers || '{}');
+
+
return {
url: attrs.options.url,
+ isInList: modifiedAttrs.isInList,
};
};
diff --git a/web_widget_model_viewer/static/src/js/3d_viewer.xml b/web_widget_model_viewer/static/src/js/3d_viewer.xml
index 73f142c9..9053d184 100644
--- a/web_widget_model_viewer/static/src/js/3d_viewer.xml
+++ b/web_widget_model_viewer/static/src/js/3d_viewer.xml
@@ -5,6 +5,7 @@
Date: Mon, 17 Feb 2025 12:42:07 +0800
Subject: [PATCH 12/14] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=20=E5=85=A5?=
=?UTF-8?q?=E5=BA=93=E4=BC=98=E5=8C=96=EF=BC=9A=E8=87=AA=E5=8A=A8=E7=A1=AE?=
=?UTF-8?q?=E8=AE=A4=E5=BA=8F=E5=88=97=E5=8F=B7=20=20=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/stock.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py
index 1e0b0849..901b521b 100644
--- a/sf_manufacturing/models/stock.py
+++ b/sf_manufacturing/models/stock.py
@@ -611,6 +611,18 @@ class StockPicking(models.Model):
return sequence_id
def button_validate(self):
+ # 校验“收料入库单、客供料入库单”是否已经分配序列号,如果没有分配则自动分配
+ if self.picking_type_id.use_existing_lots is False and self.picking_type_id.use_create_lots is True:
+ for move in self.move_ids:
+ if not move.move_line_nosuggest_ids:
+ move.action_show_details()
+ else:
+ # 对已经生成的序列号做唯一性校验,如果重复则重新生成新的序列号
+ line_lot_name = [line_id.lot_name for line_id in move.move_line_nosuggest_ids]
+ lot_ids = self.env['stock.lot'].sudo().search([('name', 'in', line_lot_name)])
+ if lot_ids:
+ move.action_clear_lines_show_details()
+ move.action_show_details()
res = super().button_validate()
picking_type_in = self.env.ref('sf_manufacturing.outcontract_picking_in').id
if res is True and self.picking_type_id.id == picking_type_in:
@@ -844,7 +856,8 @@ class ReStockMove(models.Model):
self.next_serial = self._get_tool_next_serial(self.company_id, self.product_id, self.origin)
else:
self.next_serial = self.env['stock.lot']._get_next_serial(self.company_id, self.product_id)
- if self.picking_type_id.sequence_code == 'DL' and not self.move_line_nosuggest_ids:
+ if (self.picking_type_id.use_existing_lots is False
+ and self.picking_type_id.use_create_lots is True and not self.move_line_nosuggest_ids):
self.action_assign_serial_show_details()
elif self.product_id.tracking == "lot":
self._put_tool_lot(self.company_id, self.product_id, self.origin)
From 8095a8a9727b27eaae54e221f0e282fa3cf307a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?=
Date: Mon, 17 Feb 2025 13:23:32 +0800
Subject: [PATCH 13/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E9=80=81?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=AD=97=E6=AE=B5=E5=85=B3=E8=81=94?=
=?UTF-8?q?=E5=BD=A2=E5=BC=8F=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BB=B6?=
=?UTF-8?q?=E9=85=8D=E9=80=81=E5=88=97=E8=A1=A8=E9=A1=B5=E7=9A=84=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/agv_scheduling.py | 6 +-----
sf_manufacturing/models/mrp_workorder.py | 6 +-----
sf_manufacturing/views/mrp_workorder_view.xml | 6 +++++-
sf_manufacturing/wizard/workpiece_delivery_wizard.py | 5 +----
4 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/sf_manufacturing/models/agv_scheduling.py b/sf_manufacturing/models/agv_scheduling.py
index f39c07e7..95813e1b 100644
--- a/sf_manufacturing/models/agv_scheduling.py
+++ b/sf_manufacturing/models/agv_scheduling.py
@@ -19,12 +19,8 @@ class AgvScheduling(models.Model):
_order = 'id desc'
name = fields.Char('任务单号', index=True, copy=False)
-
- def _get_agv_route_type_selection(self):
- return self.env['sf.agv.task.route'].fields_get(['route_type'])['route_type']['selection']
-
- agv_route_type = fields.Selection(selection=_get_agv_route_type_selection, string='任务类型', required=True)
agv_route_id = fields.Many2one('sf.agv.task.route', '任务路线')
+ agv_route_type = fields.Selection(related='agv_route_id.route_type', string='任务类型', required=True)
start_site_id = fields.Many2one('sf.agv.site', '起点接驳站', required=True)
end_site_id = fields.Many2one('sf.agv.site', '终点接驳站', tracking=True)
site_state = fields.Selection([
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 83f5210f..3717cebe 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -1859,11 +1859,7 @@ class WorkPieceDelivery(models.Model):
feeder_station_destination_id = fields.Many2one('sf.agv.site', '目的接驳站')
task_delivery_time = fields.Datetime('任务下发时间')
task_completion_time = fields.Datetime('任务完成时间')
-
- def _get_agv_route_type_selection(self):
- return self.env['sf.agv.task.route'].fields_get(['route_type'])['route_type']['selection']
-
- type = fields.Selection(selection=_get_agv_route_type_selection, string='类型')
+ type = fields.Selection(related='route_id.route_type', string='类型')
delivery_duration = fields.Float('配送时长', compute='_compute_delivery_duration')
status = fields.Selection(
[('待下发', '待下发'), ('已下发', '待配送'), ('已配送', '已配送'), ('已取消', '已取消')], string='状态',
diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml
index b1d59405..419eec50 100644
--- a/sf_manufacturing/views/mrp_workorder_view.xml
+++ b/sf_manufacturing/views/mrp_workorder_view.xml
@@ -785,6 +785,10 @@
+
+
+
+
@@ -807,7 +811,7 @@
sf.workpiece.delivery
{'search_default_filter_to_be_issued': 1,
- 'search_default_filter_issued': 1}
+ 'search_default_filter_type_to_production_line': 1}
tree,form
diff --git a/sf_manufacturing/wizard/workpiece_delivery_wizard.py b/sf_manufacturing/wizard/workpiece_delivery_wizard.py
index 6a13fc08..bc4b8210 100644
--- a/sf_manufacturing/wizard/workpiece_delivery_wizard.py
+++ b/sf_manufacturing/wizard/workpiece_delivery_wizard.py
@@ -54,10 +54,7 @@ class WorkpieceDeliveryWizard(models.TransientModel):
}
}
- def _get_agv_route_type_selection(self):
- return self.env['sf.agv.task.route'].fields_get(['route_type'])['route_type']['selection']
-
- delivery_type = fields.Selection(selection=_get_agv_route_type_selection, string='类型')
+ delivery_type = fields.Selection(related='route_id.route_type', string='类型')
def dispatch_confirm(self):
if len(self.workorder_ids) < 4:
From 3d2e3833309b5c2584b4c5f375fed14b57940edf Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Mon, 17 Feb 2025 15:17:54 +0800
Subject: [PATCH 14/14] =?UTF-8?q?1=E3=80=81=E5=A4=84=E7=90=86=20sf-?=
=?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95-=E9=80=9A=E8=BF=87?=
=?UTF-8?q?=E8=B4=A8=E9=87=8F=E6=A3=80=E6=9F=A5=E5=AF=B9=E8=A3=85=E5=A4=B9?=
=?UTF-8?q?=E9=A2=84=E8=B0=83=E8=BF=9B=E8=A1=8C=E8=BF=94=E5=B7=A5-?=
=?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E6=9C=AA=E8=AE=B0=E5=BD=95?=
=?UTF-8?q?=E6=A3=80=E6=B5=8B=E7=BB=93=E6=9E=9C=20=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=9B2=E3=80=81=E5=A4=84=E7=90=86=20=E6=89=8B=E5=8A=A8?=
=?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=B0=83=E6=8B=A8=E5=8D=95=E5=8F=B3=E4=B8=8A?=
=?UTF-8?q?=E8=A7=92=E4=BC=9A=E5=85=B3=E8=81=94=E5=9D=AF=E6=96=99=E9=87=87?=
=?UTF-8?q?=E8=B4=AD=E5=8D=95=E5=92=8C=E5=9D=AF=E6=96=99=E5=A7=94=E5=A4=96?=
=?UTF-8?q?=E5=8D=95=20=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_quality/models/quality.py | 12 ++++++++++++
sf_stock/models/stock_picking.py | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/sf_quality/models/quality.py b/sf_quality/models/quality.py
index 201103f1..80fe2f46 100644
--- a/sf_quality/models/quality.py
+++ b/sf_quality/models/quality.py
@@ -84,6 +84,18 @@ class QualityCheck(models.Model):
raise ValidationError('请填写【判定结果】里的信息')
if self.test_results == '合格':
raise ValidationError('请重新选择【判定结果】-【检测结果】')
+ if self.workorder_id.routing_type != 'CNC加工' and self.workorder_id.individuation_page_PTD is False:
+ self.workorder_id.production_id.write({'detection_result_ids': [(0, 0, {
+ 'rework_reason': self.workorder_id.reason,
+ 'detailed_reason': self.workorder_id.detailed_reason,
+ 'processing_panel': self.workorder_id.processing_panel,
+ 'routing_type': self.workorder_id.routing_type,
+ 'handle_result': '待处理' if (self.workorder_id.test_results in ['返工', '报废']
+ or self.workorder_id.is_rework is True) else '',
+ 'test_results': self.workorder_id.test_results,
+ 'test_report': self.workorder_id.detection_report})],
+ 'is_scrap': True if self.workorder_id.test_results == '报废' else False
+ })
if self.workorder_id.state not in ['done']:
self.workorder_id.write(
{'test_results': self.test_results, 'reason': self.reason, 'detailed_reason': self.detailed_reason})
diff --git a/sf_stock/models/stock_picking.py b/sf_stock/models/stock_picking.py
index f8105097..7b73485b 100644
--- a/sf_stock/models/stock_picking.py
+++ b/sf_stock/models/stock_picking.py
@@ -18,7 +18,7 @@ class StockPicking(models.Model):
@api.depends('name')
def _compute_pro_purchase_count(self):
for sp in self:
- if sp:
+ if sp.name and sp.name != '/':
po_ids = self.env['purchase.order'].sudo().search([
('origin', 'like', sp.name), ('purchase_type', '=', 'standard')])
if po_ids:
@@ -52,7 +52,7 @@ class StockPicking(models.Model):
@api.depends('name')
def _compute_pro_out_purchase_count(self):
for sp in self:
- if sp:
+ if sp.name and sp.name != '/':
po_ids = self.env['purchase.order'].sudo().search([
('origin', 'like', sp.name), ('purchase_type', '=', 'outsourcing')])
if po_ids: