|
@ -7,10 +7,14 @@ var Widget = require('web.Widget'); |
|
|
|
|
|
|
|
|
var accountFinancialReportWidget = Widget.extend({ |
|
|
var accountFinancialReportWidget = Widget.extend({ |
|
|
events: { |
|
|
events: { |
|
|
'click .o_account_financial_reports_web_action': 'boundLink', |
|
|
|
|
|
'click .o_account_financial_reports_web_action_multi': 'boundLinkmulti', |
|
|
|
|
|
'click .o_account_financial_reports_web_action_monetary': 'boundLinkMonetary', |
|
|
|
|
|
'click .o_account_financial_reports_web_action_monetary_multi': 'boundLinkMonetarymulti', |
|
|
|
|
|
|
|
|
'click .o_account_financial_reports_web_action': |
|
|
|
|
|
'boundLink', |
|
|
|
|
|
'click .o_account_financial_reports_web_action_multi': |
|
|
|
|
|
'boundLinkmulti', |
|
|
|
|
|
'click .o_account_financial_reports_web_action_monetary': |
|
|
|
|
|
'boundLinkMonetary', |
|
|
|
|
|
'click .o_account_financial_reports_web_action_monetary_multi': |
|
|
|
|
|
'boundLinkMonetarymulti', |
|
|
}, |
|
|
}, |
|
|
init: function () { |
|
|
init: function () { |
|
|
this._super.apply(this, arguments); |
|
|
this._super.apply(this, arguments); |
|
@ -26,7 +30,7 @@ var accountFinancialReportWidget = Widget.extend({ |
|
|
res_model: res_model, |
|
|
res_model: res_model, |
|
|
res_id: res_id, |
|
|
res_id: res_id, |
|
|
views: [[false, 'form']], |
|
|
views: [[false, 'form']], |
|
|
target: 'current' |
|
|
|
|
|
|
|
|
target: 'current', |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
boundLinkmulti: function (e) { |
|
|
boundLinkmulti: function (e) { |
|
@ -37,29 +41,41 @@ var accountFinancialReportWidget = Widget.extend({ |
|
|
res_model: res_model, |
|
|
res_model: res_model, |
|
|
domain: domain, |
|
|
domain: domain, |
|
|
views: [[false, "list"], [false, "form"]], |
|
|
views: [[false, "list"], [false, "form"]], |
|
|
target: 'current' |
|
|
|
|
|
|
|
|
target: 'current', |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
boundLinkMonetary: function (e) { |
|
|
boundLinkMonetary: function (e) { |
|
|
var res_model = $(e.target.parentElement).data('res-model'); |
|
|
|
|
|
var res_id = $(e.target.parentElement).data('active-id'); |
|
|
|
|
|
|
|
|
var res_model = $(e.target).data('res-model'); |
|
|
|
|
|
var res_id = $(e.target).data('active-id'); |
|
|
|
|
|
// check if we call on appropriate element, amount been wrapped in
|
|
|
|
|
|
// a span by a monetary widget
|
|
|
|
|
|
if (e.target.localName === 'span' ) { |
|
|
|
|
|
res_model = $(e.target.parentElement).data('res-model'); |
|
|
|
|
|
res_id = $(e.target.parentElement).data('active-id'); |
|
|
|
|
|
} |
|
|
return this.do_action({ |
|
|
return this.do_action({ |
|
|
type: 'ir.actions.act_window', |
|
|
type: 'ir.actions.act_window', |
|
|
res_model: res_model, |
|
|
res_model: res_model, |
|
|
res_id: res_id, |
|
|
res_id: res_id, |
|
|
views: [[false, 'form']], |
|
|
views: [[false, 'form']], |
|
|
target: 'current' |
|
|
|
|
|
|
|
|
target: 'current', |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
boundLinkMonetarymulti: function (e) { |
|
|
boundLinkMonetarymulti: function (e) { |
|
|
var res_model = $(e.target.parentElement).data('res-model'); |
|
|
|
|
|
var domain = $(e.target.parentElement).data('domain'); |
|
|
|
|
|
|
|
|
var res_model = $(e.target).data('res-model'); |
|
|
|
|
|
var domain = $(e.target).data('domain'); |
|
|
|
|
|
// check if we call on appropriate element, amount been wrapped in
|
|
|
|
|
|
// a span by a monetary widget
|
|
|
|
|
|
if (e.target.localName === 'span' ) { |
|
|
|
|
|
res_model = $(e.target.parentElement).data('res-model'); |
|
|
|
|
|
domain = $(e.target.parentElement).data('domain'); |
|
|
|
|
|
} |
|
|
return this.do_action({ |
|
|
return this.do_action({ |
|
|
type: 'ir.actions.act_window', |
|
|
type: 'ir.actions.act_window', |
|
|
res_model: res_model, |
|
|
res_model: res_model, |
|
|
domain: domain, |
|
|
domain: domain, |
|
|
views: [[false, "list"], [false, "form"]], |
|
|
views: [[false, "list"], [false, "form"]], |
|
|
target: 'current' |
|
|
|
|
|
|
|
|
target: 'current', |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|