merge trunk

bzr revid: nicolas.vanhoren@openerp.com-20121023124321-cmd2jtnslyk30mr7
This commit is contained in:
niv-openerp 2012-10-23 14:43:21 +02:00
commit bb22e231ff
8 changed files with 119 additions and 105 deletions

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-07-02 09:06+0200\n"
"PO-Revision-Date: 2012-02-16 21:49+0000\n"
"Last-Translator: Davide Corio - agilebg.com <davide.corio@agilebg.com>\n"
"PO-Revision-Date: 2012-10-22 14:36+0000\n"
"Last-Translator: Marius Marolla <mariusmarolla@areablu.net>\n"
"Language-Team: Italian <it@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-10-21 05:02+0000\n"
"X-Generator: Launchpad (build 16165)\n"
"X-Launchpad-Export-Date: 2012-10-23 05:05+0000\n"
"X-Generator: Launchpad (build 16179)\n"
#. openerp-web
#: addons/web/static/src/js/chrome.js:176
@ -129,56 +129,56 @@ msgstr "OpenERP - Unsupported/Community Version"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:619
msgid "less than a minute ago"
msgstr ""
msgstr "meno di un minuto fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:620
msgid "about a minute ago"
msgstr ""
msgstr "circa un minuto fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:621
#, python-format
msgid "%d minutes ago"
msgstr ""
msgstr "%d minuti fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:622
msgid "about an hour ago"
msgstr ""
msgstr "circa un'ora fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:623
#, python-format
msgid "%d hours ago"
msgstr ""
msgstr "%d ore fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:624
msgid "a day ago"
msgstr ""
msgstr "un giorno fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:625
#, python-format
msgid "%d days ago"
msgstr ""
msgstr "%d giorni fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:626
msgid "about a month ago"
msgstr ""
msgstr "circa un mese fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:627
#, python-format
msgid "%d months ago"
msgstr ""
msgstr "%d mesi fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:628
msgid "about a year ago"
msgstr ""
msgstr "circa un anno fa"
#. openerp-web
#: addons/web/static/src/js/coresetup.js:629

View File

