diff options
| author | Lucas Lefèvre <lul@odoo.com> | 2019-02-18 13:11:07 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-02-18 15:28:15 +0000 |
| commit | 2be9d73f648899b42d97ed5615085dfe9317480a (patch) | |
| tree | adb05bd94e94561c54debc90f9fe69f48bcb6019 | |
| parent | ac1ec35af0fe9ef92f7f70fa5ffcb94a689d30fb (diff) | |
[FIX] hr_payroll: Use jquery API to generate benefit buttons
Use the proper jquery API instead of handcrafting dom elements.
closes odoo/odoo#31091
| -rw-r--r-- | addons/hr_payroll/static/src/js/benefit.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/hr_payroll/static/src/js/benefit.js b/addons/hr_payroll/static/src/js/benefit.js index 2f25e20bbc7..72e1b170637 100644 --- a/addons/hr_payroll/static/src/js/benefit.js +++ b/addons/hr_payroll/static/src/js/benefit.js @@ -20,7 +20,9 @@ odoo.define('hr_payroll.benefit.view_custo', function(require) { var primary = !secondary ? 'btn-primary' : 'btn-secondary'; var txt = _t("Generate Benefits"); this.$buttons.find('.o_calendar_button_month').after( - $('<button class="btn ' + primary + ' btn-benefit" type="button">'+ txt +'</button>') + $('<button class="btn btn-benefit" type="button">') + .text(txt) + .addClass(primary) .off('click') .on('click', function (e) { e.preventDefault(); @@ -69,7 +71,8 @@ odoo.define('hr_payroll.benefit.view_custo', function(require) { } if (is_validated && events.length !== 0) { // Generate Payslip button this.$buttons.find('.o_calendar_button_month').after( - $('<button class="btn btn-primary btn-benefit" type="button">'+ _t('Generate Payslips') +'</button>') + $('<button class="btn btn-primary btn-benefit" type="button">') + .text(_t('Generate Payslips')) .off('click') // action_hr_payslip_by_employees .on('click', function (e) { @@ -87,7 +90,8 @@ odoo.define('hr_payroll.benefit.view_custo', function(require) { } else if (!is_validated) { // Validate button this.$buttons.find('.o_calendar_button_month').after( - $('<button class="btn btn-primary btn-benefit" type="button">'+ _t('Validate Benefits') +'</button>') + $('<button class="btn btn-primary btn-benefit" type="button">') + .text(_t('Validate Benefits')) .off('click') .on('click', function (e) { e.preventDefault(); |
