mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
stock_measuring_device: Auto-refresh zipcube wiz when measurement is done
This commit is contained in:
committed by
Hai Lang
parent
740f5bde84
commit
1e1236776e
@@ -28,21 +28,19 @@ odoo.define("stock_measuring_device.measuring_wizard", function(require) {
|
||||
var channel = notification[0];
|
||||
var message = notification[1];
|
||||
if (channel === "notify_measuring_wizard_screen") {
|
||||
switch (message.action) {
|
||||
case "refresh":
|
||||
self.measuring_wizard_bus_action_refresh(message.params);
|
||||
break;
|
||||
if (message.action === "refresh") {
|
||||
self.measuring_wizard_bus_action_refresh(message.params);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
measuring_wizard_bus_action_refresh: function(params) {
|
||||
var selectedIds = this.getSelectedIds();
|
||||
if (!selectedIds.length) {
|
||||
if (!selectedIds.length || params.model !== this.modelName) {
|
||||
return;
|
||||
}
|
||||
var currentId = selectedIds[0];
|
||||
if (params.id === currentId && params.model === this.modelName) {
|
||||
if (params.id === currentId) {
|
||||
this.reload();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -167,6 +167,7 @@ class MeasuringWizard(models.TransientModel):
|
||||
|
||||
def _send_notification_refresh(self):
|
||||
"""Send a refresh notification on the wizard.
|
||||
|
||||
Other notifications can be implemented, they have to be
|
||||
added in static/src/js/measuring_wizard.js and the message
|
||||
must contain an "action" and "params".
|
||||
|
||||
Reference in New Issue
Block a user