@ -1930,6 +1930,9 @@
min-height: 327px;
margin-left: -15px;
}
.openerp .oe_view.oe_cannot_create .oe_view_nocontent_create {
display: none;
}
.openerp .oe_formview {
background: white;
}
@ -2623,6 +2626,13 @@
.openerp .oe_list_buttons.oe_editing .oe_alternative {
visibility: visible;
}
.openerp .oe_list.oe_cannot_edit .oe_list_header_handle, .openerp .oe_list.oe_cannot_edit .oe_list_field_handle {
display: none !important;
padding: 0 !important;
}
.openerp .oe_list.oe_cannot_delete .oe_list_record_delete {
display: none !important;
}
.openerp .oe_list .oe_form .oe_form_nosheet {
margin: 0;
padding: 0;
@ -2765,13 +2775,6 @@
content: "}";
color: #e0e0e0;
}
.openerp .oe_list_cannot_edit .oe_list_header_handle, .openerp .oe_list_cannot_edit .oe_list_field_handle {
display: none !important;
padding: 0 !important;
}
.openerp .oe_list_cannot_delete .oe_list_record_delete {
display: none !important;
}
.openerp .tree_header {
background-color: #f0f0f0;
border-bottom: 1px solid #cacaca;

View File

@ -120,7 +120,7 @@ $sheet-max-width: 860px
font-size: 1px
letter-spacing: -1px
color: transparent
font-weight: normal
font-weight: normal
&:before
font: 21px "mnmliconsRegular"
content: $icon-name
@ -130,7 +130,7 @@ $sheet-max-width: 860px
font-size: 1px
letter-spacing: -1px
color: transparent
font-weight: normal
font-weight: normal
&:before
font: $size "entypoRegular"
content: $icon-name
@ -611,7 +611,7 @@ $sheet-max-width: 860px
vertical-align: top
margin-top: 8px
//margin-left set at 3px to avoid a strange overflow
margin-left: 3px
margin-left: 3px
border-left: 4px solid transparent
border-right: 4px solid transparent
border-top: 4px solid#404040
@ -804,7 +804,7 @@ $sheet-max-width: 860px
display: none
// }}}
// Top Menu {{{
.oe_topbar
width: 100%
height: 32px
@ -977,7 +977,7 @@ $sheet-max-width: 860px
.oe_menu_counter
float: right
text-shadow: 0 1px 1px rgba(0,0,0,0.2)
margin: 1px
margin: 1px
padding: 1px 4px
border: none
&:hover
@ -1069,7 +1069,7 @@ $sheet-max-width: 860px
// ViewManager common {{{
.oe_view_manager
.oe_view_manager_body
height: inherit
height: inherit
.oe_view_manager_view_kanban
height: inherit
@ -1547,7 +1547,9 @@ $sheet-max-width: 860px
padding: 100px 0 0 137px
min-height: 327px
margin-left: -15px
.oe_view.oe_cannot_create
.oe_view_nocontent_create
display: none
// }}}
// FormView.base and dynamic tags {{{
.oe_formview
@ -1579,7 +1581,7 @@ $sheet-max-width: 860px
display: none !important
.oe_form .oe_form_field_date
width: auto
// Sheet and padding
// Sheet and padding
.oe_form_nosheet
margin: 16px
> header
@ -1625,7 +1627,7 @@ $sheet-max-width: 860px
margin-left: 6px
// }}}
// FormView.custom tags and classes {{{
.oe_form
.oe_form
header
.oe_tags
margin: 5px 0 0 5px
@ -1788,7 +1790,7 @@ $sheet-max-width: 860px
display: none
.oe_datepicker_root
display: inline-block
.oe_form_required
.oe_form_required
input:not([disabled]):not([readonly]), select:not([disabled]):not([readonly]), textarea:not([disabled]):not([readonly])
background-color: #D2D2FF !important
.oe_form_invalid
@ -1824,10 +1826,10 @@ $sheet-max-width: 860px
position: relative
width: 600px
margin-left: 130px
margin-top: 32px
margin-top: 32px
margin-bottom: 32px
text-align: justify
.oe_form_editable
.oe_form
.oe_form_field_integer input
@ -1905,7 +1907,7 @@ $sheet-max-width: 860px
display: inline-block
margin: 0
padding: 0 18px 0 0
li
li
display: inline-block
list-style-type: none
// It is probably a bad idea to modify this margin
@ -1935,7 +1937,7 @@ $sheet-max-width: 860px
vertical-align: top
overflow: hidden
margin-left: -5px
span
span
position: relative
width: 24px
height: 24px
@ -1948,7 +1950,7 @@ $sheet-max-width: 860px
@include transform(rotate(45deg))
li.oe_active
@include vertical-gradient(#729fcf, #3465a4)
.arrow span
.arrow span
@include skew-gradient(#729fcf, #3465a4)
.label
color: white
@ -1956,20 +1958,20 @@ $sheet-max-width: 860px
ul.oe_form_status_clickable
li
cursor: pointer
&:hover
&:hover
@include vertical-gradient(darken(#fcfcfc, 8%), darken(#dedede, 8%))
.label
text-shadow: 0 -1px 1px #fcfcfc, 0 1px 1px #dedede
.arrow span
.arrow span
@include vertical-gradient(darken(#fcfcfc, 8%), darken(#dedede, 8%))
.label
color: $link-color
li.oe_active
&:hover
&:hover
@include vertical-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%))
.label
text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4
.arrow span
.arrow span
@include skew-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%))
// }}}
// FormView.one2many {{{
@ -2081,6 +2083,14 @@ $sheet-max-width: 860px
visibility: visible
.oe_list
&.oe_cannot_edit
.oe_list_header_handle, .oe_list_field_handle
display: none !important
padding: 0 !important
&.oe_cannot_delete
.oe_list_record_delete
display: none !important
.oe_form
.oe_form_nosheet
margin: 0 // FIXME: either class or border should not be by default
@ -2178,15 +2188,6 @@ $sheet-max-width: 860px
.oe_list_handle
@include text-to-entypo-icon("}",#E0E0E0,18px)
margin-right: 7px
.oe_list_cannot_edit
.oe_list_header_handle, .oe_list_field_handle
display: none !important
padding: 0 !important
.oe_list_cannot_delete
.oe_list_record_delete
display: none !important
// }}}
// Tree view {{{
.tree_header
@ -2237,7 +2238,6 @@ $sheet-max-width: 860px
background-image: url(/web/static/src/img/collapse.gif)
.treeview-tr.oe-treeview-first span, .treeview-td.oe-treeview-first span
margin-left: 16px
// }}}
// Debugging stuff {{{
.oe_layout_debugging
@ -2280,7 +2280,6 @@ $sheet-max-width: 860px
background-attachment: fixed
>*
opacity: 0.70
// }}}
// The jQuery-ui overlay and Autocomplete are outside the .openerp div, please don't add indentation !!!
@ -2302,7 +2301,7 @@ div.ui-widget-overlay
width: 100%
padding: 0
a
padding: 1px 16px
padding: 1px 16px
a.ui-corner-all
@include radius(0)
a.ui-state-active

View File

@ -1128,6 +1128,7 @@ instance.web.WebClient = instance.web.Client.extend({
}
return $.when(self.action_manager.do_action(action, {
clear_breadcrumbs: true,
action_menu_id: self.menu.current_menu,
})).fail(function() {
self.menu.open_menu(options.previous_menu_id);
});

View File

@ -4620,16 +4620,6 @@ instance.web.form.FieldReference = instance.web.form.AbstractField.extend(instan
this._super(field_manager, node);
this.reference_ready = true;
},
on_nop: function() {
},
on_selection_changed: function() {
if (this.reference_ready) {
var sel = this.selection.get_value();
this.m2o.field.relation = sel;
this.m2o.set_value(false);
this.m2o.$el.toggle(sel !== false);
}
},
destroy_content: function() {
if (this.fm) {
this.fm.destroy();
@ -4670,33 +4660,38 @@ instance.web.form.FieldReference = instance.web.form.AbstractField.extend(instan
.on('focused', null, function () {self.trigger('focused')})
.on('blurred', null, function () {self.trigger('blurred')});
},
is_false: function() {
return typeof(this.get_value()) !== 'string';
on_selection_changed: function() {
if (this.reference_ready) {
this.internal_set_value([this.selection.get_value(), false]);
this.render_value();
}
},
data_changed: function() {
if (this.reference_ready) {
this.internal_set_value([this.selection.get_value(), this.m2o.get_value()]);
}
},
set_value: function(val) {
if (val) {
val = val.split(',');
val[0] = val[0] || false;
val[1] = val[0] ? (val[1] ? parseInt(val[1], 10) : val[1]) : false;
}
this._super(val || [false, false]);
},
get_value: function() {
return this.get('value')[0] && this.get('value')[1] ? (this.get('value')[0] + ',' + this.get('value')[1]) : false;
},
render_value: function() {
this.reference_ready = false;
var vals = [], sel_val, m2o_val;
if (typeof(this.get('value')) === 'string') {
vals = this.get('value').split(',');
}
sel_val = vals[0] || false;
m2o_val = vals[1] ? parseInt(vals[1], 10) : vals[1];
if (!this.get("effective_readonly")) {
this.selection.set_value(sel_val);
this.selection.set_value(this.get('value')[0]);
}
this.m2o.field.relation = sel_val;
this.m2o.set_value(m2o_val);
this.m2o.field.relation = this.get('value')[0];
this.m2o.set_value(this.get('value')[1]);
this.m2o.$el.toggle(!!this.get('value')[0]);
this.reference_ready = true;
},
data_changed: function() {
var model = this.selection.get_value(),
id = this.m2o.get_value();
if (typeof(model) === 'string' && typeof(id) === 'number') {
this.internal_set_value(model + ',' + id);
} else {
this.internal_set_value(false);
}
},
});
instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, {

View File

@ -22,6 +22,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
'reorderable': true,
'action_buttons': true,
},
view_type: 'tree',
/**
* Core class for list-type displays.
*
@ -83,7 +84,8 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
});
this.no_leaf = false;
this.on('view_load', self, self.load_list);
this.grouped = false;
this.on('view_loaded', self, self.load_list);
},
set_default_options: function (options) {
this._super(options);
@ -145,7 +147,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
*/
start: function() {
this.$el.addClass('oe_list');
return this.start();
return this._super();
},
/**
* Returns the style for the provided record in the current view (from the
@ -250,11 +252,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.$el.html(QWeb.render(this._template, this));
this.$el.addClass(this.fields_view.arch.attrs['class']);
// add css classes that reflect the (absence of) access rights
this.$el.toggleClass('oe_list_cannot_create', !this.is_action_enabled('create'))
.toggleClass('oe_list_cannot_edit', !this.is_action_enabled('edit'))
.toggleClass('oe_list_cannot_delete', !this.is_action_enabled('delete'));
// Head hook
// Selecting records
this.$el.find('.oe_list_record_selector').click(function(){
@ -282,7 +279,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
// Add button
if (!this.$buttons) {
this.$buttons = $(QWeb.render("ListView.buttons", {'widget':this}));
this.$buttons = $(QWeb.render("ListView.buttons", {'widget':self}));
if (this.options.$buttons) {
this.$buttons.appendTo(this.options.$buttons);
} else {
@ -295,7 +292,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
// Pager
if (!this.$pager) {
this.$pager = $(QWeb.render("ListView.pager", {'widget':this}));
this.$pager = $(QWeb.render("ListView.pager", {'widget':self}));
if (this.options.$buttons) {
this.$pager.appendTo(this.options.$pager);
} else {
@ -461,6 +458,16 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
}
this._super();
},
/**
* Reloads the list view based on the current settings (dataset & al)
*
* @deprecated
* @param {Boolean} [grouped] Should the list be displayed grouped
* @param {Object} [context] context to send the server while loading the view
*/
reload_view: function (grouped, context, initial) {
return this.load_view(context);
},
/**
* re-renders the content of the list view
*
@ -543,7 +550,8 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.no_leaf = !!context['group_by_no_leaf'];
this.grouped = !!group_by;
this.load_view(context).then(this.proxy('reload_content'));
return this.load_view(context).pipe(
this.proxy('reload_content'));
},
/**
* Handles the signal to delete lines from the records list

View File

@ -150,7 +150,7 @@ openerp.web.list_editable = function (instance) {
if (!id && done.created) {
id = done.record.get('id');
}
self.handle_button.call(self, name, id, callback);
self.handle_button(name, id, callback);
});
},
/**

View File

@ -174,6 +174,9 @@ instance.web.ActionManager = instance.web.Widget.extend({
if(this.inner_action.type == 'ir.actions.act_window') {
state['model'] = this.inner_action.res_model;
}
if (this.inner_action.menu_id) {
state['menu_id'] = this.inner_action.menu_id;
}
if (this.inner_action.id) {
state['action'] = this.inner_action.id;
} else if (this.inner_action.type == 'ir.actions.client') {
@ -241,6 +244,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
clear_breadcrumbs: false,
on_reverse_breadcrumb: function() {},
on_close: function() {},
action_menu_id: null,
});
if (_.isString(action) && instance.web.client_actions.contains(action)) {
var action_client = { type: "ir.actions.client", tag: action };
@ -266,6 +270,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
pager : !popup && !inline,
display_title : !popup
}, action.flags || {});
action.menu_id = options.action_menu_id;
if (!(type in this)) {
console.error("Action manager can't handle action of type " + action.type, action);
return $.Deferred().reject();
@ -895,9 +900,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
var self = this;
return $.when(this._super.apply(this, arguments)).then(function () {
var controller = self.views[self.active_view].controller,
fvg = controller.fields_view,
view_id = (fvg && fvg.view_id) || '--';
var controller = self.views[self.active_view].controller;
self.$el.find('.oe_debug_view').html(QWeb.render('ViewManagerDebug', {
view: controller,
view_manager: self
@ -1144,26 +1147,31 @@ instance.web.View = instance.web.Widget.extend({
},
load_view: function(context) {
var self = this;
var view_loaded;
if (this.embedded_view) {
var def = $.Deferred();
$.async_when().then(function() {def.resolve(self.embedded_view);});
return def.pipe(function(r) {
self.trigger('view_loaded', r);
view_loaded = $.Deferred();
$.async_when().then(function() {
view_loaded.resolve(self.embedded_view);
});
} else {
var context = this.dataset.get_context(context || {});
if (! this.view_type)
console.warn("view_type is not defined", this);
return this.rpc("/web/view/load", {
view_loaded = this.rpc("/web/view/load", {
"model": this.dataset.model,
"view_id": this.view_id,
"view_type": this.view_type,
toolbar: !!this.options.$sidebar,
context: context
}).pipe(function(r) {
self.trigger('view_loaded', r);
context: this.dataset.get_context(context)
});
}
return view_loaded.pipe(function(r) {
self.trigger('view_loaded', r);
// add css classes that reflect the (absence of) access rights
self.$el.addClass('oe_view')
.toggleClass('oe_cannot_create', !self.is_action_enabled('create'))
.toggleClass('oe_cannot_edit', !self.is_action_enabled('edit'))
.toggleClass('oe_cannot_delete', !self.is_action_enabled('delete'));
});
},
set_default_options: function(options) {
this.options = options || {};