增加移除焦点的controller
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
],
|
],
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
'sf_base/static/src/scss/*.scss',
|
'sf_base/static/src/scss/*.scss',
|
||||||
|
'sf_base/static/src/js/*.js',
|
||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
23
sf_base/static/src/js/remove_focus.js
Normal file
23
sf_base/static/src/js/remove_focus.js
Normal file
@@ -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,
|
||||||
|
});
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<field name="name">sf.workpiece.delivery.wizard.form.view</field>
|
<field name="name">sf.workpiece.delivery.wizard.form.view</field>
|
||||||
<field name="model">sf.workpiece.delivery.wizard</field>
|
<field name="model">sf.workpiece.delivery.wizard</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form class="no_auto_focus">
|
<form js_class="remove_focus_view">
|
||||||
<sheet>
|
<sheet>
|
||||||
<field name="delivery_ids" invisible="True"/>
|
<field name="delivery_ids" invisible="True"/>
|
||||||
<field name="workorder_ids" invisible="True"/>
|
<field name="workorder_ids" invisible="True"/>
|
||||||
@@ -21,11 +21,6 @@
|
|||||||
<button string="确认配送" name="dispatch_confirm" type="object" class="oe_highlight o_wizard_confirm_button" attrs="{'invisible': [('confirm_button', '!=', '确认配送')]}"/>
|
<button string="确认配送" name="dispatch_confirm" type="object" class="oe_highlight o_wizard_confirm_button" attrs="{'invisible': [('confirm_button', '!=', '确认配送')]}"/>
|
||||||
<button string="确认解除" name="dispatch_confirm" type="object" class="oe_highlight o_wizard_confirm_button" attrs="{'invisible': [('confirm_button', '!=', '确认解除')]}"/>
|
<button string="确认解除" name="dispatch_confirm" type="object" class="oe_highlight o_wizard_confirm_button" attrs="{'invisible': [('confirm_button', '!=', '确认解除')]}"/>
|
||||||
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
<button string="取消" class="btn btn-secondary" special="cancel"/>
|
||||||
<script>
|
|
||||||
setTimeout(function(){
|
|
||||||
$('#feeder_station_start_id').blur()
|
|
||||||
}, 200)
|
|
||||||
</script>
|
|
||||||
</footer>
|
</footer>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user