Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
5395 มุมมอง

When an employee creates a timesheet, is it possible to force him to create a timesheet only once a week or once a month ?

Odoo 10

อวตาร
ละทิ้ง
ผู้เขียน

Ermin : Which Odoo version are you using ? I don't even see those tabs on Odoo 10.

My screenshot is from Odoo 9.0 CE. I can't find it actually on 10.0 CE either...

ผู้เขียน

Okey, thank you for your help

ผู้เขียน คำตอบที่ดีที่สุด

Hi,

I'm looking for employee to make a timesheet only once a month. I don't see which function to override or to modify.

Edit :

I resolved my problem in 2 steps :

- I modified the _default_date_from(self) and the _default_date_to(self) functions in hr_timesheet_sheet.py

  => By default, the timesheet period starts the 1st and ends the last day of the month

- I modified the create code to validate the creation like Niyas said ( with vals['date_from'] and vals['date_to'])   )

=> The employee can't start his timesheet the 2nd and ends it the 20th

Thank you for your help !

อวตาร
ละทิ้ง

Hi,

class TimeSheet(models.Model):

_inherit = 'account.analytic.line'

@api.model

def create(self, vals):

#here you can validate the creation

res = super(TimeSheet, self).create(vals)

return res

Hi , i just updated my answer just go through it

คำตอบที่ดีที่สุด

in the company configuration settings you can also specify the timesheet period for the company.

See:

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Oul,

Are you looking for employee to make/limit the timesheet once in a month or once in a weak ? If so you can override the create function and can add the proper validation to check it.

class TimeSheet(models.Model):
_inherit = 'account.analytic.line'

@api.model
def create(self, vals):
#here you can validate the creation
res = super(TimeSheet, self).create(vals)
return res
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 23
2549
0
ก.พ. 23
1649
0
พ.ค. 25
1175
1
เม.ย. 25
1282
1
ก.พ. 24
3088