[MERGE] from trunk
bzr revid: xmo@openerp.com-20120305085606-d60ub93xqdjucfg0
This commit is contained in:
@@ -814,11 +814,13 @@ class Menu(openerpweb.Controller):
|
||||
Menus = s.model('ir.ui.menu')
|
||||
# If a menu action is defined use its domain to get the root menu items
|
||||
user_menu_id = s.model('res.users').read([s._uid], ['menu_id'], context)[0]['menu_id']
|
||||
|
||||
menu_domain = [('parent_id', '=', False)]
|
||||
if user_menu_id:
|
||||
menu_domain = s.model('ir.actions.act_window').read([user_menu_id[0]], ['domain'], context)[0]['domain']
|
||||
menu_domain = ast.literal_eval(menu_domain)
|
||||
else:
|
||||
menu_domain = [('parent_id', '=', False)]
|
||||
domain_string = s.model('ir.actions.act_window').read([user_menu_id[0]], ['domain'], context)[0]['domain']
|
||||
if domain_string:
|
||||
menu_domain = ast.literal_eval(domain_string)
|
||||
|
||||
return Menus.search(menu_domain, 0, False, False, context)
|
||||
|
||||
def do_load(self, req):
|
||||
|
||||
@@ -1228,11 +1228,11 @@ label.error {
|
||||
.openerp input.oe-binary-file {
|
||||
z-index: 0;
|
||||
line-height: 0;
|
||||
font-size: 50px;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
/* Should be adjusted for all browsers */
|
||||
top: -2px;
|
||||
right: 0;
|
||||
top: 1px;
|
||||
right: 10px;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity = 0);
|
||||
-ms-filter: "alpha(opacity=0)";
|
||||
|
||||
@@ -455,7 +455,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
|
||||
submitHandler: function (form) {
|
||||
var $form = $(form),
|
||||
fields = $form.serializeArray(),
|
||||
$db_list = $form.find('select[name=drop_db]'),
|
||||
$db_list = $form.find('[name=drop_db]'),
|
||||
db = $db_list.val();
|
||||
|
||||
if (!confirm("Do you really want to delete the database: " + db + " ?")) {
|
||||
|
||||
@@ -1013,9 +1013,12 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
|
||||
_(_.extend({}, options.data || {},
|
||||
{session_id: this.session_id, token: token}))
|
||||
.each(function (value, key) {
|
||||
$('<input type="hidden" name="' + key + '">')
|
||||
.val(value)
|
||||
.appendTo($form_data);
|
||||
var $input = $form.find('[name=' + key +']');
|
||||
if (!$input.length) {
|
||||
$input = $('<input type="hidden" name="' + key + '">')
|
||||
.appendTo($form_data);
|
||||
}
|
||||
$input.val(value)
|
||||
});
|
||||
|
||||
$form
|
||||
|
||||
@@ -336,7 +336,7 @@ openerp.web.format_cell = function (row_data, column, options) {
|
||||
case 'progressbar':
|
||||
return _.template(
|
||||
'<progress value="<%-value%>" max="100"><%-value%>%</progress>', {
|
||||
value: row_data[column.id].value
|
||||
value: _.str.sprintf("%.0f", row_data[column.id].value)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -263,9 +263,14 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea
|
||||
var filter = this.managed_filters[val];
|
||||
this.do_clear(false).then(_.bind(function() {
|
||||
select.val('get:' + val);
|
||||
var groupbys = _.map(filter.context.group_by.split(","), function(el) {
|
||||
return {"group_by": el};
|
||||
});
|
||||
|
||||
var groupbys = [];
|
||||
var group_by = filter.context.group_by;
|
||||
if (group_by) {
|
||||
groupbys = _.map(
|
||||
group_by instanceof Array ? group_by : group_by.split(','),
|
||||
function (el) { return { group_by: el }; });
|
||||
}
|
||||
this.on_search([filter.domain], [filter.context], groupbys);
|
||||
}, this));
|
||||
} else {
|
||||
|
||||
@@ -291,6 +291,10 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
||||
*/
|
||||
configure_pager: function (dataset) {
|
||||
this.dataset.ids = dataset.ids;
|
||||
// Not exactly clean
|
||||
if (dataset._length) {
|
||||
this.dataset._length = dataset._length;
|
||||
}
|
||||
|
||||
var limit = this.limit(),
|
||||
total = dataset.size(),
|
||||
@@ -540,19 +544,17 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
|
||||
* @param {Array} records selected record values
|
||||
*/
|
||||
do_select: function (ids, records) {
|
||||
this.$element.find('.oe-list-delete')
|
||||
.attr('disabled', !ids.length);
|
||||
if (this.sidebar) {
|
||||
if (ids.length) {
|
||||
this.sidebar.do_unfold();
|
||||
} else {
|
||||
this.sidebar.do_fold();
|
||||
}
|
||||
}
|
||||
if (!records.length) {
|
||||
this.$element.find('.oe-list-delete').attr('disabled', !ids.length);
|
||||
if (!ids.length) {
|
||||
this.dataset.index = 0;
|
||||
if (this.sidebar) { this.sidebar.do_fold(); }
|
||||
this.compute_aggregates();
|
||||
return;
|
||||
}
|
||||
|
||||
this.dataset.index = _(this.dataset.ids).indexOf(ids[0]);
|
||||
if (this.sidebar) { this.sidebar.do_unfold(); }
|
||||
|
||||
this.compute_aggregates(_(records).map(function (record) {
|
||||
return {count: 1, values: record};
|
||||
}));
|
||||
@@ -1259,9 +1261,11 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L
|
||||
if (column.meta) {
|
||||
// do not do anything
|
||||
} else if (column.id in group.aggregates) {
|
||||
var value = group.aggregates[column.id];
|
||||
var r = {};
|
||||
r[column.id] = {value: group.aggregates[column.id]};
|
||||
$('<td class="oe-number">')
|
||||
.html(openerp.web.format_value(value, column))
|
||||
.html(openerp.web.format_cell(
|
||||
r, column, {process_modifiers: false}))
|
||||
.appendTo($row);
|
||||
} else {
|
||||
$row.append('<td>');
|
||||
|
||||
@@ -224,21 +224,25 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView#
|
||||
active_model: self.dataset.model,
|
||||
active_id: id,
|
||||
active_ids: [id]};
|
||||
this.rpc('/web/treeview/action', {
|
||||
return this.rpc('/web/treeview/action', {
|
||||
id: id,
|
||||
model: this.dataset.model,
|
||||
context: new openerp.web.CompoundContext(
|
||||
this.dataset.get_context(), local_context)
|
||||
}, function (actions) {
|
||||
}).pipe(function (actions) {
|
||||
if (!actions.length) { return; }
|
||||
var action = actions[0][2];
|
||||
var c = new openerp.web.CompoundContext(local_context);
|
||||
if (action.context) {
|
||||
c.add(action.context);
|
||||
}
|
||||
action.context = c;
|
||||
self.do_action(action);
|
||||
});
|
||||
return self.rpc('/web/session/eval_domain_and_context', {
|
||||
contexts: [c], domains: []
|
||||
}).pipe(function (res) {
|
||||
action.context = res.context;
|
||||
return self.do_action(action);
|
||||
}, null);
|
||||
}, null);
|
||||
},
|
||||
|
||||
// show & hide the contents
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
<option t-att-value="db"><t t-esc="db"/></option>
|
||||
</t>
|
||||
</select>
|
||||
<input t-if="!db_list" name="drop_db" class="required"
|
||||
<input t-if="!db_list" name="backup_db" class="required"
|
||||
type="text" autofocus="autofocus"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# Czech translation for openerp-web
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openerp-web package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openerp-web\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
|
||||
"PO-Revision-Date: 2012-03-04 12:08+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Czech <cs@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-03-05 04:53+0000\n"
|
||||
"X-Generator: Launchpad (build 14900)\n"
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||
msgid "Calendar"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_calendar/static/src/js/calendar.js:466
|
||||
msgid "Responsible"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_calendar/static/src/js/calendar.js:504
|
||||
msgid "Navigator"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_calendar/static/src/xml/web_calendar.xml:5
|
||||
#: addons/web_calendar/static/src/xml/web_calendar.xml:6
|
||||
msgid " "
|
||||
msgstr ""
|
||||
@@ -0,0 +1,111 @@
|
||||
# Czech translation for openerp-web
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openerp-web package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openerp-web\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
|
||||
"PO-Revision-Date: 2012-03-04 12:09+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Czech <cs@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-03-05 04:53+0000\n"
|
||||
"X-Generator: Launchpad (build 14900)\n"
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/js/dashboard.js:63
|
||||
msgid "Edit Layout"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/js/dashboard.js:109
|
||||
msgid "Are you sure you want to remove this item ?"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/js/dashboard.js:316
|
||||
msgid "Uncategorized"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/js/dashboard.js:324
|
||||
#, python-format
|
||||
msgid "Execute task \"%s\""
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/js/dashboard.js:325
|
||||
msgid "Mark this task as done"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:4
|
||||
msgid "Reset Layout.."
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:6
|
||||
msgid "Reset"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:8
|
||||
msgid "Change Layout.."
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:10
|
||||
msgid "Change Layout"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:27
|
||||
msgid " "
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:28
|
||||
msgid "Create"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:39
|
||||
msgid "Choose dashboard layout"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:62
|
||||
msgid "progress:"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:67
|
||||
msgid ""
|
||||
"Click on the functionalites listed below to launch them and configure your "
|
||||
"system"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:110
|
||||
msgid "Welcome to OpenERP"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
|
||||
msgid "Remember to bookmark"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119
|
||||
msgid "This url"
|
||||
msgstr ""
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:121
|
||||
msgid "Your login:"
|
||||
msgstr ""
|
||||
@@ -8,14 +8,14 @@ msgstr ""
|
||||
"Project-Id-Version: openerp-web\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
|
||||
"PO-Revision-Date: 2012-02-16 11:23+0000\n"
|
||||
"Last-Translator: Stefan Rijnhart (Therp) <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-03-01 11:47+0000\n"
|
||||
"Last-Translator: Erwin <Unknown>\n"
|
||||
"Language-Team: Dutch <nl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-02-17 05:13+0000\n"
|
||||
"X-Generator: Launchpad (build 14814)\n"
|
||||
"X-Launchpad-Export-Date: 2012-03-02 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 14886)\n"
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/js/dashboard.js:63
|
||||
@@ -100,12 +100,12 @@ msgstr "Welkom bij OpenERP"
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:118
|
||||
msgid "Remember to bookmark"
|
||||
msgstr "Bookmark maken"
|
||||
msgstr "Vergeet niet een bladwijzer aan te maken"
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:119
|
||||
msgid "This url"
|
||||
msgstr "Deze URL"
|
||||
msgstr "Deze pagina"
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:121
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Czech translation for openerp-web
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openerp-web package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openerp-web\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
|
||||
"PO-Revision-Date: 2012-03-04 11:19+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Czech <cs@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-03-05 04:53+0000\n"
|
||||
"X-Generator: Launchpad (build 14900)\n"
|
||||
|
||||
#. openerp-web
|
||||
#: addons/web_graph/static/src/js/graph.js:19
|
||||
msgid "Graph"
|
||||
msgstr ""
|
||||
@@ -467,10 +467,10 @@ replace ``addons`` by the directory in which your own addon lives.
|
||||
Python
|
||||
++++++
|
||||
|
||||
.. autoclass:: web.common.backendrpc.OpenERPSession
|
||||
.. autoclass:: web.common.session.OpenERPSession
|
||||
:members:
|
||||
|
||||
.. autoclass:: web.common.backendrpc.OpenERPModel
|
||||
.. autoclass:: web.common.openerplib.main.Model
|
||||
:members:
|
||||
|
||||
* Addons lifecycle (loading, execution, events, ...)
|
||||
|
||||
@@ -391,12 +391,12 @@ Python
|
||||
These classes should be moved to other sections of the doc as needed,
|
||||
probably.
|
||||
|
||||
.. automodule:: web.common.dispatch
|
||||
.. automodule:: web.common.http
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
See also: :class:`~web.common.backendrpc.OpenERPSession`,
|
||||
:class:`~web.common.backendrpc.OpenERPModel`
|
||||
See also: :class:`~web.common.session.OpenERPSession`,
|
||||
:class:`~web.common.openerplib.main.OpenERPModel`
|
||||
|
||||
.. automodule:: web.controllers.main
|
||||
:members:
|
||||
|
||||
Reference in New Issue
Block a user