-
- Confirm
+ Confirm
- Back
+
@@ -198,14 +195,6 @@ export var Checkout = Vue.component("checkout", {
`,
computed: {
- // TODO: move these to methods
- manual_select_picking_fields: function() {
- return [
- {path: "partner.name"},
- {path: "origin"},
- {path: "move_line_count", label: "Lines"},
- ];
- },
existing_package_select_fields: function() {
return [
{path: "weight"},
@@ -240,6 +229,20 @@ export var Checkout = Vue.component("checkout", {
identifier: data.picking.name,
};
},
+ manual_selection_manual_select_options: function() {
+ return {
+ group_title_default: "Pickings to process",
+ group_color: this.utils.colors.color_for("screen_step_todo"),
+ list_item_options: {
+ bold_title: true,
+ fields: [
+ {path: "partner.name"},
+ {path: "origin"},
+ {path: "move_line_count", label: "Lines"},
+ ],
+ },
+ };
+ },
select_line_manual_select_opts: function() {
return {
group_color: this.utils.colors.color_for("screen_step_todo"),
@@ -282,9 +285,10 @@ export var Checkout = Vue.component("checkout", {
},
events: {
select: "on_select",
+ go_back: "on_back",
},
on_back: () => {
- this.state_to("start");
+ this.state_to("init");
this.reset_notification();
},
on_select: selected => {
@@ -601,6 +605,9 @@ export var Checkout = Vue.component("checkout", {
display_info: {
title: "Confirm done",
},
+ events: {
+ go_back: "on_back",
+ },
on_confirm: () => {
this.wait_call(
this.odoo.call("done", {
diff --git a/shopfloor_mobile/static/wms/src/scenario/mixins.js b/shopfloor_mobile/static/wms/src/scenario/mixins.js
index ecd4689e25..1e4b938299 100644
--- a/shopfloor_mobile/static/wms/src/scenario/mixins.js
+++ b/shopfloor_mobile/static/wms/src/scenario/mixins.js
@@ -38,15 +38,15 @@ export var ScenarioBaseMixin = {
*/
this._state_load(this.$route.params.state);
},
- mounted: function() {
- const odoo_params = {
- process_menu_id: this.menu_item.id,
- profile_id: this.$root.profile.id,
- usage: this.usage,
- };
- this.odoo = this.$root.getOdoo(odoo_params);
- },
computed: {
+ odoo: function() {
+ const odoo_params = {
+ process_menu_id: this.menu_item.id,
+ profile_id: this.$root.profile.id,
+ usage: this.usage,
+ };
+ return this.$root.getOdoo(odoo_params);
+ },
menu_item: function() {
const self = this;
return _.head(
diff --git a/shopfloor_mobile/static/wms/src/services/color_registry.js b/shopfloor_mobile/static/wms/src/services/color_registry.js
index d7c2e1d184..e60624736d 100644
--- a/shopfloor_mobile/static/wms/src/services/color_registry.js
+++ b/shopfloor_mobile/static/wms/src/services/color_registry.js
@@ -13,7 +13,8 @@ color_registry.add_theme(
error: "#c22a4a",
info: "#5e60ab",
success: "#8fbf44",
- warning: "amber",
+ // warning: "#FFC107",
+ warning: "#e5ab00",
/**
* app specific
*/
@@ -28,8 +29,10 @@ color_registry.add_theme(
*/
btn_action: "primary lighten-2",
btn_action_cancel: "error",
- btn_action_warn: "amber",
+ btn_action_warn: "warning",
btn_action_complete: "success",
+ btn_action_todo: "screen_step_todo",
+ btn_action_back: "info lighten-1",
/**
* selection
*/
diff --git a/shopfloor_mobile/static/wms/src/utils.js b/shopfloor_mobile/static/wms/src/utils.js
index 617ef0ef80..f01b1da72d 100644
--- a/shopfloor_mobile/static/wms/src/utils.js
+++ b/shopfloor_mobile/static/wms/src/utils.js
@@ -79,13 +79,24 @@ export class Utils {
}),
"id"
);
- const grouped = _.groupBy(lines, "package_dest.id");
+ const grouped = _.groupBy(lines, function(l) {
+ const pack_id = _.result(l, "package_dest.id");
+ if (pack_id) {
+ return "pack-" + pack_id;
+ }
+ return "raw-" + l.id + l.product.id;
+ });
let counter = 0;
- _.forEach(grouped, function(products, pack_id) {
+ _.forEach(grouped, function(products, key) {
counter++;
- const pack = _.first(_.filter(packs, {id: parseInt(pack_id)}));
+ let pack = null;
+ if (key.startsWith("pack")) {
+ pack = _.first(
+ _.filter(packs, {id: parseInt(key.split("-").slice(-1)[0])})
+ );
+ }
res.push({
- key: pack ? pack_id : products[0].id + "-" + counter,
+ key: key + "--" + counter,
// No pack, just display the product name
title: pack ? pack.name : products[0].display_name,
pack: pack,