Skip to content

Commit

Permalink
fix wizard amount residual not computed
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu.saison committed Nov 19, 2024
1 parent 92f3b49 commit e04a713
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion account_invoice_overdue_reminder/data/mail_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<th style="padding: 5px; border: 1px solid black;">Residual</th>
<th style="padding: 5px; border: 1px solid black;">Past Reminders</th>
</tr>
% for inv in object.invoice_ids.sorted(key='invoice_date'):
% for inv in object.get_invoices().sorted(key='invoice_date'):
<tr style="background-color:
% if inv.move_type == 'out_refund':
LightGray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ class OverdueReminderStep(models.TransientModel):
def _reminder_type_selection(self):
return self.env["overdue.reminder.action"]._reminder_type_selection()

# fix bug:
# get_invoices() has to be use in mail template
# bug: In the wizard after delete an invoice to remind.
# The residuals values are set to 0 in the generated mail.
def get_invoices(self):
return self.env['account.move'].browse(self.invoice_ids.ids)

Check warning on line 393 in account_invoice_overdue_reminder/wizard/overdue_reminder_wizard.py

View check run for this annotation

Codecov / codecov/patch

account_invoice_overdue_reminder/wizard/overdue_reminder_wizard.py#L393

Added line #L393 was not covered by tests

@api.depends("invoice_ids", "user_id", "partner_id")
def _compute_counter_and_mail(self):
xmlid = self._get_overdue_invoice_reminder_template()
Expand Down

0 comments on commit e04a713

Please sign in to comment.