[REF] contract: rename misnamed methods

This commit is contained in:
Stéphane Bidoul (ACSONE)
2019-12-06 09:19:18 +01:00
committed by Francisco Ivan Anton Prieto
parent c3c0ffaac1
commit 87babeba9f
2 changed files with 9 additions and 9 deletions

View File

@@ -356,7 +356,7 @@ class ContractLine(models.Model):
)
@api.model
def _compute_first_recurring_next_date(
def _get_recurring_next_date(
self,
date_start,
recurring_invoicing_type,
@@ -374,7 +374,7 @@ class ContractLine(models.Model):
)
@api.model
def compute_first_date_end(
def _get_first_date_end(
self, date_start, auto_renew_rule_type, auto_renew_interval
):
return (
@@ -396,7 +396,7 @@ class ContractLine(models.Model):
auto_renew"""
for rec in self.filtered('is_auto_renew'):
if rec.date_start:
rec.date_end = self.compute_first_date_end(
rec.date_end = self._get_first_date_end(
rec.date_start,
rec.auto_renew_rule_type,
rec.auto_renew_interval,
@@ -410,7 +410,7 @@ class ContractLine(models.Model):
)
def _onchange_date_start(self):
for rec in self.filtered('date_start'):
rec.recurring_next_date = self._compute_first_recurring_next_date(
rec.recurring_next_date = self._get_recurring_next_date(
rec.date_start,
rec.recurring_invoicing_type,
rec.recurring_rule_type,
@@ -651,7 +651,7 @@ class ContractLine(models.Model):
)
)
new_date_start = rec.date_start + delay_delta
rec.recurring_next_date = self._compute_first_recurring_next_date(
rec.recurring_next_date = self._get_recurring_next_date(
new_date_start,
rec.recurring_invoicing_type,
rec.recurring_rule_type,
@@ -712,7 +712,7 @@ class ContractLine(models.Model):
):
self.ensure_one()
if not recurring_next_date:
recurring_next_date = self._compute_first_recurring_next_date(
recurring_next_date = self._get_recurring_next_date(
date_start,
self.recurring_invoicing_type,
self.recurring_rule_type,
@@ -1023,7 +1023,7 @@ class ContractLine(models.Model):
def _get_renewal_dates(self):
self.ensure_one()
date_start = self.date_end + relativedelta(days=1)
date_end = self.compute_first_date_end(
date_end = self._get_first_date_end(
date_start, self.auto_renew_rule_type, self.auto_renew_interval
)
return date_start, date_end

View File

@@ -537,7 +537,7 @@ class TestContract(TestContractBase):
'There was an error and the view couldn\'t be opened.',
)
def test_compute_first_recurring_next_date(self):
def test_get_recurring_next_date(self):
"""Test different combination to compute recurring_next_date
Combination format
{
@@ -606,7 +606,7 @@ class TestContract(TestContractBase):
for recurring_next_date, combination in combinations:
self.assertEqual(
recurring_next_date,
contract_line_env._compute_first_recurring_next_date(
contract_line_env._get_recurring_next_date(
*combination
),
error_message(*combination),