Skip to content
Open
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
8 changes: 7 additions & 1 deletion contract_refund_on_stop/models/contract_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def stop(self, date_end, manual_renew_needed=False, post_message=True):
or rec.last_date_invoiced <= date_end
):
continue
rec._create_refund_on_stop(
rec.with_context(refund_on_stop=True)._create_refund_on_stop(
to_refund_start_date=date_end,
to_refund_end_date=rec.last_date_invoiced,
)
Expand Down Expand Up @@ -116,3 +116,9 @@ def _get_refund_on_stop_quantity(self, to_refund_start_date, to_refund_end_date)
)
to_refund_start_date = next_period_date_end + relativedelta(days=1)
return quantity

def _insert_markers(self, first_date_invoiced, last_date_invoiced):
self.ensure_one()
if self.env.context.get("refund_on_stop"):
return _("Refund of %s", self.name)
return super()._insert_markers(first_date_invoiced, last_date_invoiced)
Loading