Skip to content

Commit

Permalink
Expose mixin for inheritance, fix some spacing.
Browse files Browse the repository at this point in the history
Related to OCA#481.
  • Loading branch information
yajo authored Nov 22, 2016
1 parent a85ddc2 commit c1d1f0d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions web_x2many_delete_all/static/src/js/web_x2many_delete_all.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* Copyright 2016 Onestein
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */

odoo.define('web_x2many_delete_all', function (require) {
"use strict";
var core = require('web.core'),
_t = core._t;
odoo.define('web_x2many_delete_all.Mixin', function (require) {
"use strict";
var core = require('web.core');

var X2ManyListDeleteAllMixin = {
events: {
Expand All @@ -19,14 +18,14 @@ odoo.define('web_x2many_delete_all', function (require) {
return res
},
toggle_btn_delete_all: function() {
if(this.get('effective_readonly')) {
if (this.get('effective_readonly')) {
this.$('th.o_list_record_delete > .fa-trash-o').addClass('hidden');
} else {
this.$('th.o_list_record_delete > .fa-trash-o').removeClass('hidden');
}
},
btn_delete_all_clicked: function() {
if(this.get('effective_readonly')) return;
if (this.get('effective_readonly')) return;
this.delete_all();
},
delete_all: function() {
Expand All @@ -36,4 +35,6 @@ odoo.define('web_x2many_delete_all', function (require) {

core.form_widget_registry.get('many2many').include(X2ManyListDeleteAllMixin);
core.form_widget_registry.get('one2many').include(X2ManyListDeleteAllMixin);

return X2ManyListDeleteAllMixin;
});

0 comments on commit c1d1f0d

Please sign in to comment.