[FIX] hr_timesheet_sheet : date_from and date_to problem, hr_evaluation : date deadline problem fixed

bzr revid: vir@tinyerp.com-20101020132948-1ax61wd33j1ejj18
This commit is contained in:
Vir (Open ERP) 2010-10-20 18:59:48 +05:30
parent 9475077629
commit c7d50354fb
3 changed files with 5 additions and 4 deletions

View File

@ -124,7 +124,7 @@ class hr_employee(osv.osv):
flag = False
evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0]
if not evaluation_date:
evaluation_date=(parser.parse(datetime.date.today().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
evaluation_date=(parser.parse(datetime.now().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d')
flag = True
else:
if (parser.parse(evaluation_date) + relativedelta(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):

View File

@ -319,7 +319,7 @@ class hr_timesheet_sheet(osv.osv):
if r=='month':
return time.strftime('%Y-%m-01')
elif r=='week':
return (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')
return (datetime.today() + relativedelta(weekday=0, weeks=-1)).strftime('%Y-%m-%d')
elif r=='year':
return time.strftime('%Y-01-01')
return time.strftime('%Y-%m-%d')

View File

@ -10,11 +10,12 @@
<field eval="time.strftime('%Y-%m-%d', time.localtime(time.mktime(time.localtime()[0:2] + (0,)*7)-1))" name="date_to"/>
</record>
<!-- record id="sheet1" model="hr_timesheet_sheet.sheet">
<record id="sheet1" model="hr_timesheet_sheet.sheet">
<field name="name">Sheet 1</field>
<field name="user_id" ref="base.user_root"/>
<field name="employee_id" ref="hr.employee1" />
<field eval="time.strftime('%Y-%m-%d')" name="date_current"/>
</record-->
</record>
</data>
</openerp>