I'm getting this error when I try this :
att_obj = self.pool.get('hr.attendance')
att_id = att_obj.search(cr, uid, [('employee_id', '=', employee_id),('day', '=', time.strftime('%Y-%m-%d'))], limit=1, order='name desc')
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I'm getting this error when I try this :
att_obj = self.pool.get('hr.attendance')
att_id = att_obj.search(cr, uid, [('employee_id', '=', employee_id),('day', '=', time.strftime('%Y-%m-%d'))], limit=1, order='name desc')
Hi,
This message alert you that field day is not defined in model hr.attendance.
class hr_attendance(osv.osv):
_name = "hr.attendance" _description = "Attendance"
_columns = {
'name': fields.datetime('Date', required=True, select=1),
'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True),
'action_desc': fields.many2one("hr.action.reason", "Action Reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
'employee_id': fields.many2one('hr.employee', "Employee", required=True, select=True),
'worked_hours': fields.function(_worked_hours_compute, type='float', string='Worked Hours', store=True), }
So, try this instead:
att_obj = self.pool.get('hr.attendance')
att_id = att_obj.search(cr, uid, [('employee_id', '=', employee_id),('name', '=', time.strftime('%Y-%m-%d'))], limit=1, order='name desc')
Best regards
Thanks it works, I saw the field day in the model hr.attendance in Configuration->Database Structure -> Models
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
sie 15
|
7307 | ||
|
0
mar 15
|
2927 | ||
|
1
mar 15
|
5585 | ||
|
0
mar 15
|
4195 | ||
|
0
paź 23
|
1417 |