Browse Source

Merge 34394369f7 into d736ee4460

pull/949/merge
Meet Dholakia 5 years ago
committed by GitHub
parent
commit
7bc1efe3a1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      web_x2many_delete_all/README.rst
  2. 2
      web_x2many_delete_all/__init__.py
  3. 23
      web_x2many_delete_all/__manifest__.py
  4. 26
      web_x2many_delete_all/i18n/de.po
  5. 26
      web_x2many_delete_all/i18n/es.po
  6. 26
      web_x2many_delete_all/i18n/hr.po
  7. 26
      web_x2many_delete_all/i18n/lt.po
  8. 26
      web_x2many_delete_all/i18n/nl_NL.po
  9. 26
      web_x2many_delete_all/i18n/pt_BR.po
  10. 2
      web_x2many_delete_all/readme/CONTRIBUTORS.rst
  11. 1
      web_x2many_delete_all/readme/DESCRIPTION.rst
  12. 5
      web_x2many_delete_all/readme/USAGE.rst
  13. 39
      web_x2many_delete_all/static/src/js/web_x2many_delete_all.js
  14. 13
      web_x2many_delete_all/static/src/less/web_x2many_delete_all.less
  15. 11
      web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml
  16. 14
      web_x2many_delete_all/templates/assets.xml

3
web_x2many_delete_all/README.rst

@ -0,0 +1,3 @@
**This file is going to be generated by oca-gen-addon-readme.**
Adds a button to Many2many and One2many fields that removes all linked records.

2
web_x2many_delete_all/__init__.py

@ -0,0 +1,2 @@
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

23
web_x2many_delete_all/__manifest__.py

@ -0,0 +1,23 @@
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'X2many Delete All Button',
'summary': """
Adds a button to x2many fields that removes all linked records
""",
'version': '11.0.1.0.0',
'category': 'Web',
'author': 'Onestein, Meet Dholakia, Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/web',
'license': 'AGPL-3',
'depends': [
'web',
],
'data': [
'templates/assets.xml'
],
'qweb': [
'static/src/xml/web_x2many_delete_all.xml'
],
}

26
web_x2many_delete_all/i18n/de.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_x2many_delete_all
#
# Translators:
# Niki Waibel <niki.waibel@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-03 01:37+0000\n"
"PO-Revision-Date: 2017-02-03 01:37+0000\n"
"Last-Translator: Niki Waibel <niki.waibel@gmail.com>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: web_x2many_delete_all
#. openerp-web
#: code:addons/web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml:8
#, python-format
msgid "Delete all"
msgstr "Alles löschen"

26
web_x2many_delete_all/i18n/es.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_x2many_delete_all
#
# Translators:
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-23 02:13+0000\n"
"PO-Revision-Date: 2016-12-23 02:13+0000\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>, 2016\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: web_x2many_delete_all
#. openerp-web
#: code:addons/web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml:8
#, python-format
msgid "Delete all"
msgstr "Borrar todo"

26
web_x2many_delete_all/i18n/hr.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_x2many_delete_all
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: hr\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: web_x2many_delete_all
#. openerp-web
#: code:addons/web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml:8
#, python-format
msgid "Delete all"
msgstr "Briši sve"

26
web_x2many_delete_all/i18n/lt.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_x2many_delete_all
#
# Translators:
# Viktoras Norkus <viktoras@bmx.lt>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-25 01:58+0000\n"
"PO-Revision-Date: 2018-01-25 01:58+0000\n"
"Last-Translator: Viktoras Norkus <viktoras@bmx.lt>, 2018\n"
"Language-Team: Lithuanian (https://www.transifex.com/oca/teams/23907/lt/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: lt\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#. module: web_x2many_delete_all
#. openerp-web
#: code:addons/web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml:8
#, python-format
msgid "Delete all"
msgstr "Ištrinti viską"

