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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
6001
Lượt xem
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký
In the present_days inside method change cu into cr