mirror of https://github.com/OCA/web.git
parent
10a9f0318a
commit
b77720d084
|
@ -39,6 +39,13 @@ the possible attributes for the tag:
|
||||||
view.
|
view.
|
||||||
* colors (optional): it allows to set certain specific colors if the expressed
|
* colors (optional): it allows to set certain specific colors if the expressed
|
||||||
condition (JS syntax) is met.
|
condition (JS syntax) is met.
|
||||||
|
|
||||||
|
Optionally you can declare a custom template, which will be used to render the
|
||||||
|
timeline items. You have to name the template 'timeline-item'.
|
||||||
|
These are the variables available in template rendering:
|
||||||
|
|
||||||
|
* ``record``: to access the fields values selected in the timeline definition.
|
||||||
|
* ``field_utils``: used to format and parse values (see available functions in ``web.field_utils``).
|
||||||
|
|
||||||
You also need to declare the view in an action window of the involved model.
|
You also need to declare the view in an action window of the involved model.
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{
|
{
|
||||||
'name': "Web timeline",
|
'name': "Web timeline",
|
||||||
'summary': "Interactive visualization chart to show events in time",
|
'summary': "Interactive visualization chart to show events in time",
|
||||||
"version": "11.0.1.1.1",
|
"version": "11.0.1.2.1",
|
||||||
'author': 'ACSONE SA/NV, '
|
'author': 'ACSONE SA/NV, '
|
||||||
'Tecnativa, '
|
'Tecnativa, '
|
||||||
'Monk Software, '
|
'Monk Software, '
|
||||||
|
|
|
@ -36,7 +36,7 @@ msgstr ""
|
||||||
|
|
||||||
#. module: web_timeline
|
#. module: web_timeline
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:288
|
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:291
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Template \"timeline-item\" not present in timeline view definition."
|
msgid "Template \"timeline-item\" not present in timeline view definition."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -50,7 +50,7 @@ msgstr ""
|
||||||
|
|
||||||
#. module: web_timeline
|
#. module: web_timeline
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:46
|
#: code:addons/web_timeline/static/src/js/timeline_renderer.js:48
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Timeline view has not defined 'date_start' attribute."
|
msgid "Timeline view has not defined 'date_start' attribute."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -7,6 +7,8 @@ var time = require('web.time');
|
||||||
var utils = require('web.utils');
|
var utils = require('web.utils');
|
||||||
var session = require('web.session');
|
var session = require('web.session');
|
||||||
var QWeb = require('web.QWeb');
|
var QWeb = require('web.QWeb');
|
||||||
|
var field_utils = require('web.field_utils');
|
||||||
|
|
||||||
|
|
||||||
var _t = core._t;
|
var _t = core._t;
|
||||||
|
|
||||||
|
@ -282,7 +284,8 @@ var CalendarRenderer = AbstractRenderer.extend({
|
||||||
if (this.arch.children.length) {
|
if (this.arch.children.length) {
|
||||||
if(this.qweb.has_template('timeline-item')) {
|
if(this.qweb.has_template('timeline-item')) {
|
||||||
content = this.qweb.render('timeline-item', {
|
content = this.qweb.render('timeline-item', {
|
||||||
'record': evt
|
'record': evt,
|
||||||
|
'field_utils': field_utils
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.error(_t('Template "timeline-item" not present in timeline view definition.'));
|
console.error(_t('Template "timeline-item" not present in timeline view definition.'));
|
||||||
|
|
Loading…
Reference in New Issue