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 all i have inherit field 'end_date' : fields.date in object sale.order. And i have set product with internal category 'Umum'.
in sale order line i want if product_id.categ_id = Umum , field end date onchange plus (+)2 days.
If annyone can help me with example code. i would be very grateful. Thanks before
simply import the timedelta like below:
from datetime import timedelta, datetime
Then you can assign like below:
date_today = fields.Date.today()
date_object = datetime.strptime(date_today, '%Y-%m-%d')
v_date = date_object + timedelta(days=15)
Where 15 is the number of days to be added.!
I hope it may help you.
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: 11/1/16, 4:07 AM|
|Seen: 309 times|
|Last updated: 11/11/16, 7:00 AM|