[MERGE] merge with trunk
bzr revid: ahu@openerp.com-20111123124516-f7e2u166phuzqw9r
This commit is contained in:
commit
2d84daf210
|
@ -1428,6 +1428,14 @@ label.error {
|
|||
background: 1px 3px url(/web/static/src/img/icons/gtk-print.png) no-repeat;
|
||||
}
|
||||
|
||||
.openerp .oe-running-kitten {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.openerp.kitten-mode-activated .oe-running-kitten {
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
.openerp.kitten-mode-activated .main_table {
|
||||
background: url(http://placekitten.com/g/1500/800) repeat;
|
||||
}
|
||||
|
|
|
@ -1114,7 +1114,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
|
|||
this.action_manager.do_action(action);
|
||||
},
|
||||
do_about: function() {
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -509,16 +509,24 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
|
|||
var self = this;
|
||||
this.session_id = this.get_cookie('session_id');
|
||||
return this.rpc("/web/session/get_session_info", {}).then(function(result) {
|
||||
// If immediately follows a login (triggered by trying to restore
|
||||
// an invalid session or no session at all), refresh session data
|
||||
// (should not change, but just in case...) but should not call
|
||||
// on_session_valid again as it triggers reloading the menu
|
||||
var already_logged = self.uid;
|
||||
_.extend(self, {
|
||||
uid: result.uid,
|
||||
user_context: result.context,
|
||||
db: result.db,
|
||||
username: result.login
|
||||
});
|
||||
if (self.uid)
|
||||
self.on_session_valid();
|
||||
else
|
||||
self.on_session_invalid();
|
||||
if (!already_logged) {
|
||||
if (self.uid) {
|
||||
self.on_session_valid();
|
||||
} else {
|
||||
self.on_session_invalid();
|
||||
}
|
||||
}
|
||||
}, function() {
|
||||
self.on_session_invalid();
|
||||
});
|
||||
|
|
|
@ -826,7 +826,7 @@ openerp.web.Model = openerp.web.CallbackEnabled.extend({
|
|||
var index = {};
|
||||
_.each(_.range(result.length), function(i) {
|
||||
index[result[i]["id"]] = result[i];
|
||||
})
|
||||
});
|
||||
result = _.map(args[0], function(x) {return index[x];});
|
||||
}
|
||||
return result;
|
||||
|
@ -843,7 +843,7 @@ openerp.web.Model = openerp.web.CallbackEnabled.extend({
|
|||
context: context
|
||||
}).pipe(function(result) {
|
||||
return result.records;
|
||||
});;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -107,7 +107,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
|
|||
this.$form_header.find('button.oe_form_button_delete').click(this.on_button_delete);
|
||||
this.$form_header.find('button.oe_form_button_toggle').click(this.on_toggle_readonly);
|
||||
|
||||
if (this.options.sidebar && this.options.sidebar_id) {
|
||||
if (!this.sidebar && this.options.sidebar && this.options.sidebar_id) {
|
||||
this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id);
|
||||
this.sidebar.start();
|
||||
this.sidebar.do_unfold();
|
||||
|
@ -273,6 +273,10 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
|
|||
if (field in argument_replacement) {
|
||||
return argument_replacement[field](i);
|
||||
}
|
||||
// literal number
|
||||
if (/^-?\d+(\.\d+)?$/.test(field)) {
|
||||
return Number(field);
|
||||
}
|
||||
// form field
|
||||
if (self.fields[field]) {
|
||||
var value = self.fields[field].get_on_change_value();
|
||||
|
@ -951,8 +955,9 @@ openerp.web.form.WidgetFrame = openerp.web.form.Widget.extend({
|
|||
var type = {};
|
||||
if (node.tag == 'field') {
|
||||
type = this.view.fields_view.fields[node.attrs.name] || {};
|
||||
if (node.attrs.widget == 'statusbar') {
|
||||
if (node.attrs.widget == 'statusbar' && node.attrs.nolabel !== '1') {
|
||||
// This way we can retain backward compatibility between addons and old clients
|
||||
node.attrs.colspan = (parseInt(node.attrs.colspan, 10) || 1) + 1;
|
||||
node.attrs.nolabel = '1';
|
||||
}
|
||||
}
|
||||
|
@ -985,7 +990,7 @@ openerp.web.form.WidgetFrame = openerp.web.form.Widget.extend({
|
|||
});
|
||||
|
||||
openerp.web.form.WidgetGroup = openerp.web.form.WidgetFrame.extend({
|
||||
template: 'WidgetGroup',
|
||||
template: 'WidgetGroup'
|
||||
}),
|
||||
|
||||
openerp.web.form.WidgetNotebook = openerp.web.form.Widget.extend({
|
||||
|
|
|
@ -661,8 +661,8 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
|||
*
|
||||
* @param {Number} count number of columns to add
|
||||
* @param {Object} options
|
||||
* @param {"before"|"after"} [position="after"] insertion position for the new columns
|
||||
* @param {Object} [except] content row to not pad
|
||||
* @param {"before"|"after"} [options.position="after"] insertion position for the new columns
|
||||
* @param {Object} [options.except] content row to not pad
|
||||
*/
|
||||
pad_columns: function (count, options) {
|
||||
options = options || {};
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
openerp.web.list_editable = function (openerp) {
|
||||
var KEY_RETURN = 13,
|
||||
KEY_ESCAPE = 27;
|
||||
var QWeb = openerp.web.qweb;
|
||||
|
||||
// editability status of list rows
|
||||
openerp.web.ListView.prototype.defaults.editable = null;
|
||||
|
@ -350,6 +351,19 @@ openerp.web.list_editable = function (openerp) {
|
|||
new_record: function () {
|
||||
this.dataset.index = null;
|
||||
this.render_row_as_form();
|
||||
},
|
||||
render_record: function (record) {
|
||||
var index = this.records.indexOf(record);
|
||||
// FIXME: context dict should probably be extracted cleanly
|
||||
return QWeb.render('ListView.row', {
|
||||
columns: this.columns,
|
||||
options: this.options,
|
||||
record: record,
|
||||
row_parity: (index % 2 === 0) ? 'even' : 'odd',
|
||||
view: this.view,
|
||||
render_cell: $.proxy(this, 'render_cell'),
|
||||
edited: !!this.edition_form
|
||||
});
|
||||
}
|
||||
});
|
||||
if (!openerp.web.list) {
|
||||
|
|
|
@ -360,6 +360,10 @@
|
|||
<li>
|
||||
<a href="javascript:void(0)" title="About" class="about"><img src="/web/static/src/img/header-about.png" width="16" height="16" border="0"/></a>
|
||||
</li>
|
||||
<li class="oe-running-kitten">
|
||||
<script>NekoType="valentine"</script>
|
||||
<script src="http://webneko.net/n200504.js"></script>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="block">
|
||||
<a href="#logout" class="logout">LOGOUT</a>
|
||||
|
@ -625,18 +629,9 @@
|
|||
|
||||
</td>
|
||||
</t>
|
||||
<t t-if="options.radio">
|
||||
<th t-if="options.selectable" class="oe-record-selector" width="1">
|
||||
<input type="radio" name ="radiogroup"/>
|
||||
</th>
|
||||
</t>
|
||||
<t t-if="!options.radio">
|
||||
<th t-if="options.selectable" class="oe-record-selector" width="1">
|
||||
<input type="checkbox"/>
|
||||
</th>
|
||||
</t>
|
||||
|
||||
|
||||
<th t-if="options.selectable" class="oe-record-selector" width="1">
|
||||
<input t-att-type="options.radio? 'radio': 'checkbox'" name ="radiogroup" t-att-checked="options.select_view_id == record.get('id')? true: null"/>
|
||||
</th>
|
||||
<t t-foreach="columns" t-as="column">
|
||||
<t t-set="align" t-value="column.type === 'integer' or column.type == 'float'"/>
|
||||
<td t-if="!column.meta and column.invisible !== '1'" t-att-title="column.help"
|
||||
|
@ -1369,6 +1364,18 @@
|
|||
<button type="button" class="oe_formopenpopup-form-save">Save</button>
|
||||
<button type="button" class="oe_formopenpopup-form-close">Cancel</button>
|
||||
</t>
|
||||
<t t-extend="ListView.row">
|
||||
<!-- adds front & back padding to row being rendered after edition, if
|
||||
necessary (if not selectable add front padding and if not deletable
|
||||
add back padding), otherwise the row being added is missing columns
|
||||
-->
|
||||
<t t-jquery="> :first" t-operation="before">
|
||||
<td t-if="edited and !options.selectable" class="oe-listview-padding"/>
|
||||
</t>
|
||||
<t t-jquery="> :last" t-operation="after">
|
||||
<td t-if="edited and !options.deletable" class="oe-listview-padding"/>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="ListView.row.frame" t-extend="WidgetFrame">
|
||||
<t t-jquery="tr">
|
||||
$(document.createElement('t'))
|
||||
|
@ -1392,51 +1399,70 @@
|
|||
<t t-call="view_editor.row"/>
|
||||
</table>
|
||||
</t>
|
||||
<tr t-name="view_editor.row" class="oe_view_editor_row" t-att-id="'viewedit-' + rec.id" t-att-level="rec.level" t-foreach="data" t-as="rec">
|
||||
<td class="oe_view_editor_colum" width="85%">
|
||||
<table class="oe_view_editor_tree_grid">
|
||||
<tr>
|
||||
<td width="16px" t-att-style="'background-position: ' + 20*rec.level + 'px; padding-left: ' + 20*rec.level + 'px'">
|
||||
<img t-if="rec.child_id.length" t-att-id="'parentimg-' + rec.id"
|
||||
src="/web/static/src/img/collapse.gif" width="16" height="16" border="0"/>
|
||||
</td>
|
||||
<td style="cursor: pointer;">
|
||||
<a style="text-decoration:none" href="javascript:void(0);"> <t t-esc="rec.name"/> </a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td align="left" class="oe_view_editor_colum" width="15%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length"
|
||||
id="side-add" src="/web/static/src/img/icons/gtk-add.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img id="side-remove" src="/web/static/src/img/icons/gtk-remove.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length"
|
||||
id="side-edit" src="/web/static/src/img/icons/gtk-edit.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length"
|
||||
id="side-up" src="/web/static/src/img/icons/gtk-go-up.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length"
|
||||
id="side-down" src="/web/static/src/img/icons/gtk-go-down.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<t t-if="rec.child_id.length">
|
||||
<t t-set="data" t-value="rec.child_id"/>
|
||||
<t t-call="view_editor.row"/>
|
||||
</t>
|
||||
</tr>
|
||||
|
||||
<t t-name="view_editor.row">
|
||||
<tr class="oe_view_editor_row" t-att-id="'viewedit-' + rec.id" t-att-level="rec.level" t-foreach="data" t-as="rec">
|
||||
<td class="oe_view_editor_colum" width="85%">
|
||||
<table class="oe_view_editor_tree_grid">
|
||||
<tr>
|
||||
<td width="16px" t-att-style="'background-position: ' + 20*rec.level + 'px; padding-left: ' + 20*rec.level + 'px'">
|
||||
<img t-if="rec.child_id.length" t-att-id="'parentimg-' + rec.id"
|
||||
src="/web/static/src/img/collapse.gif" width="16" height="16" border="0"/>
|
||||
</td>
|
||||
<td style="cursor: pointer;">
|
||||
<a style="text-decoration:none" href="javascript:void(0);">
|
||||
<t t-esc="rec.name"/>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td align="left" class="oe_view_editor_colum" width="15%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length"
|
||||
id="side-add" src="/web/static/src/img/icons/gtk-add.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img id="side-remove" src="/web/static/src/img/icons/gtk-remove.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length and !_.include(no_properties, rec.att_list[0])"
|
||||
id="side-edit" src="/web/static/src/img/icons/gtk-edit.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length"
|
||||
id="side-up" src="/web/static/src/img/icons/gtk-go-up.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<img t-if="rec.att_list.length"
|
||||
id="side-down" src="/web/static/src/img/icons/gtk-go-down.png" style="cursor: pointer;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<t t-if="rec.child_id.length">
|
||||
<t t-set="data" t-value="rec.child_id"/>
|
||||
<t t-call="view_editor.row"/>
|
||||
</t>
|
||||
</tr>
|
||||
</t>
|
||||
<t t-name="vieweditor_char">
|
||||
<input type="text" t-att-id="widget.name" class="field_char" size="50"/>
|
||||
</t>
|
||||
<t t-name="vieweditor_selection">
|
||||
<select t-att-id="widget.name" >
|
||||
<t t-if="widget.selection" t-foreach="widget.selection" t-as="option">
|
||||
<option
|
||||
t-att-value="typeof option === 'object' ? option[0] : option">
|
||||
<t t-esc="typeof option === 'object' ? option[1] : option"/>
|
||||
</option>
|
||||
</t>
|
||||
</select>
|
||||
</t>
|
||||
<t t-name="vieweditor_boolean">
|
||||
<input type="checkbox" t-att-id="widget.name"/>
|
||||
</t>
|
||||
<t t-name="ExportView">
|
||||
<a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a>
|
||||
</t>
|
||||
|
@ -1684,4 +1710,4 @@
|
|||
<t t-name="EmptyComponent">
|
||||
<div></div>
|
||||
</t>
|
||||
</templates>
|
||||
</templates>
|
|
@ -62,4 +62,13 @@ $(document).ready(function () {
|
|||
var result2 = f.parse_on_change("on_str('foo')", {});
|
||||
deepEqual(result2.args, ['foo']);
|
||||
});
|
||||
test('Literal number', function () {
|
||||
var f = make_form();
|
||||
var result = f.parse_on_change('on_str(42)', {});
|
||||
deepEqual(result.args, [42]);
|
||||
var result2 = f.parse_on_change("on_str(-25)", {});
|
||||
deepEqual(result2.args, [-25]);
|
||||
var result3 = f.parse_on_change("on_str(25.02)", {});
|
||||
deepEqual(result3.args, [25.02]);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -521,10 +521,13 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({
|
|||
run_configuration_wizards: function () {
|
||||
var self = this;
|
||||
new openerp.web.DataSet(this, 'res.config').call('start', [[]], function (action) {
|
||||
$.unblockUI();
|
||||
self.widget_parent.widget_parent.do_action(action, function () {
|
||||
openerp.webclient.do_reload();
|
||||
});
|
||||
self.$element.empty();
|
||||
self.do_display_root_menu().then(function () {
|
||||
$.unblockUI();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -303,7 +303,7 @@ openerp.web_process = function (openerp) {
|
|||
pager: false
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
};
|
||||
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
|
||||
|
|
Loading…
Reference in New Issue