{"size": 2336, "ext": "js", "max_stars_repo_path": "odoo_wage_manage/static/src/js/wage_employee_tax_details.js", "max_stars_repo_name": "joytao-zhu/odooExtModel", "max_stars_repo_stars_event_min_datetime": "2019-12-06T04:47:49.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-16T15:42:25.000Z", "max_issues_repo_path": "odoo_wage_manage/static/src/js/wage_employee_tax_details.js", "max_issues_repo_name": "niulinlnc/odooExtModel", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "odoo_wage_manage/static/src/js/wage_employee_tax_details.js", "max_forks_repo_name": "niulinlnc/odooExtModel", "max_forks_repo_forks_event_min_datetime": "2020-03-01T08:16:07.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-05T05:48:53.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 6, "avg_line_length": 39.593220339, "max_line_length": 95, "alphanum_fraction": 0.5749143836}
/**
 *    Copyright (C) 2019 SuXueFeng
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU Affero General Public License as
 *    published by the Free Software Foundation, either version 3 of the
 *    License, or (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **/

odoo.define('odoo.wage.employee.tax.details.tree.button', function (require) {
    "use strict";

    let ListController = require('web.ListController');
    let ListView = require('web.ListView');
    let viewRegistry = require('web.view_registry');

    let OdooWageManageTaxDetailsViewController = ListController.extend({
        buttons_template: 'OdooWageManageListView.wage_employee_tax_details_buttons',
        renderButtons: function () {
            this._super.apply(this, arguments);
            if (this.$buttons) {
                let self = this;
                this.$buttons.on('click', '.wage_employee_tax_details_but_class', function () {
                    self.do_action({
                        type: 'ir.actions.act_window',
                        res_model: 'wage.employee.tax.details.transient',
                        target: 'new',
                        views: [[false, 'form']],
                        context: [],
                    },{
                        on_reverse_breadcrumb: function () {
                            self.reload();
                        },
                          on_close: function () {
                            self.reload();
                        }
                     });
                });
            }
        }
    });

    let OdooWageTaxDetailsListView = ListView.extend({
        config: _.extend({}, ListView.prototype.config, {
            Controller: OdooWageManageTaxDetailsViewController,
        }),
    });

    viewRegistry.add('compute_wage_employee_tax_details', OdooWageTaxDetailsListView);
});
