[FIX] product_contract: Remove unnecessary methods

This commit is contained in:
sergio-teruel
2025-01-28 10:43:22 +01:00
parent 76d8c2f472
commit 6629826f92
2 changed files with 2 additions and 16 deletions

View File

@@ -149,7 +149,7 @@ class SaleOrderLine(models.Model):
if sol.is_auto_renew and sol.date_start:
sol.date_end = self.env["contract.line"]._get_first_date_end(
sol.date_start,
sol._get_auto_renew_rule_type(),
sol.auto_renew_rule_type,
sol.auto_renew_interval,
)
else:
@@ -161,13 +161,6 @@ class SaleOrderLine(models.Model):
recurring_rule_type, interval
)
def _get_auto_renew_rule_type(self):
"""monthly last day don't make sense for auto_renew_rule_type"""
self.ensure_one()
if self.auto_renew_rule_type == "monthlylastday":
return "monthly"
return self.auto_renew_rule_type
@api.depends("product_id")
def _compute_auto_renew(self):
for rec in self.filtered("product_id.is_contract"):

View File

@@ -93,12 +93,5 @@ class ProductContractConfigurator(models.TransientModel):
self.update({"date_end": False})
for rec in self.filtered(lambda ln: ln.is_auto_renew and ln.date_start):
rec.date_end = self.env["contract.line"]._get_first_date_end(
rec.date_start, rec._get_auto_renew_rule_type(), rec.auto_renew_interval
rec.date_start, rec.auto_renew_rule_type, rec.auto_renew_interval
)
def _get_auto_renew_rule_type(self):
"""monthly last day don't make sense for auto_renew_rule_type"""
self.ensure_one()
if self.auto_renew_rule_type == "monthlylastday":
return "monthly"
return self.auto_renew_rule_type