delayOut: 0,
fade: true,
title: function() {
- var template = widget.form_template + '.tooltip';
+ var template = widget.template + '.tooltip';
if (!QWeb.has_template(template)) {
template = 'WidgetLabel.tooltip';
}
});
openerp.web.form.FieldDatetime = openerp.web.form.Field.extend({
- form_template: "EmptyComponent",
+ template: "EmptyComponent",
build_widget: function() {
return new openerp.web.DateTimeWidget(this);
},
});
openerp.web.form.FieldProgressBar = openerp.web.form.Field.extend({
- form_template: 'FieldProgressBar',
+ template: 'FieldProgressBar',
start: function() {
this._super.apply(this, arguments);
- this.$element.find('div').progressbar({
+ this.$element.progressbar({
value: this.value,
disabled: this.readonly
});
show_value = 0;
}
var formatted_value = openerp.web.format_value(show_value, { type : 'float' }, '0');
- this.$element.find('div').progressbar('option', 'value', show_value).find('span').html(formatted_value + '%');
+ this.$element.progressbar('option', 'value', show_value).find('span').html(formatted_value + '%');
}
});
};
openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
- form_template: 'EmptyComponent',
+ template: 'EmptyComponent',
init: function(view, node) {
this._super(view, node);
this.previous_readonly = this.is_readonly();
},
is_readonly: function() {
return this.readonly || this.force_readonly;
- },
+ },
start: function() {
this._super();
this.render_content();
}
};
openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
- form_template: 'FieldOne2Many',
+ template: 'FieldOne2Many',
multi_selection: false,
init: function(view, node) {
this._super(view, node);
});
openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
- form_template: 'FieldMany2Many',
+ template: 'FieldMany2Many',
multi_selection: false,
init: function(view, node) {
this._super(view, node);
});
openerp.web.form.FieldReference = openerp.web.form.Field.extend({
- form_template: 'FieldReference',
+ template: 'FieldReference',
init: function(view, node) {
this._super(view, node);
this.fields_view = {
},
start: function() {
this._super();
+ // TODO: not niv compliant
this.selection.$element = $(".oe_form_view_reference_selection", this.$element);
this.selection.renderElement();
this.selection.start();
});
openerp.web.form.FieldBinaryFile = openerp.web.form.FieldBinary.extend({
- form_template: 'FieldBinaryFile',
+ 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({
- form_template: 'FieldBinaryImage',
+ 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({
- form_template: "EmptyComponent",
+ template: "EmptyComponent",
start: function() {
this._super();
this.selected_value = null;
</ul>
</t>
<t t-name="FieldChar">
- <input t-att-type="widget.password ? 'password' : 'text'" size="1"
- t-att-name="widget.name"
- t-att-id="widget.node.attrs.id"
- t-attf-class="field_#{widget.type} #{_(['integer', 'float', 'float_time']).contains(widget.type) ? 'oe-number' : ''}"
- style="width: 100%"
- /><img class="oe_field_translate oe_input_icon" t-if="widget.field.translate" t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"' width="16" height="16" border="0"/>
+ <div t-attf-class="oe_form_field_#{type}">
+ <input t-att-type="widget.password ? 'password' : 'text'" size="1"
+ t-att-name="widget.name"
+ t-att-id="widget.node.attrs.id"
+ t-attf-class="field_#{widget.type} #{_(['integer', 'float', 'float_time']).contains(widget.type) ? 'oe-number' : ''}"
+ style="width: 100%"
+ /><img class="oe_field_translate oe_input_icon" t-if="widget.field.translate" t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"' width="16" height="16" border="0"/>
+ </div>
</t>
<t t-name="FieldChar.readonly">
<div
</div>
</t>
<t t-name="FieldEmail">
- <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <table t-attf-class="oe_form_field_#{type}" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%">
<t t-call="FieldChar"/>
</table>
</t>
<t t-name="FieldUrl">
- <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <table t-attf-class="oe_form_field_#{type}" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%">
<t t-call="FieldChar"/>
</table>
</t>
<t t-name="FieldText">
- <textarea rows="6"
- t-att-name="widget.name"
- t-attf-class="field_#{widget.type}"
- style="width: 100%"
- ></textarea><img class="oe_field_translate oe_input_icon" t-if="widget.field.translate" t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"' width="16" height="16" border="0"/>
+ <div t-attf-class="oe_form_field_#{type}">
+ <textarea rows="6"
+ t-att-name="widget.name"
+ t-attf-class="field_#{widget.type}"
+ style="width: 100%"
+ ></textarea><img class="oe_field_translate oe_input_icon" t-if="widget.field.translate" t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"' width="16" height="16" border="0"/>
+ </div>
</t>
<t t-name="web.datetimepicker">
- <div class="oe_datepicker_root">
+ <div class="oe_datepicker_root" t-attf-class="oe_form_field_#{type}">
<input type="text" size="1" class="oe_datepicker_container" disabled="disabled" style="display: none;"/>
<input type="text" size="1" style="width: 100%"
t-att-name="widget.name"
</div>
</t>
<t t-name="FieldSelection">
- <span class="oe_field_selection">
+ <div t-attf-class="oe_form_field_#{type}">
<select
t-att-name="widget.name"
t-att-id="widget.node.attrs.id"
<option><t t-esc="option[1]"/></option>
</t>
</select>
- </span>
+ </div>
</t>
<t t-name="FieldMany2One">
- <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <table t-attf-class="oe_form_field_#{type}" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%" valign="top">
<t t-call="FieldChar"/>
<t t-name="FieldOne2Many">
</t>
<t t-name="FieldMany2Many">
- <div t-att-id="widget.list_id"></div>
+ <div t-attf-class="oe_form_field_#{type}" t-att-id="widget.list_id"></div>
</t>
<t t-name="FieldReference">
- <table border="0" width="100%" cellpadding="0" cellspacing="0" class="oe_frame oe_forms">
+ <table t-attf-class="oe_form_field_#{type}" border="0" width="100%" cellpadding="0" cellspacing="0" class="oe_frame oe_forms">
<tr>
<td t-attf-class="oe_form_frame_cell oe_form_selection oe_form_view_reference_selection">
</td>
</table>
</t>
<t t-name="FieldBoolean">
- <input type="checkbox"
- t-att-name="widget.name"
- t-attf-class="field_#{widget.type}"/>
+ <div t-attf-class="oe_form_field_#{type}">
+ <input type="checkbox"
+ t-att-name="widget.name"
+ t-attf-class="field_#{widget.type}"/>
+ </div>
</t>
<t t-name="FieldProgressBar">
- <div t-opentag="true" class="oe-progressbar">
+ <div t-attf-class="oe_form_field_#{type}" t-opentag="true">
<span></span>
</div>
</t>
<t t-name="FieldBinaryImage">
- <table cellpadding="0" cellspacing="0" border="0">
+ <table t-attf-class="oe_form_field_#{type}" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<img t-att-src='_s + "/web/static/src/img/placeholder.png"' class="oe-binary-image"
</table>
</t>
<t t-name="FieldBinaryFile">
- <table cellpadding="0" cellspacing="0" border="0" width="100%">
+ <table t-attf-class="oe_form_field_#{type}" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="100%">
<input type="text" size="1" readonly="readonly"
</table>
</t>
<t t-name="WidgetButton">
- <button type="button" class="oe_button">
- <img t-if="widget.node.attrs.icon" t-att-src="_s + '/web/static/src/img/icons/' + widget.node.attrs.icon + '.png'" width="16" height="16"/>
- <span t-if="widget.string"><t t-esc="widget.string"/></span>
- </button>
+ <div t-attf-class="oe_form_field_#{type}">
+ <button type="button" class="oe_button">
+ <img t-if="widget.node.attrs.icon" t-att-src="_s + '/web/static/src/img/icons/' + widget.node.attrs.icon + '.png'" width="16" height="16"/>
+ <span t-if="widget.string"><t t-esc="widget.string"/></span>
+ </button>
+ </div>
</t>
<t t-name="WidgetButton.tooltip" t-extend="WidgetLabel.tooltip">
<t t-jquery="div.oe_tooltip_string" t-operation="replace">