Skip to content

Commit

Permalink
shopfloor_mobile: use stars to display picking priority
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr committed Nov 17, 2023
1 parent 8494871 commit 4a327d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion shopfloor_mobile/static/wms/src/scenario/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,17 @@ const Checkout = {
{path: "origin"},
{path: "carrier.name", label: "Carrier"},
{path: "move_line_count", label: "Lines"},
{path: "priority", label: "Priority"},
{
path: "priority",
render_component: "priority-widget",
render_options: function (record) {
const priority = parseInt(record.priority);
// We need to pass the label to the component as an option instead of using "display_no_value"
// because pickings with no priority will still have a string value of "0"
// and the label would always be displayed.
return { priority, label: priority ? "Priority: " : null};
},
},
],
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export var PriorityWidget = Vue.component("priority-widget", {
},
template: `
<div :class="[$options._componentTag, opts.mode ? 'mode-' + opts.mode: '', 'd-inline']">
<span v-if="opts.label">{{ opts.label }}</span>
<span v-for="n in _.range(1, opts.priority + 1)" v-if="opts.priority" :class="['priority-' + n]">
<v-icon color="amber accent-2">mdi-star</v-icon>
</span>
Expand Down

0 comments on commit 4a327d0

Please sign in to comment.