Skip to content

Commit

Permalink
Merge PR #299 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Dec 22, 2023
2 parents dfb10dc + f974d6f commit 36d50e7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions account_invoice_report_grouped_by_picking/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def _process_section_note_lines_grouped(
if previous_note and key_note not in lines_dic:
lines_dic[key_note] = 0.0

def _get_grouped_by_picking_sorted_lines(self):
return self.invoice_line_ids.sorted(
lambda ln: (-ln.sequence, ln.date, ln.move_name, -ln.id), reverse=True
)

def lines_grouped_by_picking(self):
"""This prepares a data structure for printing the invoice report
grouped by pickings."""
Expand All @@ -69,9 +74,8 @@ def lines_grouped_by_picking(self):
so_dict = {x.sale_id: x for x in self.picking_ids if x.sale_id}
# Now group by picking by direct link or via same SO as picking's one
previous_section = previous_note = False
for line in self.invoice_line_ids.sorted(
lambda ln: (-ln.sequence, ln.date, ln.move_name, -ln.id), reverse=True
):
sorted_lines = self._get_grouped_by_picking_sorted_lines()
for line in sorted_lines:
if line.display_type == "line_section":
previous_section = line
continue
Expand Down

0 comments on commit 36d50e7

Please sign in to comment.