Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] account_invoice_report_grouped_by_picking: Recover code missed between versions #334

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions account_invoice_report_grouped_by_picking/models/account_move.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017 Tecnativa - Carlos Dauden
# Copyright 2017-2023 Tecnativa - Carlos Dauden
# Copyright 2018 Tecnativa - David Vidal
# Copyright 2018-2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
Expand Down Expand Up @@ -140,7 +140,13 @@ def lines_grouped_by_picking(self):
remaining_qty -= qty
# To avoid to print duplicate lines because the invoice is a refund
# without returned goods to refund.
if self.move_type == "out_refund" and not has_returned_qty and picking_dict:
if (
self.move_type == "out_refund"
and not has_returned_qty
and picking_dict
and remaining_qty
and line.product_id.type != "service"
):
remaining_qty = 0.0
for key in picking_dict:
picking_dict[key] = abs(picking_dict[key])
Expand Down
Loading