[MERGE]merge with main branch.

bzr revid: vme@tinyerp.com-20120607113308-38jqf2smnu000urd
This commit is contained in:
Vidhin Mehta (OpenERP)
2012-06-07 17:03:08 +05:30
14 changed files with 1807 additions and 123 deletions
+1 -1
View File
@@ -608,7 +608,7 @@ class LocalConnector(openerplib.Connector):
except Exception,e:
# TODO change the except to raise LibException instead of their emulated xmlrpc fault
if isinstance(e, openerp.osv.osv.except_osv):
fault = xmlrpclib.Fault('warning -- ' + e.name + '\n\n' + e.value, '')
fault = xmlrpclib.Fault('warning -- ' + e.name + '\n\n' + str(e.value), '')
elif isinstance(e, openerp.exceptions.Warning):
fault = xmlrpclib.Fault('warning -- Warning\n\n' + str(e), '')
elif isinstance(e, openerp.exceptions.AccessError):
File diff suppressed because it is too large Load Diff
+5 -5
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-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-05-15 14:32+0000\n"
"PO-Revision-Date: 2012-06-04 14:18+0000\n"
"Last-Translator: Els Van Vossel (Agaplan) <Unknown>\n"
"Language-Team: Dutch (Belgium) <nl_BE@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-06-01 05:37+0000\n"
"X-Generator: Launchpad (build 15342)\n"
"X-Launchpad-Export-Date: 2012-06-05 05:07+0000\n"
"X-Generator: Launchpad (build 15353)\n"
#. openerp-web
#: addons/web/static/src/js/chrome.js:172
@@ -1330,7 +1330,7 @@ msgstr "Voorwaarde toevoegen"
#. openerp-web
#: addons/web/static/src/xml/base.xml:1436
msgid "and"
msgstr ""
msgstr "en"
#. openerp-web
#: addons/web/static/src/xml/base.xml:1503
@@ -1441,7 +1441,7 @@ msgstr "CSV Bestand:"
#. openerp-web
#: addons/web/static/src/xml/base.xml:1750
msgid "2. Check your file format"
msgstr ""
msgstr "2. Controleer uw bestandsformaat"
#. openerp-web
#: addons/web/static/src/xml/base.xml:1753
+36 -15
View File
@@ -34,7 +34,7 @@
background: white;
/* http://www.quirksmode.org/dom/inputfile.html
* http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
*/ */
*/
}
.openerp a {
text-decoration: none;
@@ -1123,7 +1123,7 @@
left: 0px;
padding: 8px;
border: 1px solid #afafb6;
width: 120px;
min-width: 120px;
overflow-x: hidden;
z-index: 900;
text-align: left;
@@ -1629,7 +1629,7 @@
font-weight: bold;
color: #b33630;
}
.openerp header.oe_form_topbar_hifirst button:first-child, .openerp button.oe_form_button_hi {
.openerp .oe_form_readonly header.oe_form_topbar_hifirst button:first-child, .openerp .oe_form_readonly button.oe_form_button_hi {
color: white;
background: #dc5f59;
background: -moz-linear-gradient(#dc5f59, #b33630);
@@ -1639,7 +1639,7 @@
-webkit-box-shadow: none;
-box-shadow: none;
}
.openerp header.oe_form_topbar_hifirst button:first-child:hover, .openerp button.oe_form_button_hi:hover {
.openerp .oe_form_readonly header.oe_form_topbar_hifirst button:first-child:hover, .openerp .oe_form_readonly button.oe_form_button_hi:hover {
background: #df6b66;
background: -moz-linear-gradient(#df6b66, #bf3a33);
background: -webkit-gradient(linear, left top, left bottom, from(#df6b66), to(#bf3a33));
@@ -1723,7 +1723,7 @@
}
.openerp .oe_form .oe_form_field {
width: 100%;
display: inline-block;
display: inline-block !important;
padding: 2px 2px 2px 0px;
line-height: 18px;
}
@@ -1829,7 +1829,6 @@
color: black;
padding: 0px 3px 0px 3px;
margin: 0 2px 2px 0;
cursor: pointer;
height: 16px;
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
}
@@ -2097,27 +2096,27 @@
padding-left: 8px;
}
.openerp .oe_form .oe_form_subtotal_footer {
width: auto;
float: right;
}
.openerp .oe_form .oe_form_subtotal_footer > div {
.openerp .oe_form .oe_form_subtotal_footer td.oe_form_group_cell {
text-align: right;
padding: 3px;
padding: 0;
}
.openerp .oe_form .oe_form_subtotal_footer label {
font-weight: normal !important;
.openerp .oe_form .oe_form_subtotal_footer td.oe_form_group_cell_label {
border: none;
}
.openerp .oe_form .oe_form_subtotal_footer span {
display: inline-block;
min-width: 80px;
text-align: right;
.openerp .oe_form .oe_form_subtotal_footer .oe_form_field {
width: auto !important;
}
.openerp .oe_form .oe_form_subtotal_footer .oe_form_subtotal_footer_separator {
border-top: 1px solid #cacaca;
font-size: 120%;
font-weight: bold;
}
.openerp .oe_form .oe_form_subtotal_footer .oe_form_subtotal_footer_separator label {
.openerp .oe_form .oe_form_subtotal_footer label.oe_form_subtotal_footer_separator {
font-weight: bold !important;
padding: 2px 8px 2px 0px !important;
}
.openerp .oe-listview-content {
width: 100%;
@@ -2284,6 +2283,28 @@
color: #333333;
}
.openerp .oe_view_editor {
width: 100%;
border-collapse: collapse;
margin-left: -12px;
width: 100%;
background-color: white;
border-spacing: 0;
}
.openerp .oe_view_editor td {
text-align: center;
white-space: nowrap;
border: 1px solid #d8d8d8;
cursor: pointer;
font-size: 90%;
}
.openerp .oe_view_editor_field td {
border: 0px !important;
}
.openerp .oe_view_editor tr:hover {
background-color: #ecebf2;
}
.kitten-mode-activated {
background-image: url(http://placekitten.com/g/1365/769);
background-size: cover;
+50 -30
View File
@@ -895,7 +895,7 @@ $colour4: #8a89ba
left: 0px
padding: 8px
border: 1px solid #afafb6
width: 120px
min-width: 120px
overflow-x: hidden
z-index: 900
text-align: left
@@ -1298,23 +1298,24 @@ $colour4: #8a89ba
.oe_form_steps_active
font-weight: bold
color: #b33630
header.oe_form_topbar_hifirst button:first-child, button.oe_form_button_hi
color: white
background: #DC5F59
background: -moz-linear-gradient(#DC5F59, #B33630)
background: -webkit-gradient(linear, left top, left bottom, from(#DC5F59), to(#B33630))
background: -webkit-linear-gradient(#DC5F59, #B33630)
-moz-box-shadow: none
-webkit-box-shadow: none
-box-shadow: none
header.oe_form_topbar_hifirst button:first-child:hover, button.oe_form_button_hi:hover
background: #DF6B66
background: -moz-linear-gradient( #DF6B66, #BF3A33)
background: -webkit-gradient(linear, left top, left bottom, from( #DF6B66), to( #BF3A33))
background: -webkit-linear-gradient( #DF6B66, #BF3A33)
-moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2)
-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2)
-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2)
.oe_form_readonly
header.oe_form_topbar_hifirst button:first-child, button.oe_form_button_hi
color: white
background: #DC5F59
background: -moz-linear-gradient(#DC5F59, #B33630)
background: -webkit-gradient(linear, left top, left bottom, from(#DC5F59), to(#B33630))
background: -webkit-linear-gradient(#DC5F59, #B33630)
-moz-box-shadow: none
-webkit-box-shadow: none
-box-shadow: none
header.oe_form_topbar_hifirst button:first-child:hover, button.oe_form_button_hi:hover
background: #DF6B66
background: -moz-linear-gradient( #DF6B66, #BF3A33)
background: -webkit-gradient(linear, left top, left bottom, from( #DF6B66), to( #BF3A33))
background: -webkit-linear-gradient( #DF6B66, #BF3A33)
-moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2)
-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2)
-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2)
.oe_application
.oe_form_sheetbg
background: url(/web/static/src/img/form_sheetbg.png)
@@ -1387,7 +1388,8 @@ $colour4: #8a89ba
resize: vertical
.oe_form_field
width: 100%
display: inline-block
// Using !important because jQuery's $.fn.show() will set display to 'inline' for spans
display: inline-block !important
padding: 2px 2px 2px 0px
line-height: 18px
input
@@ -1475,7 +1477,6 @@ $colour4: #8a89ba
color: black
padding: 0px 3px 0px 3px
margin: 0 2px 2px 0
cursor: pointer
height: 16px
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif
.text-core .text-wrap .text-dropdown .text-list .text-suggestion em
@@ -1727,22 +1728,22 @@ $colour4: #8a89ba
td.oe_form_group_cell + .oe_form_group_cell
padding-left: 8px
.oe_form_subtotal_footer
width: auto
float: right
> div
text-align: right
padding: 3px
label
font-weight: normal !important
span
display: inline-block
min-width: 80px
td.oe_form_group_cell
text-align: right
padding: 0
td.oe_form_group_cell_label
border: none
.oe_form_field
width: auto !important
.oe_form_subtotal_footer_separator
border-top: 1px solid #cacaca
font-size: 120%
font-weight: bold
label
font-weight: bold !important
label.oe_form_subtotal_footer_separator
font-weight: bold !important
padding: 2px 8px 2px 0px !important
// }}}
// ListView {{{
.oe-listview-content
@@ -1876,6 +1877,25 @@ $colour4: #8a89ba
float: right
color: #333
// }}}
//view editor
.openerp
.oe_view_editor
width: 100%
border-collapse: collapse
margin-left: -12px
width: 100%
background-color: white
border-spacing: 0
td
text-align: center
white-space: nowrap
border: 1px solid #D8D8D8
cursor: pointer
font-size: 90%
.oe_view_editor_field td
border: 0px !important
.oe_view_editor tr:hover
background-color: #ecebf2
.kitten-mode-activated
background-image: url(http://placekitten.com/g/1365/769)
+3
View File
@@ -134,6 +134,9 @@ instance.web.format_value = function (value, descriptor, value_if_empty) {
case 'many2one':
// name_get value format
return value[1];
case 'one2many':
case 'many2many':
return _.str.sprintf(_t("(%d records)"), value.length);
case 'datetime':
if (typeof(value) == "string")
value = instance.web.auto_str_to_date(value);
+15 -15
View File
@@ -52,10 +52,11 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
this.view_edit_dialog.on_close.add_last(function(){window.location.reload();});
this.main_view_id = this.parent.fields_view.view_id;
this.action_manager = new instance.web.ActionManager(this);
this.action_manager.appendTo(this.view_edit_dialog);
$.when(this.action_manager.do_action(action)).then(function() {
var viewmanager = self.action_manager.inner_viewmanager,
controller = viewmanager.views[viewmanager.active_view].controller;
self.action_manager.appendTo(self.view_edit_dialog.$element);
self.action_manager.renderElement(self.view_edit_dialog);
controller.on_loaded.add_last(function(){
$(controller.groups).bind({
'selected': function(e, ids, records) {
@@ -630,11 +631,9 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
insert = _.intersection(_.flatten(temp_obj.att_list),_.uniq(check_list));
if (insert.length == _.uniq(check_list).length ) {return xml_child;}
});
xml_arch = QWeb.load_xml(arch.arch);
}
arch_to_pass = _.filter($(arch.arch), function (child) {
return child.nodeType == 1;
});
return self.do_save_xml(arch_to_pass[0], obj[0].child_id[0],obj[0].child_id, move_direct, update_values,arch);
return self.do_save_xml(xml_arch.documentElement, obj[0].child_id[0],obj[0].child_id, move_direct, update_values,arch);
},
get_object_by_id: function(id, one_object, result) {
var self = this;
@@ -708,12 +707,12 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
case "After":
self.edit_xml_dialog.$element.
find("tr[id='viewedit-"+after_append+"']").after(clone);
$(arch1).after(update_values[0]);
$(arch1).after($(update_values[0]));
child_list.splice(index + 1, 0, object_xml);
break;
case "Before":
tr_click.before(clone);
$(arch1).before(update_values[0]);
$(arch1).before($(update_values[0]));
child_list.splice(index - 1, 0, object_xml);
break;
case "Inside":
@@ -724,7 +723,7 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
self.do_parent_img_hide_show(this);
}));
}
$(arch1).append(update_values[0]);
$(arch1).append($(update_values[0]));
self.edit_xml_dialog.$element.
find("tr[id='viewedit-"+after_append+"']").after(clone);
obj.child_id.push(object_xml);
@@ -841,6 +840,7 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
'string' : {'name':'string', 'string': 'String', 'type': 'char'},
'required' : {'name':'required', 'string': 'Required', 'type': 'boolean'},
'readonly' : {'name':'readonly', 'string': 'Readonly', 'type': 'boolean'},
'invisible' : {'name':'invisible', 'string': 'Invisible', 'type': 'boolean'},
'domain' : {'name':'domain', 'string': 'Domain', 'type': 'char'},
'context' : {'name':'context', 'string': 'Context', 'type': 'char'},
'limit' : {'name':'limit', 'string': 'Limit', 'type': 'float'},
@@ -891,7 +891,7 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
var value = _.detect(arch_val[0]['att_list'],function(res) {
return res instanceof Array? _.include(res, widget.name): false;
});
value = value instanceof Array ? value[1] : value;
self.edit_node_dialog.$element.find('table[id=rec_table]').append('<tr><td align="right">' + widget.string + ':</td>' + type_widget.render() + '</tr>');
type_widget.start();
@@ -983,14 +983,14 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
self.add_node_dialog.$element.find('#new_field').click(function() {
model_data = new instance.web.DataSetSearch(self,'ir.model', null, null);
model_data.read_slice([], {domain: [['model','=', self.model]]}).then(function(result) {
self.render_new_field(result[0].id);
self.render_new_field(result[0]);
});
});
},
render_new_field :function(id){
render_new_field :function( result ) {
var self = this;
var action = {
context: {'default_model_id': id, 'manual': true},
context: {'default_model_id': result.id, 'manual': true, 'module' : result.modules},
res_model: "ir.model.fields",
views: [[false, 'form']],
type: 'ir.actions.act_window',
@@ -1007,7 +1007,7 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
});
controller.do_save.add_last(function(){
action_manager.destroy();
var value =controller.fields.name.value;
var value =controller.fields.name.get('value');
self.add_node_dialog.$element.find('select[id=field_value]').append($("<option selected></option>").attr("value",value).text(value));
_.detect(self.add_widget,function(widget){
widget.name == "field_value"? widget.selection.push(value): false;
@@ -1136,12 +1136,12 @@ instance.web.ViewEditor.FieldFloat = instance.web.ViewEditor.FieldChar.extend({
});
var _PROPERTIES = {
'field' : ['name', 'string', 'required', 'readonly', 'domain', 'context', 'nolabel', 'completion',
'field' : ['name', 'string', 'required', 'readonly','invisible', 'domain', 'context', 'nolabel', 'completion',
'colspan', 'widget', 'eval', 'ref', 'on_change', 'attrs', 'groups'],
'form' : ['string', 'col', 'link'],
'notebook' : ['colspan', 'position', 'groups'],
'page' : ['string', 'states', 'attrs', 'groups'],
'group' : ['string', 'col', 'colspan', 'states', 'attrs', 'groups'],
'group' : ['string', 'col', 'colspan','invisible', 'states', 'attrs', 'groups'],
'image' : ['filename', 'width', 'height', 'groups'],
'separator' : ['string', 'colspan', 'groups'],
'label': ['string', 'align', 'colspan', 'groups'],
+52 -43
View File
@@ -1048,6 +1048,7 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt
"modifiers": JSON.stringify({invisible: field_modifiers.invisible}),
"string": $field.attr('string'),
"help": $field.attr('help'),
"class": $field.attr('class'),
});
$label.insertBefore($field);
if (field_colspan > 1) {
@@ -1190,19 +1191,40 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt
var $page = $(this);
var page_attrs = $page.getAttributes();
page_attrs.id = _.uniqueId('notebook_page_');
pages.push(page_attrs);
var $new_page = self.render_element('FormRenderingNotebookPage', page_attrs);
$page.contents().appendTo($new_page);
$page.before($new_page).remove();
self.handle_common_properties($new_page, $page);
var ic = self.handle_common_properties($new_page, $page).invisibility_changer;
page_attrs.__page = $new_page;
page_attrs.__ic = ic;
pages.push(page_attrs);
$new_page.children().each(function() {
self.process($(this));
});
});
var $new_notebook = this.render_element('FormRenderingNotebook', { pages : pages });
$notebook.contents().appendTo($new_notebook);
$notebook.before($new_notebook).remove();
$new_notebook.children().each(function() {
self.process($(this));
});
self.process($($new_notebook.children()[0]));
//tabs and invisibility handling
$new_notebook.tabs();
_.each(pages, function(page, i) {
if (! page.__ic)
return;
page.__ic.on("change:effective_invisible", null, function() {
var current = $new_notebook.tabs("option", "selected");
if (! pages[current].__ic || ! pages[current].__ic.get("effective_invisible"))
return;
var first_visible = _.find(_.range(pages.length), function(i2) {
return (! pages[i2].__ic) || (! pages[i2].__ic.get("effective_invisible"));
});
if (first_visible !== undefined) {
$new_notebook.tabs('select', first_visible);
}
});
});
this.handle_common_properties($new_notebook, $notebook);
return $new_notebook;
},
@@ -1240,10 +1262,12 @@ instance.web.form.FormRenderingEngine = instance.web.form.FormRenderingEngineInt
handle_common_properties: function($new_element, $node) {
var str_modifiers = $node.attr("modifiers") || "{}"
var modifiers = JSON.parse(str_modifiers);
var ic = null;
if (modifiers.invisible !== undefined)
new instance.web.form.InvisibilityChanger(this.view, this.view, modifiers.invisible, $new_element);
ic = new instance.web.form.InvisibilityChanger(this.view, this.view, modifiers.invisible, $new_element);
$new_element.addClass($node.attr("class") || "");
$new_element.attr('style', $node.attr('style'));
return {invisibility_changer: ic,};
},
});
@@ -1381,15 +1405,15 @@ instance.web.form.InvisibilityChangerMixin = {
_.bind(check, this)();
},
start: function() {
var check_visibility = function() {
if (this.get("effective_invisible")) {
this.$element.hide();
} else {
this.$element.show();
}
};
this.on("change:effective_invisible", this, check_visibility);
_.bind(check_visibility, this)();
this.on("change:effective_invisible", this, this._check_visibility);
this._check_visibility();
},
_check_visibility: function() {
if (this.get("effective_invisible")) {
this.$element.hide();
} else {
this.$element.show();
}
},
};
@@ -1736,6 +1760,8 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(_.extend({
this.on("change:required", this, this._set_required);
this._set_required();
}
this._check_visibility();
this._check_css_flags();
},
/**
* Private. Do not use.
@@ -2753,9 +2779,12 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
}
view.options.not_interactible_on_create = true;
} else if (view.view_type === "kanban") {
view.options.confirm_on_delete = false;
if (self.get("effective_readonly")) {
view.options.action_buttons = false;
view.options.quick_creatable = false;
view.options.creatable = false;
view.options.read_only_mode = true;
}
}
views.push(view);
@@ -3105,7 +3134,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(_.
if (this.get("effective_readonly"))
return;
var self = this;
self. $text = $("textarea", this.$element);
self.$text = $("textarea", this.$element);
self.$text.textext({
plugins : 'tags arrow autocomplete',
autocomplete: {
@@ -3157,19 +3186,6 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(_.
return _.extend(el, {index:i});
})});
});
}).bind('tagClick', function(e, tag, value, callback) {
var pop = new instance.web.form.FormOpenPopup(self.view);
pop.show_element(
self.field.relation,
value.id,
self.build_context(),
{
title: _t("Open: ") + (self.string || self.name)
}
);
pop.on_write_completed.add_last(function() {
self.render_value();
});
}).bind('hideDropdown', function() {
self._drop_shown = false;
}).bind('showDropdown', function() {
@@ -3177,7 +3193,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(_.
});
self.tags = self.$text.textext()[0].tags();
$("textarea", this.$element).focusout(function() {
$("textarea", this.$element).val("");
self.$text.trigger("setInputData", "");
}).keydown(function(e) {
if (event.keyCode === 9 && self._drop_shown) {
self.$text.textext()[0].autocomplete().selectFromDropdown();
@@ -3213,17 +3229,6 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(_.
self.tags.addTags(_.map(data, function(el) {return {name: el[1], id:el[0]};}));
} else {
self.$element.html(QWeb.render("FieldMany2ManyTags.box", {elements: data}));
$(".oe_form_field_many2manytags_box", self.$element).click(function() {
var index = Number($(this).data("index"));
self.do_action({
type: 'ir.actions.act_window',
res_model: self.field.relation,
res_id: self.get("value")[index],
context: self.build_context(),
views: [[false, 'form']],
target: 'current'
});
});
}
};
if (! self.get('values') || self.get('values').length > 0) {
@@ -3416,6 +3421,8 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend(
'create_text': _t("Add"),
'creatable': self.get("effective_readonly") ? false : true,
'quick_creatable': self.get("effective_readonly") ? false : true,
'read_only_mode': self.get("effective_readonly") ? true : false,
'confirm_on_delete': false,
});
var embedded = (this.field.views || {}).kanban;
if (embedded) {
@@ -3562,6 +3569,7 @@ instance.web.form.Many2ManyQuickCreate = instance.web.Widget.extend({
var self = this;
self.$text.val("");
self.trigger('added', id);
this.m2m.dataset_changed();
},
});
}
@@ -3616,7 +3624,7 @@ instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({
width: '90%',
min_width: '800px',
close: function() {
self.check_exit();
self.check_exit(true);
},
title: this.options.title || "",
}, this.$element).open();
@@ -3674,9 +3682,10 @@ instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({
},
on_select_elements: function(element_ids) {
},
check_exit: function() {
check_exit: function(no_destroy) {
if (this.created_elements.length > 0) {
this.on_select_elements(this.created_elements);
this.created_elements = [];
}
this.destroy();
},
@@ -421,7 +421,8 @@ openerp.web.list_editable = function (instance) {
w.appendTo($td);
$td.appendTo($element);
});
$("<td><button class='oe-edit-row-save' type='button'>Save</button></td>").appendTo($element);
save = QWeb.render('ListView.row.save');
$(save).appendTo($element);
},
});
};
+6
View File
@@ -690,6 +690,12 @@
</td>
</tr>
<t t-name="ListView.row.save">
<td>
<button class='oe_i oe-edit-row-save' type='button' name='save'>S</button>
</td>
</t>
<t t-name="FormView">
<div class="oe_formview">
<div class="oe_form_buttons"/>
+57
View File
@@ -0,0 +1,57 @@
# Portuguese 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-06-05 19:47+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Portuguese <pt@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-06-06 05:04+0000\n"
"X-Generator: Launchpad (build 15353)\n"
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:11
msgid "Diagram"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:224
#: addons/web_diagram/static/src/js/diagram.js:257
msgid "Activity"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:208
#: addons/web_diagram/static/src/js/diagram.js:289
#: addons/web_diagram/static/src/js/diagram.js:308
msgid "Transition"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:214
#: addons/web_diagram/static/src/js/diagram.js:262
#: addons/web_diagram/static/src/js/diagram.js:314
msgid "Create:"
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/js/diagram.js:231
#: addons/web_diagram/static/src/js/diagram.js:232
#: addons/web_diagram/static/src/js/diagram.js:296
msgid "Open: "
msgstr ""
#. openerp-web
#: addons/web_diagram/static/src/xml/base_diagram.xml:5
#: addons/web_diagram/static/src/xml/base_diagram.xml:6
msgid "New Node"
msgstr ""
+2 -2
View File
@@ -107,8 +107,8 @@
box-sizing: border-box;
width: 100%;
}
.openerp .oe_kanban_view .oe_kanban_quick_create button {
float: right;
.openerp .oe_kanban_view .oe_kanban_quick_create .oe_kanban_quick_create_buttons {
margin-bottom: 10px;
}
.openerp .oe_kanban_view .oe_kanban_vignette {
padding: 8px;
+28 -8
View File
@@ -14,7 +14,13 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
number_of_color_schemes: 10,
init: function (parent, dataset, view_id, options) {
this._super(parent, dataset, view_id, options);
_.defaults(this.options, {"quick_creatable": true, "creatable": true, "create_text": undefined});
_.defaults(this.options, {
"quick_creatable": true,
"creatable": true,
"create_text": undefined,
"read_only_mode": false,
"confirm_on_delete": true,
});
this.fields_view = {};
this.fields_keys = [];
this.group_by = null;
@@ -417,7 +423,7 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
this.quick.destroy();
delete this.quick;
});
self.quick.appendTo(self.$element.find('.oe_kanban_header'));
self.quick.appendTo($(".oe_kanban_group_list_header", self.$records));
self.quick.focus();
});
this.$records.find('.oe_kanban_show_more').click(this.do_show_more);
@@ -466,7 +472,7 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
rec.insertBefore(self.$records.find('.oe_kanban_show_more'));
self.records.push(rec);
} else {
rec.prependTo(self.$records);
rec.insertAfter($(".oe_kanban_group_list_header", self.$records));
self.records.unshift(rec);
}
});
@@ -503,7 +509,7 @@ instance.web_kanban.KanbanGroup = instance.web.OldWidget.extend({
this.dataset.read_ids([id], this.view.fields_keys)
.then(function (records) {
self.view.dataset.ids.push(id);
self.do_add_records(records, 'prepend');
self.do_add_records(records, true);
});
}
});
@@ -550,7 +556,8 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
render: function() {
this.qweb_context = {
record: this.record,
widget: this
widget: this,
read_only_mode: this.view.options.read_only_mode,
};
for (var p in this) {
if (_.str.startsWith(p, 'kanban_')) {
@@ -625,7 +632,9 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
return false;
});
this.$element.on('click', this.on_card_clicked);
if (this.$element.find('.oe_kanban_global_click').length) {
this.$element.on('click', this.on_card_clicked);
}
},
on_card_clicked: function() {
this.view.trigger('hide_menus');
@@ -653,12 +662,18 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
},
do_action_delete: function($action) {
var self = this;
if (confirm(_t("Are you sure you want to delete this record ?"))) {
return $.when(this.view.dataset.unlink([this.id])).then(function() {
function do_it() {
return $.when(self.view.dataset.unlink([self.id])).then(function() {
self.group.remove_record(self.id);
self.destroy();
});
}
if (this.view.options.confirm_on_delete) {
if (confirm(_t("Are you sure you want to delete this record ?"))) {
return do_it();
}
} else
return do_it();
},
do_action_edit: function($action) {
var self = this;
@@ -775,6 +790,11 @@ instance.web_kanban.QuickCreate = instance.web.Widget.extend({
$(".oe-kanban-quick_create_close", this.$element).click(function () {
self.trigger('close');
});
self.$input.keyup(function(e) {
if (e.keyCode == 27 && self._buttons) {
self.trigger('close');
}
});
},
focus: function() {
this.$element.find('input').focus();
@@ -48,6 +48,7 @@
</t>
<t t-name="KanbanView.group_records_container">
<td t-attf-class="oe_kanban_column #{widget.group ? 'oe_kanban_grouped' : 'oe_kanban_ungrouped'}">
<div class="oe_kanban_group_list_header"/>
<div class="oe_kanban_show_more">
<button class="oe_button">Show more... (<span class="oe_kanban_remaining"></span> remaining)</button>
</div>
@@ -64,10 +65,12 @@
</li>
</t>
<div t-name="KanbanView.quick_create" class="oe_kanban_quick_create">
<input t-att-placeholder="_t('Type name to create')"/>
<input t-att-placeholder="_t('Create a new record')"/>
<t t-if="widget._buttons">
<button class="oe-kanban-quick_create_add">Add</button>
<button class="oe-kanban-quick_create_close">Close</button>
<div class="oe_kanban_quick_create_buttons">
<button class="oe-kanban-quick_create_add">Add</button>
or <a class="oe-kanban-quick_create_close">Cancel</a>
</div>
</t>
</div>
</template>