26
web_x2many_delete_all/i18n/nl_NL.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_x2many_delete_all
#
# Translators:
# Peter Hageman <hageman.p@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-03 03:50+0000\n"
"PO-Revision-Date: 2018-01-03 03:50+0000\n"
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: nl_NL\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: web_x2many_delete_all
#. openerp-web
#: code:addons/web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml:8
#, python-format
msgid "Delete all"
msgstr "Alles verwijderen"

26
web_x2many_delete_all/i18n/pt_BR.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_x2many_delete_all
#
# Translators:
# Rodrigo de Almeida Sottomaior Macedo <rmsolucoeseminformatic4@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 08:27+0000\n"
"PO-Revision-Date: 2017-06-22 08:27+0000\n"
"Last-Translator: Rodrigo de Almeida Sottomaior Macedo <rmsolucoeseminformatic4@gmail.com>, 2017\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: web_x2many_delete_all
#. openerp-web
#: code:addons/web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml:8
#, python-format
msgid "Delete all"
msgstr "Apagar todos"

2
web_x2many_delete_all/readme/CONTRIBUTORS.rst

@ -0,0 +1,2 @@
* Dennis Sluijk <d.sluijk@onestein.nl>
* Meet Dholakia <meetcomputer009@gmail.com>

1
web_x2many_delete_all/readme/DESCRIPTION.rst

@ -0,0 +1 @@
This module extends the functionality of the list view and adds a button to Many2many and One2many fields that removes all linked records.

5
web_x2many_delete_all/readme/USAGE.rst

@ -0,0 +1,5 @@
To use this module, you need to:
#. Go to any Many2many or One2many field;
#. click 'Edit';
#. click the top most trash can button.

39
web_x2many_delete_all/static/src/js/web_x2many_delete_all.js

@ -0,0 +1,39 @@
/* Copyright 2016 Onestein
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define('web_x2many_delete_all.Mixin', function (require) {
"use strict";
var core = require('web.core');
var _t = core._t;
var ListRenderer = require('web.ListRenderer');
ListRenderer.include({
events: _.extend({}, ListRenderer.prototype.events, {
'click thead .o_list_record_delete_all': '_onTrashAllIconClick',
}),
_renderHeader: function () {
var $header = this._super.apply(this, arguments);
if (this.addTrashIcon) {
$header.find('tr').append(this._renderDeleteAll('th'));
}
return $header;
},
_renderDeleteAll: function (tag) {
var $icon = $('<button>', {class: 'fa fa-trash-o o_list_record_delete_all_btn', name: 'delete all',
'aria-label': _t('Delete All')});
return $('<' + tag + '>')
.addClass('o_list_record_delete_all')
.append($icon);
},
_onTrashAllIconClick: function (event) {
event.stopPropagation();
var self = this;
var resIDs = _.map(self.$('tbody tr.o_data_row'), function(rowID) {
return $(rowID).data('id')
});
_.each(resIDs, function(row_id){
self.trigger_up('list_record_delete', {id: row_id});
})
},
})
});

13
web_x2many_delete_all/static/src/less/web_x2many_delete_all.less

@ -0,0 +1,13 @@
//Delete all button in x2many list view.
.o_list_view {
.o_list_record_delete_all {
width: 1px; // to prevent the column to expand
}
.o_list_record_delete_all_btn {
padding: 0px;
background-style: none;
border-style: none;
display: table-cell;
}
}

11
web_x2many_delete_all/static/src/xml/web_x2many_delete_all.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2016 Onestein
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<templates>
<t t-extend="ListView">
<t t-jquery=".o_list_record_delete" t-operation="inner">
<span class="fa fa-trash-o hidden" title="Delete all"/>
</t>
</t>
</templates>

14
web_x2many_delete_all/templates/assets.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2016 Onestein
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<template id="assets_backend" inherit_id="web.assets_backend" name="web_x2many_delete_all assets">
<xpath expr=".">
<script type="text/javascript"
src="/web_x2many_delete_all/static/src/js/web_x2many_delete_all.js"/>
<link rel="stylesheet"
href="/web_x2many_delete_all/static/src/less/web_x2many_delete_all.less"/>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save