Odoo Help

0

How to change the timesheet template

By
Rui Franco
on 10/27/15, 11:05 AM 848 views

I want to change the template of timesheets.


Where we find (hr_timesheet_sheet/static/src/xml/timesheet.xml)

<th t-att-class="'oe_timesheet_weekly_date_head' + (moment().format('DD-MM-YYYY') === moment(date).format('DD-MM-YYYY') ? ' oe_timesheet_weekly_today' : '')">

I want to put

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


But I can't get Odoo to show any change I make. So... does anyone have a working example of a template being changed?

I find too many people giving their 2 cents without actually seing things working. I've tried the "inherit_id" in the templates tag, I've tried the same in other places, I'ves tried with no inherit_id and I'm desperate!!! :)

 


0
Axel Mendoza
On 10/28/15, 8:18 AM

You could do it like:

<t t-extend="hr_timesheet_sheet.WeeklyTimesheet">
<t t-jquery="t:first" t-operation="replace">
        <t t-foreach="widget.dates" t-as="date">
     <th t-att-class="'oe_timesheet_weekly_date_head' + ((date.toString('ddd') === 'Sat') || (date.toString('ddd') === 'Sun') || (Date.compare(date, Date.today()) === 0) ? ' oe_timesheet_weekly_today' : '')">
<t t-esc="date.toString('ddd')"/><br />
<t t-esc="date.toString('MMM d')"/>
</th>
</t> 
</t>
</t>

Hope this help you to solve your problem

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 10/27/15, 11:05 AM
Seen: 848 times
Last updated: 10/28/15, 9:26 AM