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
- Бухгалтерия
- Склад
- PoS
- Project
- MRP
Этот вопрос был отмечен
1
Ответить
5994
Представления
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Регистрация
In the present_days inside method change cu into cr