|
@ -36,8 +36,15 @@ odoo.define('account_financial_report.account_financial_report_widget', function |
|
|
boundLinkmulti: function (e) { |
|
|
boundLinkmulti: function (e) { |
|
|
var res_model = $(e.target).data('res-model'); |
|
|
var res_model = $(e.target).data('res-model'); |
|
|
var domain = $(e.target).data('domain'); |
|
|
var domain = $(e.target).data('domain'); |
|
|
|
|
|
if (!res_model) { |
|
|
|
|
|
res_model = $(e.target.parentElement).data('res-model'); |
|
|
|
|
|
} |
|
|
|
|
|
if (!domain) { |
|
|
|
|
|
domain = $(e.target.parentElement).data('domain'); |
|
|
|
|
|
} |
|
|
return this.do_action({ |
|
|
return this.do_action({ |
|
|
type: 'ir.actions.act_window', |
|
|
type: 'ir.actions.act_window', |
|
|
|
|
|
name: this._toTitleCase(res_model.split('.').join(' ')), |
|
|
res_model: res_model, |
|
|
res_model: res_model, |
|
|
domain: domain, |
|
|
domain: domain, |
|
|
views: [[false, "list"], [false, "form"]], |
|
|
views: [[false, "list"], [false, "form"]], |
|
@ -66,6 +73,12 @@ odoo.define('account_financial_report.account_financial_report_widget', function |
|
|
target: 'current', |
|
|
target: 'current', |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
_toTitleCase: function (str) { |
|
|
|
|
|
return str.replace(/\w\S*/g, function (txt) { |
|
|
|
|
|
return txt.charAt(0).toUpperCase() + |
|
|
|
|
|
txt.substr(1).toLowerCase(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return accountFinancialReportWidget; |
|
|
return accountFinancialReportWidget; |
|
|