mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] - Fix recurring_next_date
This commit is contained in:
@@ -107,7 +107,7 @@ class SaleOrderLine(models.Model):
|
|||||||
self.date_start or fields.Date.today(),
|
self.date_start or fields.Date.today(),
|
||||||
self.recurring_invoicing_type,
|
self.recurring_invoicing_type,
|
||||||
self.recurring_rule_type,
|
self.recurring_rule_type,
|
||||||
int(self.product_uom_qty),
|
1,
|
||||||
)
|
)
|
||||||
termination_notice_interval = (
|
termination_notice_interval = (
|
||||||
self.product_id.termination_notice_interval
|
self.product_id.termination_notice_interval
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class TestSaleOrder(TransactionCase):
|
|||||||
{
|
{
|
||||||
'is_contract': True,
|
'is_contract': True,
|
||||||
'default_qty': 12,
|
'default_qty': 12,
|
||||||
|
'recurring_rule_type': "monthlylastday",
|
||||||
'contract_template_id': self.contract_template1.id,
|
'contract_template_id': self.contract_template1.id,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -103,6 +104,10 @@ class TestSaleOrder(TransactionCase):
|
|||||||
self.order_line1.contract_id.contract_template_id,
|
self.order_line1.contract_id.contract_template_id,
|
||||||
self.contract_template1,
|
self.contract_template1,
|
||||||
)
|
)
|
||||||
|
contract_line = self.order_line1.contract_id.recurring_invoice_line_ids
|
||||||
|
self.assertEqual(contract_line.date_start, Date.to_date('2018-01-01'))
|
||||||
|
self.assertEqual(contract_line.date_end, Date.to_date('2018-12-31'))
|
||||||
|
self.assertEqual(contract_line.recurring_next_date, Date.to_date('2018-01-31'))
|
||||||
|
|
||||||
def test_sale_contract_count(self):
|
def test_sale_contract_count(self):
|
||||||
"""It should count contracts as many different contract template used
|
"""It should count contracts as many different contract template used
|
||||||
|
|||||||
Reference in New Issue
Block a user