Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
hi i want to addition in date in odoo directives in odoov8
in reports i print invoice date using
now i want to add days in this date meansmy invoice date is 10/01/2015 and my pament term days is 15 so i want to add 15 days in date in report.xml file through qweb directives so output is 10/16/2015 (10/01/2015(mm/dd/yyyy) + 15days = 10/16/2015)
i get payment term days from this
<tr t-foreach="o.payment_term.line_ids" t-as="pl">
<td> <span t-field="pl.days"/> </td>
so how can i do addition in date in qweb directives
i have solved it with this line of codes. In my example i had adapted the report_saleorder.xml.
<span t-set="d_delta" t-value="datetime.timedelta(days=17)"/>
<span t-set="d_dateorder" t-value="datetime.datetime.strptime(doc.date_order,'%Y-%m-%d %H:%M:%S')"/>
<span t-set="d_paydate" t-value="d_dateorder + d_delta"/>
To use the datetime object you have to import the datetime object. --> from datetime import datetime, timedelta this i have added to sale_report.py.
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/12/15, 9:14 AM|
|Seen: 1915 times|
|Last updated: 10/13/15, 2:42 AM|