};
openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.form.Widget# */{
- template: 'Widget',
+ form_template: 'Widget',
/**
* @constructs openerp.web.form.Widget
* @extends openerp.web.OldWidget
this.$element.toggle(!this.invisible);
},
render: function() {
- return QWeb.render(this.template, { "widget": this });
+ return QWeb.render(this.form_template, { "widget": this });
},
render_element: function() {
this.$element.html(this.render());
delayOut: 0,
fade: true,
title: function() {
- var template = widget.template + '.tooltip';
+ var template = widget.form_template + '.tooltip';
if (!QWeb.has_template(template)) {
template = 'WidgetLabel.tooltip';
}
});
openerp.web.form.WidgetFrame = openerp.web.form.Widget.extend({
- template: 'WidgetFrame',
+ form_template: 'WidgetFrame',
init: function(view, node) {
this._super(view, node);
this.columns = parseInt(node.attrs.col || 4, 10);
});
openerp.web.form.WidgetGroup = openerp.web.form.WidgetFrame.extend({
- template: 'WidgetGroup'
+ form_template: 'WidgetGroup'
}),
openerp.web.form.WidgetNotebook = openerp.web.form.Widget.extend({
- template: 'WidgetNotebook',
+ form_template: 'WidgetNotebook',
init: function(view, node) {
this._super(view, node);
this.pages = [];
});
openerp.web.form.WidgetNotebookPage = openerp.web.form.WidgetFrame.extend({
- template: 'WidgetNotebookPage',
+ form_template: 'WidgetNotebookPage',
init: function(view, node, notebook, index) {
this.notebook = notebook;
this.index = index;
});
openerp.web.form.WidgetSeparator = openerp.web.form.Widget.extend({
- template: 'WidgetSeparator',
+ form_template: 'WidgetSeparator',
init: function(view, node) {
this._super(view, node);
this.orientation = node.attrs.orientation || 'horizontal';
});
openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({
- template: 'WidgetButton',
+ form_template: 'WidgetButton',
init: function(view, node) {
this._super(view, node);
this.force_disabled = false;
});
openerp.web.form.WidgetLabel = openerp.web.form.Widget.extend({
- template: 'WidgetLabel',
+ form_template: 'WidgetLabel',
init: function(view, node) {
this.element_name = 'label_' + node.attrs.name;
this._super(view, node);
if (this.node.tag == 'label' && (this.align === 'left' || this.node.attrs.colspan || (this.string && this.string.length > 32))) {
- this.template = "WidgetParagraph";
+ this.form_template = "WidgetParagraph";
this.colspan = parseInt(this.node.attrs.colspan || 1, 10);
// Widgets default to right-aligned, but paragraph defaults to
// left-aligned
},
render: function () {
if (this['for'] && this.type !== 'label') {
- return QWeb.render(this.template, {widget: this['for']});
+ return QWeb.render(this.form_template, {widget: this['for']});
}
// Actual label widgets should not have a false and have type label
- return QWeb.render(this.template, {widget: this});
+ return QWeb.render(this.form_template, {widget: this});
},
start: function() {
this._super();
});
openerp.web.form.FieldChar = openerp.web.form.Field.extend({
- template: 'FieldChar',
+ form_template: 'FieldChar',
init: function (view, node) {
this._super(view, node);
this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1';
});
openerp.web.form.FieldEmail = openerp.web.form.FieldChar.extend({
- template: 'FieldEmail',
+ form_template: 'FieldEmail',
start: function() {
this._super.apply(this, arguments);
this.$element.find('button').click(this.on_button_clicked);
});
openerp.web.form.FieldUrl = openerp.web.form.FieldChar.extend({
- template: 'FieldUrl',
+ form_template: 'FieldUrl',
start: function() {
this._super.apply(this, arguments);
this.$element.find('button').click(this.on_button_clicked);
});
openerp.web.form.FieldDatetime = openerp.web.form.Field.extend({
- template: "EmptyComponent",
+ form_template: "EmptyComponent",
build_widget: function() {
return new openerp.web.DateTimeWidget(this);
},
});
openerp.web.form.FieldText = openerp.web.form.Field.extend({
- template: 'FieldText',
+ form_template: 'FieldText',
start: function() {
this._super.apply(this, arguments);
this.$element.find('textarea').change(this.on_ui_change);
});
openerp.web.form.FieldBoolean = openerp.web.form.Field.extend({
- template: 'FieldBoolean',
+ form_template: 'FieldBoolean',
start: function() {
var self = this;
this._super.apply(this, arguments);
});
openerp.web.form.FieldProgressBar = openerp.web.form.Field.extend({
- template: 'FieldProgressBar',
+ form_template: 'FieldProgressBar',
start: function() {
this._super.apply(this, arguments);
this.$element.find('div').progressbar({
});
openerp.web.form.FieldSelection = openerp.web.form.Field.extend({
- template: 'FieldSelection',
+ form_template: 'FieldSelection',
init: function(view, node) {
var self = this;
this._super(view, node);
};
openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
- template: 'FieldMany2One',
+ form_template: 'FieldMany2One',
init: function(view, node) {
this._super(view, node);
this.limit = 7;
}
};
openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
- template: 'FieldOne2Many',
+ form_template: 'FieldOne2Many',
multi_selection: false,
init: function(view, node) {
this._super(view, node);
});
openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
- template: 'FieldMany2Many',
+ form_template: 'FieldMany2Many',
multi_selection: false,
init: function(view, node) {
this._super(view, node);
});
openerp.web.form.FieldReference = openerp.web.form.Field.extend({
- template: 'FieldReference',
+ form_template: 'FieldReference',
init: function(view, node) {
this._super(view, node);
this.fields_view = {
});
openerp.web.form.FieldBinaryFile = openerp.web.form.FieldBinary.extend({
- template: 'FieldBinaryFile',
+ form_template: 'FieldBinaryFile',
update_dom: function() {
this._super.apply(this, arguments);
this.$element.find('.oe-binary-file-set, .oe-binary-file-clear').toggle(!this.readonly);
});
openerp.web.form.FieldBinaryImage = openerp.web.form.FieldBinary.extend({
- template: 'FieldBinaryImage',
+ form_template: 'FieldBinaryImage',
start: function() {
this._super.apply(this, arguments);
this.$image = this.$element.find('img.oe-binary-image');
});
openerp.web.form.FieldStatus = openerp.web.form.Field.extend({
- template: "EmptyComponent",
+ form_template: "EmptyComponent",
start: function() {
this._super();
this.selected_value = null;