diff --git a/argocd_sale/models/subscription.py b/argocd_sale/models/subscription.py index bca19d1..f4b1fc2 100644 --- a/argocd_sale/models/subscription.py +++ b/argocd_sale/models/subscription.py @@ -68,6 +68,7 @@ def _invoice_paid_hook(self): free_period = subscription._get_free_period() if free_period: subscription.recurring_next_date = fields.Datetime.today() + free_period + subscription.action_start_subscription() lines = subscription.sale_subscription_line_ids.filtered( lambda l: l.product_id.application_template_id ) diff --git a/argocd_sale/tests/test_grace_period.py b/argocd_sale/tests/test_grace_period.py index bb97e76..d470cd8 100644 --- a/argocd_sale/tests/test_grace_period.py +++ b/argocd_sale/tests/test_grace_period.py @@ -28,6 +28,9 @@ def setUpClass(cls): cls.env["ir.config_parameter"].set_param( "argocd_sale.grace_period_tag_id", cls.disable_odoo_tag.id ) + cls.env["ir.config_parameter"].set_param( + "argocd_sale.subscription_free_period_type", "" # Disable free period + ) def _create_and_prepare_sub(self, last_date_invoiced, create_invoice=True): sub = self.env["sale.subscription"].create(