Odoo Help

0
2
Avatar

Atul Kumar jain

--Atul Kumar jain--
934
| 5 3 7
Indore, India
--Atul Kumar jain--

.

Atul Kumar jain
On 2/10/14, 2:47 AM

You can use like this here create the date

 'leave_from' : fields.date("Leave Date", required=True), 

 'leave_from' : fields.date("Leave Until", required=True),


def _date_cal(self, cr, uid, ):

     leave_taken = (leave_from-leave_from).days

no effect, still got error :(

Dion Martin
on 2/10/14, 4:12 AM
1
Pornima Mane
On 2/10/14, 3:04 AM
 i = leave_from
cnt = 0
 while (i <leave_until): if="" (="" i.weekday()="=" 5="" or="" i.weekday()="=" 6):="" cnt="cnt+0" else:="" cnt="cnt+1" i++="" leave_taken="cnt</pre">

i = leave_from cnt = 0 while (i <leave_until): if i.weekday()==5 or i.weekday()==6: cnt=cnt+0 else: cnt= cnt+1 i++ leave_taken =cnt

Pornima Mane
on 2/10/14, 3:15 AM
0
libu
On 2/11/14, 3:22 AM

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

def calc_maturity_amount(self,cr,uid,ids,context=None):

     num=self.read(cr,uid,ids,['maturity_date','deposit_date','deposit_amount','intr_rate'],context=context)
       dateformat="%Y-%m-%d"
     interst_rate=num[0]['intr_rate']

     d1=datetime.strptime(num[0]['maturity_date'],dateformat)
     d2=datetime.strptime(num[0]['deposit_date'],dateformat)
     v1=d1-d2
     total_days=v1.days

what 'deposit_amount' means??

Dion Martin
on 2/11/14, 10:33 PM

About This Community

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

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 2/10/14, 12:24 AM
Seen: 3886 times
Last updated: 3/16/15, 8:10 AM