var _t = instance.web._t;
instance.hr_timesheet_sheet.WeeklyTimesheet = instance.web.form.FormWidget.extend(instance.web.form.ReinitializeWidgetMixin, {
+ events: {
+ "click .oe_timesheet_weekly_account a": "go_to",
+ },
init: function() {
this._super.apply(this, arguments);
this.set({
this.render_drop = new instance.web.DropMisordered();
this.description_line = _t("/");
},
+ go_to: function(event) {
+ var id = JSON.parse($(event.target).data("id"));
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: "account.analytic.account",
+ res_id: id,
+ views: [[false, 'form']],
+ target: 'current'
+ });
+ },
query_sheets: function() {
var self = this;
if (self.updating)
<th class="oe_timesheet_weekly_date_head">Total</th>
</tr>
<tr t-foreach="widget.accounts" t-as="account">
- <td class="oe_timesheet_weekly_account"><t t-esc="widget.account_names[account.account]"/></td>
+ <td class="oe_timesheet_weekly_account"><a href="javascript:void(0)" t-att-data-id="JSON.stringify(account.account)"><t t-esc="widget.account_names[account.account]"/></a></td>
<t t-set="day_count" t-value="0"/>
<t t-foreach="account.days" t-as="day">
<td t-att-class="(Date.compare(day.day, Date.today()) === 0 ? 'oe_timesheet_weekly_today' : '')">