This question has been flagged

Cheers!

I was asked to change the behaviour of the "hr_timesheet_sheet.WeeklyTimesheet" template (the grid you see when you go to Human Resources/Time Tracking/My Current Timesheet).

I tested my changes directly in the original template and things worked like a charm. However, when I create my own module, I can't seem to be able to get things working. I do see CSS changes but the template remains the same.

What I need is to change this line...

<td t-att-class="'oe_timesheet_weekly_date_head' + (Date.compare(date, Date.today()) === 0 ? ' oe_timesheet_weekly_today' : '')">

and replace it by...

<th t-att-class="'oe_timesheet_weekly_date_head' + ((date.toString('ddd') === 'Sat') || (date.toString('ddd') === 'Sun')  ? ' oe_timesheet_weekly_today' : '')">

... so that weekend days become higlighted.

I'm loading the CSS as well as the XML file in the __openerp__.py but I don't know the exact syntax for the XML code. Declaring the whole form won't work.

Thanks ;)

Avatar
Discard

CAN you Send me a link to test your module i Will give you thé correct Way to do this

Sorry, it's not even online

Can you post here some __openerp__.py content and your code that change original behaviour ?