def prasent_days(self, cr, uid, ids, field_names, args, context=None):
res={}
user_att = self.pool.get("hr.attendance")
for slip in self.browse(cu, uid, ids, context=None):
temp = 0
att_ids = user_att.search(cu, uid, [('employee_id','=',slip.employee_id.id)])
for count in user_att.browse(cu, uid, att_ids, context=None):
if count.name >= slip.date_from and count.name <= slip.date_to: #This is not a good condition
temp = temp + 1.0
res[id]=temp
return res
_columns = {
'es_present':fields.function(prasent_days, "No.of Present Days"),
esteem_payslip()
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
1
Beantwoorden
5986
Weergaven
Hi
def prasent_days(self, cr, uid, ids, field_names, args, context=None):
res={}
user_att = self.pool.get("hr.attendance")
for slip in self.browse(cr, uid, ids, context=None):
temp = 0
att_ids = user_att.search(cr, uid, [('employee_id','=',slip.employee_id.id)])
for count in user_att.browse(cr, uid, att_ids, context=None):
if count.name >= slip.date_from and count.name <= slip.date_to: #This is not a good condition
temp = temp + 1.0
res[id]=temp
return res
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden
In the present_days inside method change cu into cr