From 4dbaa116ee2b8f7986f17c7e12fb2afb8f86435d Mon Sep 17 00:00:00 2001 From: Antoine Perdaens Date: Mon, 19 May 2014 17:44:51 +0200 Subject: [PATCH] [FIX] account_analytic_analysis: recurring invoices Properly support yearly recurring invoices --- addons/account_analytic_analysis/account_analytic_analysis.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 6c71f940e8a..c43e978e590 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -746,8 +746,10 @@ class account_analytic_account(osv.osv): new_date = next_date+relativedelta(days=+interval) elif contract.recurring_rule_type == 'weekly': new_date = next_date+relativedelta(weeks=+interval) - else: + elif contract.recurring_rule_type == 'monthly': new_date = next_date+relativedelta(months=+interval) + else: + new_date = next_date+relativedelta(years=+interval) self.write(cr, uid, [contract.id], {'recurring_next_date': new_date.strftime('%Y-%m-%d')}, context=context) if automatic: cr.commit()