mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Replace custom js by 'target': 'main'
This commit is contained in:
committed by
Hai Lang
parent
439d2bc72c
commit
9ae58438ad
@@ -177,6 +177,12 @@ class VerticalLiftShuttle(models.Model):
|
|||||||
"res_id": self.id,
|
"res_id": self.id,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def action_back_to_settings(self):
|
||||||
|
action_xmlid = "stock_vertical_lift.vertical_lift_shuttle_action"
|
||||||
|
action = self.env.ref(action_xmlid).read()[0]
|
||||||
|
action["target"] = "main"
|
||||||
|
return action
|
||||||
|
|
||||||
def action_manual_barcode(self):
|
def action_manual_barcode(self):
|
||||||
return {
|
return {
|
||||||
"type": "ir.actions.act_window",
|
"type": "ir.actions.act_window",
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ odoo.define('stock_vertical_lift.vertical_lift', function (require) {
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var KanbanRecord = require('web.KanbanRecord');
|
var KanbanRecord = require('web.KanbanRecord');
|
||||||
var basicFields = require('web.basic_fields');
|
|
||||||
var field_registry = require('web.field_registry');
|
|
||||||
var FormController = require('web.FormController');
|
var FormController = require('web.FormController');
|
||||||
var FieldInteger = basicFields.FieldInteger;
|
|
||||||
|
|
||||||
KanbanRecord.include({
|
KanbanRecord.include({
|
||||||
|
|
||||||
@@ -27,27 +24,6 @@ odoo.define('stock_vertical_lift.vertical_lift', function (require) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var ExitButton = FieldInteger.extend({
|
|
||||||
tagName: 'button',
|
|
||||||
className: 'btn btn-danger btn-block btn-lg o_shuttle_exit',
|
|
||||||
events: {
|
|
||||||
'click': '_onClick',
|
|
||||||
},
|
|
||||||
_render: function () {
|
|
||||||
this.$el.text(this.string);
|
|
||||||
},
|
|
||||||
_onClick: function () {
|
|
||||||
// The only reason to have this field widget is to be able
|
|
||||||
// to inject clear_breadcrumbs in the action:
|
|
||||||
// it will revert back to a normal - non-headless - view
|
|
||||||
this.do_action('stock_vertical_lift.vertical_lift_shuttle_action', {
|
|
||||||
clear_breadcrumbs: true,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
FormController.include({
|
FormController.include({
|
||||||
init: function () {
|
init: function () {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
@@ -94,10 +70,7 @@ odoo.define('stock_vertical_lift.vertical_lift', function (require) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
field_registry.add('vlift_shuttle_exit_button', ExitButton);
|
|
||||||
|
|
||||||
return {
|
return {};
|
||||||
ExitButton: ExitButton,
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -103,10 +103,6 @@
|
|||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.o_shuttle_exit {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.o_vlift_shuttle_popup {
|
.o_vlift_shuttle_popup {
|
||||||
|
|||||||
@@ -23,8 +23,10 @@
|
|||||||
class="btn-primary btn-block btn btn-lg"/>
|
class="btn-primary btn-block btn btn-lg"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<field name="id" string="Back to settings"
|
<button name="action_back_to_settings"
|
||||||
widget="vlift_shuttle_exit_button" readonly="1"/>
|
type="object"
|
||||||
|
string="Back to settings"
|
||||||
|
class="btn-danger btn-block btn-lg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer></footer>
|
<footer></footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user