Skip to Content
Menu
This question has been flagged
2 Replies
1639 Views

I have created a model in that when i click create a form will be open i have 3 fields employee, date_start, date_end when i give all the details a computation will be done and i get 3 values based on hr.attendance records wit same employee and and the given date. It take all the attendance records from that it will calculate the total hours and total hours he inside the office(It is based on same day multiple check in and check out, total hours is difference between first check in and last check out)


Now the cache is every time i need to create a new record for this calculated fields, And what i need is a dynamic view similar to attendance report. How can i create that,

some tips or sample code will be better

NOTE: I have tried with hr.attendance.report code and in the last i got a error WRONGOBJECTTYPE

Thanks in advance


This is how i create the form view in this every time for each employee i need to select the employee and the date. But i need like the 

this how can i create this,

Avatar
Discard
Best Answer

HI, you can follow following tutorial for this:

https://youtu.be/kwkddYoFQCE

Hope it helps,

Thanks

Avatar
Discard
Best Answer

Hi,
Are you saying that the computed fields are not recomputing the value ? If yes, if it is a stored field, you have to check whether the proper field dependencies are added to do the re-computation.

Regarding the sql view, i believe you cannot directly inherit an existing view and create a new view(as per your prev post). Instead you can add new fields to existing view or create a new view.

Creating new view: Create Model/DB View Using Query In Odoo
Inherit and add new fields: How To Add New Field To Sale Report Model In Odoo

Thanks

Avatar
Discard
Author

No, the computation is perfect, what i want is,
In Attendance Analysis, worked hours field gather all the attendance record with the same employee on a give date range in the pivot or graph view...
Same like i need to create a view there i need to show all the computed fields without creating every time

you can add the field in the sql view and adjust the existing query to read data

Related Posts Replies Views Activity
3
Jul 25
1679
1
Jul 25
1124
1
Apr 25
1017
0
Jan 25
949
1
Dec 24
1378