Initial commit

This commit is contained in:
tarteo
2016-11-10 21:11:50 +01:00
parent 1f92cd2872
commit 33dc884c58
5 changed files with 55 additions and 0 deletions

View File

View File

View File

@@ -0,0 +1,17 @@
{
'name': 'Many2many and Many2one Delete All Button',
'summary': 'Adds a button to',
'version': '10.0.1.0.0',
'category': 'Web',
'author': 'Onestein,Odoo Community Association (OCA)',
'website': 'http://www.onestein.nl',
'license': 'AGPL-3',
'depends': [
'web',
],
'data': [
'templates/assets.xml'
],
'installable': True,
'application': False,
}

View File

@@ -0,0 +1,29 @@
odoo.define('web_x2many_delete_all', function (require) {
"use strict";
var core = require('web.core');
var _t = core._t;
var DeleteAllMixin = {
events: {
'click th.o_list_record_delete': 'btn_delete_all_clicked'
},
start: function() {
return this._super.apply(this, arguments);
},
btn_delete_all_clicked: function() {
if(!this.get('effective_readonly')) {
this.delete_all();
}
},
delete_all: function() {
this.viewmanager.views.list.controller.do_delete(this.dataset.ids);
}
}
var many2many = core.form_widget_registry.get('many2many');
var one2many = core.form_widget_registry.get('one2many');
many2many.include(DeleteAllMixin);
one2many.include(DeleteAllMixin);
});

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr=".">
<script type="text/javascript"
src="/web_x2many_delete_all/static/src/js/web_x2many_delete_all.js"/>
</xpath>
</template>
</odoo>