Skip to content

Commit

Permalink
shopfloor: display picking partner note in cluster picking scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr committed Feb 26, 2024
1 parent 0cf2318 commit e66e9b1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions shopfloor/actions/data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields

from odoo.addons.component.core import Component
Expand Down
9 changes: 0 additions & 9 deletions shopfloor/services/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,13 @@ def _response_for_select_package(self, picking, lines, message=None):
data={
"selected_move_lines": self._data_for_move_lines(lines.sorted()),
"picking": self.data.picking(picking),
"packing_info": self._data_for_packing_info(picking),
"no_package_enabled": not self.options.get(
"checkout__disable_no_package"
),
},
message=message,
)

def _data_for_packing_info(self, picking):
"""Return the packing information
Intended to be extended.
"""
# TODO: This could be avoided if included in the picking parser.
return ""

def _response_for_select_dest_package(self, picking, move_lines, message=None):
packages = picking.mapped("move_line_ids.result_package_id").filtered(
"packaging_id"
Expand Down
5 changes: 4 additions & 1 deletion shopfloor/services/cluster_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,10 @@ def _states(self):
"""
return {
"confirm_start": self._schema_for_batch_details,
"start_line": self._schema_for_single_line_details,
"start_line": dict(
self._schema_for_single_line_details,
packing_info={"type": "string", "nullable": True},
),
"start": {},
"manual_selection": self._schema_for_batch_selection,
"scan_destination": self._schema_for_scan_destination,
Expand Down
2 changes: 1 addition & 1 deletion shopfloor/tests/test_checkout_list_delivery_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_list_delivery_packaging_not_available(self):
"selected_move_lines": [
self._move_line_data(ml) for ml in selected_lines.sorted()
],
"packing_info": self.service._data_for_packing_info(self.picking),
"packing_info": self.service.data.packing_info(self.picking),
"no_package_enabled": not self.service.options.get(
"checkout__disable_no_package"
),
Expand Down
2 changes: 1 addition & 1 deletion shopfloor/tests/test_checkout_scan_package_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_scan_package_action_scan_package_keep_source_package_error(self):
data={
"picking": self.data.picking(picking),
"selected_move_lines": self.data.move_lines(selected_lines),
"packing_info": self.service._data_for_packing_info(picking),
"packing_info": self.service.data.packing_info(picking),
"no_package_enabled": not self.service.options.get(
"checkout__disable_no_package"
),
Expand Down
4 changes: 2 additions & 2 deletions shopfloor_mobile/static/wms/src/scenario/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ const Checkout = {
</div>
<div v-if="state_is('select_package')">
<v-alert type="info" tile v-if="state.data.packing_info" class="packing-info">
<p v-text="state.data.packing_info" />
<v-alert type="info" tile v-if="state.data.picking.note" class="packing-info">
<p v-text="state.data.picking.note" />
</v-alert>
<item-detail-card
v-if="state.data.picking.carrier"
Expand Down
3 changes: 3 additions & 0 deletions shopfloor_mobile/static/wms/src/scenario/cluster_picking.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const ClusterPicking = {
v-on:confirm="state.on_confirm"
v-on:cancel="state.on_cancel"
/>
<v-alert type="info" tile v-if="state_is('start_line') && state.data.picking.note" class="packing-info">
<p v-text="state.data.picking.note" />
</v-alert>
<batch-picking-line-detail
v-if="state_in(['start_line', 'scan_destination', 'change_pack_lot', 'stock_issue'])"
:line="state.data"
Expand Down

0 comments on commit e66e9b1

Please sign in to comment.