diff --git a/shopfloor_reception_packaging_dimension_mobile/static/src/scenario/reception_packaging_dimension.js b/shopfloor_reception_packaging_dimension_mobile/static/src/scenario/reception_packaging_dimension.js index dc75b3f975..980adbbb2a 100644 --- a/shopfloor_reception_packaging_dimension_mobile/static/src/scenario/reception_packaging_dimension.js +++ b/shopfloor_reception_packaging_dimension_mobile/static/src/scenario/reception_packaging_dimension.js @@ -5,14 +5,12 @@ import {process_registry} from "/shopfloor_mobile_base/static/wms/src/services/process_registry.js"; -import {reception_states} from "/shopfloor_reception_mobile/static/src/scenario/reception_states.js"; - -// Get the original template of the reception scenario const reception_scenario = process_registry.get("reception"); +const _get_states = reception_scenario.component.methods._get_states; +// Get the original template of the reception scenario const template = reception_scenario.component.template; // And inject the new state template (for this module) into it const pos = template.indexOf(""); - const new_template = template.substring(0, pos) + ` @@ -77,7 +75,7 @@ const new_template = v-model="state.data.packaging.max_weight" > - + @@ -105,8 +103,11 @@ const new_template = // - the js code for the new state const ReceptionPackageDimension = process_registry.extend("reception", { template: new_template, + "methods.get_packaging_measurements": function () { + return ["length", "width", "height", "max_weight", "qty", "barcode"]; + }, "methods._get_states": function () { - let states = reception_states.bind(this)(); + let states = _get_states.bind(this)(); states["set_packaging_dimension"] = { display_info: { title: "Set packaging dimension", @@ -120,15 +121,7 @@ const ReceptionPackageDimension = process_registry.extend("reception", { selected_line_id: this.state.data.selected_move_line.id, packaging_id: this.state.data.packaging.id, }; - const measurements = [ - "length", - "width", - "height", - "max_weight", - "qty", - "barcode", - ]; - for (const measurement of measurements) { + for (const measurement of this.get_packaging_measurements()) { values[measurement] = this.state.data.packaging[measurement]; } return values;