[IMP] contract: Add followers to invoices created

This commit is contained in:
Víctor Martínez
2020-11-30 10:23:08 +01:00
parent 9aea2b2c5e
commit e093a51bbc
5 changed files with 44 additions and 4 deletions

View File

@@ -201,6 +201,21 @@ class TestContract(TestContractBase):
)
self.assertEqual(self.acct_line.last_date_invoiced, last_date_invoiced)
def test_contract_invoice_followers(self):
self.acct_line.recurring_next_date = '2018-02-23'
self.acct_line.recurring_rule_type = 'daily'
self.contract.pricelist_id = False
self.contract.message_subscribe(
partner_ids=self.contract.partner_id.ids,
subtype_ids=self.env.ref(
'contract.mail_message_subtype_invoice_created'
).ids
)
self.contract.recurring_create_invoice()
invoice_daily = self.contract._get_related_invoices()
self.assertTrue(invoice_daily)
self.assertEqual(len(invoice_daily.message_partner_ids.ids), 2)
def test_contract_weekly_post_paid(self):
recurring_next_date = to_date('2018-03-01')
last_date_invoiced = to_date('2018-02-21')