Accept Merge Request #1227: (feature/agv_dispatch -> develop)
Merge Request: 增加可以移除焦点的controller Created By: @胡尧 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @胡尧 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1227
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,
|
||||||
|
});
|
||||||
@@ -164,8 +164,9 @@ class AgvScheduling(models.Model):
|
|||||||
task_route = task_routes.filtered(
|
task_route = task_routes.filtered(
|
||||||
lambda r: r.start_site_id == agv_scheduling.start_site_id and r.start_site_id == agv_scheduling.start_site_id
|
lambda r: r.start_site_id == agv_scheduling.start_site_id and r.start_site_id == agv_scheduling.start_site_id
|
||||||
)
|
)
|
||||||
# 下发AGV调度任务并修改接驳站状态为占用
|
if task_route:
|
||||||
agv_scheduling.dispatch_scheduling(task_route)
|
# 下发AGV调度任务并修改接驳站状态为占用
|
||||||
|
agv_scheduling.dispatch_scheduling(task_route)
|
||||||
|
|
||||||
def _delivery_avg(self):
|
def _delivery_avg(self):
|
||||||
config = self.env['res.config.settings'].get_values()
|
config = self.env['res.config.settings'].get_values()
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ odoo.define('sf_manufacturing.action_dispatch_confirm', function (require) {
|
|||||||
var _t = core._t;
|
var _t = core._t;
|
||||||
|
|
||||||
async function dispatch_confirm(parent, {params}) {
|
async function dispatch_confirm(parent, {params}) {
|
||||||
console.log(params, 'params')
|
|
||||||
console.log("<div>本次下发的工件数量为:" + params.workorder_count + ",是否确认?</div>", 'content')
|
|
||||||
const dialog = new Dialog(parent, {
|
const dialog = new Dialog(parent, {
|
||||||
title: "确认",
|
title: "确认",
|
||||||
$content: $('<div>').append("请确认是否仅配送" + params.workorder_count + "个工件?"),
|
$content: $('<div>').append("请确认是否仅配送" + params.workorder_count + "个工件?"),
|
||||||
@@ -30,8 +28,6 @@ odoo.define('sf_manufacturing.action_dispatch_confirm', function (require) {
|
|||||||
context: params.context,
|
context: params.context,
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res, 'res')
|
|
||||||
console.log(res.name, 'res')
|
|
||||||
parent.services.action.doAction({
|
parent.services.action.doAction({
|
||||||
'type': 'ir.actions.client',
|
'type': 'ir.actions.client',
|
||||||
'tag': 'display_notification',
|
'tag': 'display_notification',
|
||||||
|
|||||||
@@ -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