mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
@@ -91,6 +91,7 @@ class ContractRecurrencyMixin(models.AbstractModel):
|
||||
|
||||
@api.depends("next_period_date_start")
|
||||
def _compute_recurring_next_date(self):
|
||||
self.recurring_next_date = False
|
||||
for rec in self.filtered("next_period_date_start"):
|
||||
rec.recurring_next_date = self.get_next_invoice_date(
|
||||
rec.next_period_date_start,
|
||||
|
||||
@@ -2384,3 +2384,11 @@ class TestContract(TestContractBase):
|
||||
action = self.contract.action_preview()
|
||||
self.assertIn("/my/contracts/", action["url"])
|
||||
self.assertIn("access_token=", action["url"])
|
||||
|
||||
def test_contract_line_termination(self):
|
||||
"""Don't fail when the line receives an end date."""
|
||||
self.contract.recurring_create_invoice()
|
||||
self.acct_line.date_end = "2018-02-14"
|
||||
self.assertFalse(self.acct_line.recurring_next_date)
|
||||
# This doesn't give any error
|
||||
self.contract.recurring_create_invoice()
|
||||
|
||||
Reference in New Issue
Block a user