Skip to content

Commit

Permalink
shopfloor: display pickings by priority in checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr committed Nov 22, 2023
1 parent c0c7c48 commit 178558b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion shopfloor/actions/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def picking(self, record, **kw):
# and it may reduce performance significatively
# when dealing with a large number of pickings.
# Thus, we make it optional.
if "with_progress" in kw:
if kw.get("with_progress"):
parser.append("progress")
return self._jsonify(record, parser, **kw)

Expand All @@ -56,6 +56,7 @@ def _picking_parser(self, **kw):
"bulk_line_count",
"total_weight:weight",
"scheduled_date",
"priority",
]

@ensure_model("stock.quant.package")
Expand Down
1 change: 1 addition & 0 deletions shopfloor/actions/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def picking(self):
"ship_carrier": self._schema_dict_of(self._simple_record(), required=False),
"scheduled_date": {"type": "string", "nullable": False, "required": True},
"progress": {"type": "float", "nullable": True},
"priority": {"type": "string", "nullable": True, "required": False},
}

def move_line(self, with_packaging=False, with_picking=False):
Expand Down
2 changes: 1 addition & 1 deletion shopfloor/services/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _domain_for_list_stock_picking(self):
]

def _order_for_list_stock_picking(self):
return "scheduled_date asc, id asc"
return "priority desc, scheduled_date asc, id asc"

def list_stock_picking(self):
"""List stock.picking records available
Expand Down
2 changes: 2 additions & 0 deletions shopfloor/tests/test_actions_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def test_data_picking(self):
"partner": {"id": self.customer.id, "name": self.customer.name},
"carrier": {"id": carrier.id, "name": carrier.name},
"ship_carrier": None,
"priority": "0",
}
self.assertEqual(data.pop("scheduled_date").split("T")[0], "2020-08-03")
self.assertDictEqual(data, expected)
Expand All @@ -139,6 +140,7 @@ def test_data_picking_with_progress(self):
"carrier": {"id": carrier.id, "name": carrier.name},
"ship_carrier": None,
"progress": 0.0,
"priority": "0",
}
self.assertEqual(data.pop("scheduled_date").split("T")[0], "2020-08-03")
self.assertDictEqual(data, expected)
Expand Down
1 change: 1 addition & 0 deletions shopfloor_mobile/static/wms/src/scenario/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ const Checkout = {
{path: "origin"},
{path: "carrier.name", label: "Carrier"},
{path: "move_line_count", label: "Lines"},
{path: "priority", label: "Priority"},
],
},
};
Expand Down

0 comments on commit 178558b

Please sign in to comment.