Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Defining Due Date rules

By
Luis Alberto Panozzo
on 12/16/14, 11:55 AM 624 views

Hello, everyone ...

Has anyone defined Payment Terms to generate "Due Dates" according to the following:

Current month + 30 days?

Current month + 45 days?

Current month + 60 days?

meaning "Mr Customer, your invoice will not become overdue until 30/45/60 days after the end of this month"

 

I have been able to generate current month plus next month which is quite similar to the first instance and also current month plus the next two months (more or less the last of the above) but this is not quite what Accounting needs. 

 

Or maybe you are aware of a module that takes care of these odd calculation methods.

 

Thank you in advance

Lp

1

zbik

--zbik--
5976
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 12/16/14, 12:09 PM

Luis, you override method compute() in class account_payment_term() in module account. You change steps next_date calculations in lines:

            if amt:
                next_date = (datetime.strptime(date_ref, '%Y-%m-%d') + relativedelta(days=line.days))
                if line.days2 < 0:
                    next_first_date = next_date + relativedelta(day=1,months=1) #Getting 1st of next month
                    next_date = next_first_date + relativedelta(days=line.days2)
                if line.days2 > 0:
                    next_date += relativedelta(day=line.days2, months=1)

 

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/16/14, 11:55 AM
Seen: 624 times
Last updated: 3/16/15, 8:10 AM