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.
i have a code like
'leave_from' : fields.date("Cuti Dari Tanggal", required=True),
'leave_until' : fields.date("Cuti Sampai Dengan", required=True),
and 1 fields to accomodate them
'leave_taken' : fields.function(function_diambil_cuti, method=True, string='Cuti Diambil(hari)', type='float'),
and what i have to do to subtract the leave_until fields and leave_from fields to get the DAY without calculate saturday and sunday and fill the leave_taken fields with the result ?
Hi pls chk this code.....
maturity_date and deposit_date are two date fields from a same class .By this code u can easily calculate number of days between two dates try this
num=self.read(cr,uid,ids,['maturity_date','deposit_date','deposit_amount','intr_rate'],context=context) dateformat="%Y-%m-%d" interst_rate=num['intr_rate'] d1=datetime.strptime(num['maturity_date'],dateformat) d2=datetime.strptime(num['deposit_date'],dateformat) v1=d1-d2 total_days=v1.days
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 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: 2/10/14, 12:24 AM|
|Seen: 2496 times|
|Last updated: 3/16/15, 8:10 AM|