[FIX] delivery: add barcode app check into package wizard

Because the barcode app bypasses the detailed operations for receipts
(with default settings set), an error was being thrown when doing "put
in pack" when a carrier is set (saving during the delivery package
wizard) because the picking move lines are incorrectly selected. This
commit adds in a check for when the wizard is accessed via the barcode
app so that the error does not occur and the same behavior as when no
carrier is assigned is followed.

Related Enterprise PR: odoo/enterprise#9808

closes odoo/odoo#59792

Task: 2039720
X-original-commit: 945b5f6791ae890498ef9a34828eaf91dc1457e2
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit is contained in:
Tiffany Chang (tic)
2020-10-12 16:17:20 +00:00
parent 348a5c8467
commit 11c710d990
@@ -48,7 +48,7 @@ class ChooseDeliveryPackage(models.TransientModel):
def action_put_in_pack(self):
picking_move_lines = self.picking_id.move_line_ids
if not self.picking_id.picking_type_id.show_reserved:
if not self.picking_id.picking_type_id.show_reserved and not self.env.context.get('barcode_view'):
picking_move_lines = self.picking_id.move_line_nosuggest_ids
move_line_ids = picking_move_lines.filtered(lambda ml: