[FIX] - include date_end in the period if the product is_autorenew

This commit is contained in:
sbejaoui
2018-11-30 17:16:55 +01:00
committed by Abraham Anes
parent f13cc3d484
commit dc4d94591a
2 changed files with 11 additions and 6 deletions

View File

@@ -79,6 +79,7 @@ class SaleOrderLine(models.Model):
rec.product_id.auto_renew_rule_type,
rec.product_id.auto_renew_interval,
)
- relativedelta(days=1)
)
@api.onchange('date_start')
@@ -88,11 +89,15 @@ class SaleOrderLine(models.Model):
if not rec.date_start:
rec.date_end = False
else:
rec.date_end = rec.date_start + self.env[
'account.analytic.invoice.line'
].get_relative_delta(
rec.product_id.auto_renew_rule_type,
rec.product_id.auto_renew_interval,
rec.date_end = (
rec.date_start
+ self.env[
'account.analytic.invoice.line'
].get_relative_delta(
rec.product_id.auto_renew_rule_type,
rec.product_id.auto_renew_interval,
)
- relativedelta(days=1)
)
@api.multi