[FIX] Missing GroupClick Functionality

pull/2247/head
Martin Nicolas Cuesta 2018-04-17 09:22:52 -03:00 committed by CarlosRoca13
parent 38c2da502c
commit 20ccec86fe
7 changed files with 120 additions and 43 deletions

View File

@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_timeline
#
#
# Translators:
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2017
msgid ""
@ -12,15 +12,15 @@ msgstr ""
"PO-Revision-Date: 2018-01-03 03:50+0000\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>, 2017\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: 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_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:481
#: code:addons/web_timeline/static/src/js/timeline_controller.js:176
#, python-format
msgid "Are you sure you want to delete this record ?"
msgstr "¿Está seguro que desea eliminar este registro?"
@ -41,14 +41,14 @@ msgstr "Mes"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:33
#: code:addons/web_timeline/static/src/js/timeline_view.js:32
#, python-format
msgid "Timeline"
msgstr "Línea de tiempo"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:99
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:43
#, python-format
msgid "Timeline view has not defined 'date_start' attribute."
msgstr ""

View File

@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_timeline
#
#
# Translators:
# leemannd <denis.leemann@camptocamp.com>, 2017
# OCA Transbot <transbot@odoo-community.org>, 2017
@ -13,15 +13,15 @@ msgstr ""
"PO-Revision-Date: 2018-01-03 03:50+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:481
#: code:addons/web_timeline/static/src/js/timeline_controller.js:176
#, python-format
msgid "Are you sure you want to delete this record ?"
msgstr "Êtes vous sûr de vouloir supprimer cet enregistrement ?"
@ -42,14 +42,14 @@ msgstr "Mois"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:33
#: code:addons/web_timeline/static/src/js/timeline_view.js:32
#, python-format
msgid "Timeline"
msgstr "Chronologie"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:99
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:43
#, python-format
msgid "Timeline view has not defined 'date_start' attribute."
msgstr "La vue chronologique n'a pas défini l'attribut 'date_start'."

View File

@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_timeline
#
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
@ -12,15 +12,16 @@ msgstr ""
"PO-Revision-Date: 2018-01-03 03:50+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: 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"
"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_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:481
#: code:addons/web_timeline/static/src/js/timeline_controller.js:176
#, python-format
msgid "Are you sure you want to delete this record ?"
msgstr "Jeste li sigurni da želite brisati ovaj zapis?"
@ -41,14 +42,14 @@ msgstr "Mjesec"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:33
#: code:addons/web_timeline/static/src/js/timeline_view.js:32
#, python-format
msgid "Timeline"
msgstr "Vremenska crta"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:99
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:43
#, python-format
msgid "Timeline view has not defined 'date_start' attribute."
msgstr "Pogled vremenske crte nema definiran atribut 'date_start'."

View File

@ -1,7 +1,7 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_timeline
#
#
# Translators:
# Peter Hageman <hageman.p@gmail.com>, 2017
msgid ""
@ -11,16 +11,17 @@ msgstr ""
"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"
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/"
"teams/23907/nl_NL/)\n"
"Language: 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_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:481
#: code:addons/web_timeline/static/src/js/timeline_controller.js:176
#, python-format
msgid "Are you sure you want to delete this record ?"
msgstr "Weet je zeker dat je dit record wil verwijderen?"
@ -41,14 +42,14 @@ msgstr "Maand"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:33
#: code:addons/web_timeline/static/src/js/timeline_view.js:32
#, python-format
msgid "Timeline"
msgstr "Tijdlijn"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/web_timeline.js:99
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:43
#, python-format
msgid "Timeline view has not defined 'date_start' attribute."
msgstr "Tijdlijn heeft geen 'date_start' eigenschap."

View File

@ -0,0 +1,76 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_timeline
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/timeline_controller.js:176
#, python-format
msgid "Are you sure you want to delete this record ?"
msgstr ""
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:8
#, python-format
msgid "Day"
msgstr ""
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:10
#, python-format
msgid "Month"
msgstr ""
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/timeline_view.js:32
#, python-format
msgid "Timeline"
msgstr ""
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:43
#, python-format
msgid "Timeline view has not defined 'date_start' attribute."
msgstr ""
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:5
#, python-format
msgid "Today"
msgstr ""
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:9
#, python-format
msgid "Week"
msgstr ""
#. module: web_timeline
#. openerp-web
#: code:addons/web_timeline/static/src/xml/web_timeline.xml:11
#, python-format
msgid "Year"
msgstr ""
#. module: web_timeline
#: model:ir.model,name:web_timeline.model_ir_ui_view
msgid "ir.ui.view"
msgstr ""

View File

@ -10,6 +10,7 @@ var _t = core._t;
var CalendarController = AbstractController.extend({
custom_events: _.extend({}, AbstractController.prototype.custom_events, {
onGroupClick: '_onGroupClick',
onUpdate: '_onUpdate',
onRemove: '_onRemove',
onMove: '_onMove',
@ -62,6 +63,17 @@ var CalendarController = AbstractController.extend({
});
},
_onGroupClick: function (event) {
var groupField = this.renderer.last_group_bys[0];
return this.do_action({
type: 'ir.actions.act_window',
res_model: this.renderer.view.fields[groupField].relation,
res_id: event.data.item.group,
target: 'new',
views: [[false, 'form']]
});
},
_onUpdate: function(event) {
var self = this;
this.renderer = event.data.renderer;

View File

@ -106,26 +106,6 @@ var CalendarRenderer = AbstractRenderer.extend({
}
},
_onClick: function (e) {
// handle a click on a group header
if (e.what === 'group-label') {
return self._onGroupClick(e);
}
},
_onGroupClick: function (e) {
if (e.group === -1) {
return;
}
return this.do_action({
type: 'ir.actions.act_window',
res_model: this.view.fields_view.fields[this.last_group_bys[0]].relation,
res_id: e.group,
target: 'new',
views: [[false, 'form']]
});
},
_computeMode: function() {
if (this.mode) {
var start = false, end = false;
@ -176,7 +156,7 @@ var CalendarRenderer = AbstractRenderer.extend({
if (self.mode && self['on_scale_' + self.mode + '_clicked']) {
self['on_scale_' + self.mode + '_clicked']();
}
this.timeline.on('click', self._onClick);
this.timeline.on('click', self.on_group_click);
var group_bys = this.arch.attrs.default_group_by.split(',');
this.last_group_bys = group_bys;
this.last_domains = this.modelClass.data.domain;
@ -300,6 +280,13 @@ var CalendarRenderer = AbstractRenderer.extend({
return r;
},
on_group_click: function (e) {
// handle a click on a group header
if (e.what === 'group-label' && e.group != -1) {
this._trigger(e, function(){}, 'onGroupClick');
}
},
on_update: function (item, callback) {
this._trigger(item, callback, 'onUpdate');
},