Contract - recurring invoice not working if YEARS is selected

Bug #1274986 reported by Daniel Dico (oerp.ca)
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Hello,

Re: trunk (9089) and saas-2(9111)

If you setup a contract with recurring invoices and select to repeat on a yearly basis it will not work. Will repeat monthly instead or yearly. Looking at code we observe that "yearly" option in recurring_rule_type is not handled.

            if contract.recurring_rule_type == 'daily':
                new_date = next_date+relativedelta(days=+interval)
            elif contract.recurring_rule_type == 'weekly':
                new_date = next_date+relativedelta(weeks=+interval)
            else:
                new_date = next_date+relativedelta(months=+interval)

I suggest this change:

+++ account_analytic_analysis/account_analytic_analysis.py 2014-01-31 15:49:05 +0000
@@ -721,8 +721,10 @@
                 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)
+ elif contract.recurring_rule_type == 'yearly':
+ new_date = next_date+relativedelta(years=+interval)
             self.write(cr, uid, [contract.id], {'recurring_next_date': new_date.strftime('%Y-%m-%d')}, context=context)
         return True

Please let me know if you need more information

Thank you

Revision history for this message
Daniel Dico (oerp.ca) (oerp) wrote :
Revision history for this message
Daniel Dico (oerp.ca) (oerp) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.