Skip to content

Commit

Permalink
Merge PR #304 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by petrus-v
  • Loading branch information
OCA-git-bot committed Sep 29, 2024
2 parents 22b5101 + 802eba2 commit 1473cc8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions account_move_cutoff/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def button_draft(self):
self.cutoff_entry_ids.with_context(force_delete=True).unlink()
return res

def action_post(self):
result = super().action_post()
def _post(self, *args, **kwargs):
result = super()._post(*args, **kwargs)
for move, lines in self._get_deferrable_lines():
move._create_cutoff_entries(lines)

Expand Down
12 changes: 12 additions & 0 deletions account_move_cutoff/tests/test_account_invoice_cutoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,3 +538,15 @@ def test_account_invoice_cutoff_monthly_factor_prorata(self):
255.0,
2,
)

def test_reverse_moves_reverse_deffered(self):

with freeze_time("2023-01-15"):
self.invoice.action_post()
self.assertTrue(len(self.invoice.cutoff_entry_ids) > 0)
refund = self.invoice._reverse_moves(cancel=True)

self.assertEqual(refund.state, "posted")
self.assertEqual(
len(self.invoice.cutoff_entry_ids), len(refund.cutoff_entry_ids)
)

0 comments on commit 1473cc8

Please sign in to comment.