Skip to Content
Menu
This question has been flagged
5005 Rodiniai

Hello everybody,

I add a method in hr.payslip:

_number_of_months(self, cr, uid, ids, date_from, date_to, context=None):

     date1 = datetime.strptime(self.browse(cr, uid, ids, context=context).date_from, '%Y-%m-%d')

    date2 = datetime.strptime(self.browse(cr, uid, ids, context=context).date_to, '%Y-%m-%d')

    p= (date2.year - date1.year) * 12 + (date2.month - date1.month)

    return p

i call this function in salary rule like this:

result = payslip._number_of_months(payslip.date_from, payslip.date_to)

but this not work

Please some helps


Thank you

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
kov. 24
2004
0
kov. 24
1539
2
vas. 24
2093
0
gruod. 23
1422
0
geg. 23
1965