Odoo Help

Welcome!

This community 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.

0

How to override a qweb template

By
Odooveloper (by Rui Franco)
on 7/5/13, 6:48 AM 1,812 views

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 ;)

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

Tuxservices, Jeudy Nicolas
on 7/7/13, 6:40 PM

Sorry, it's not even online

sdsdsd
on 7/8/13, 4:40 AM

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

Tuxservices, Jeudy Nicolas
on 7/8/13, 4:59 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 7/5/13, 6:48 AM
Seen: 1812 times
Last updated: 3/16/15, 8:10 AM