From 54fc91baa2a575af19da53ca2ab3cd5b8a5c7210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Tue, 20 Aug 2024 10:50:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89js=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/js/workpiece_delivery_wizard_confirm.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sf_manufacturing/static/src/js/workpiece_delivery_wizard_confirm.js b/sf_manufacturing/static/src/js/workpiece_delivery_wizard_confirm.js index cb044955..236836ab 100644 --- a/sf_manufacturing/static/src/js/workpiece_delivery_wizard_confirm.js +++ b/sf_manufacturing/static/src/js/workpiece_delivery_wizard_confirm.js @@ -6,8 +6,6 @@ odoo.define('sf_manufacturing.action_dispatch_confirm', function (require) { var _t = core._t; async function dispatch_confirm(parent, {params}) { - console.log(params, 'params') - console.log("
本次下发的工件数量为:" + params.workorder_count + ",是否确认?
", 'content') const dialog = new Dialog(parent, { title: "确认", $content: $('
').append("请确认是否仅配送" + params.workorder_count + "个工件?"), @@ -30,8 +28,6 @@ odoo.define('sf_manufacturing.action_dispatch_confirm', function (require) { context: params.context, } }).then(res => { - console.log(res, 'res') - console.log(res.name, 'res') parent.services.action.doAction({ 'type': 'ir.actions.client', 'tag': 'display_notification', From a767c6491ff301d00454efe487462d7b606eff8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Tue, 20 Aug 2024 14:05:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=84=A6=E7=82=B9=E7=9A=84controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/__manifest__.py | 1 + sf_base/static/src/js/remove_focus.js | 23 +++++++++++++++++++ .../wizard/workpiece_delivery_views.xml | 7 +----- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 sf_base/static/src/js/remove_focus.js diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py index ceedcdd0..b10c2630 100644 --- a/sf_base/__manifest__.py +++ b/sf_base/__manifest__.py @@ -35,6 +35,7 @@ ], 'web.assets_backend': [ 'sf_base/static/src/scss/*.scss', + 'sf_base/static/src/js/*.js', ], }, diff --git a/sf_base/static/src/js/remove_focus.js b/sf_base/static/src/js/remove_focus.js new file mode 100644 index 00000000..3e4cbb22 --- /dev/null +++ b/sf_base/static/src/js/remove_focus.js @@ -0,0 +1,23 @@ +/** @odoo-module **/ + +import { registry } from '@web/core/registry'; + +import { formView } from '@web/views/form/form_view'; +import { FormController } from '@web/views/form/form_controller'; + +import { onRendered, onMounted } from "@odoo/owl"; + +export class RemoveFocusController extends FormController { + setup() { + super.setup(); + + onMounted(() => { + this.__owl__.bdom.el.querySelectorAll(':focus').forEach(element => element.blur()); + }) + } +} + +registry.category('views').add('remove_focus_view', { + ...formView, + Controller: RemoveFocusController, +}); \ No newline at end of file diff --git a/sf_manufacturing/wizard/workpiece_delivery_views.xml b/sf_manufacturing/wizard/workpiece_delivery_views.xml index a4723b6b..676fa6b2 100644 --- a/sf_manufacturing/wizard/workpiece_delivery_views.xml +++ b/sf_manufacturing/wizard/workpiece_delivery_views.xml @@ -4,7 +4,7 @@ sf.workpiece.delivery.wizard.form.view sf.workpiece.delivery.wizard -
+ @@ -21,11 +21,6 @@