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:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
5991
มุมมอง
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
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ
In the present_days inside method change cu into cr