i created a form for termination of an employee i have the join date and end date of the employee.. what i want is how many days this employee had worked between these two dates ie: number of working days between two dates
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ờ
Hello faizan,
Hope you are doing well.
You can calculate working days using the compute method
write you code like this.
from datetime import date
employee_join_date = fields.Datetime(string='Employee Start Date')
employee_end_date = fields.Datetime(string='Employee End Date')
workdays = fields.Integer(string='Employee Working Days',compute='compute_calculate_workday')
@api.depends('employee_end_date','employee_end_date')
def compute_calculate_workday(self):
for rec in self:
rec.workdays = (rec.employee_join_date - rec.employee_end_date).days
I Hope this information proves helpful to you.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
hope you find out the anwser
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ýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 5 25
|
1237 | ||
|
1
thg 3 25
|
1278 | ||
|
0
thg 2 25
|
1514 | ||
|
1
thg 12 24
|
1915 | ||
|
0
thg 11 24
|
108 |