[ADD] save button instead of selector during edition

bzr revid: xmo@openerp.com-20120703102750-1vmoljtbrnnl3lzo
This commit is contained in:
Xavier Morel
2012-07-03 12:27:50 +02:00
parent a5940c4147
commit ae6c6eb8ec
3 changed files with 38 additions and 3 deletions
+14
View File
@@ -2115,6 +2115,20 @@
.openerp .oe-listview-content .numeric input {
text-align: right;
}
.openerp .oe-listview-content tr.oe_edition th.oe-record-selector {
padding: 0 6px;
font-size: 1px;
letter-spacing: -1px;
color: transparent;
}
.openerp .oe-listview-content tr.oe_edition th.oe-record-selector:before {
font: 21px "mnmliconsRegular";
content: "S";
color: #404040;
}
.openerp .oe-listview-content tr.oe_edition th.oe-record-selector input {
display: none;
}
.openerp .oe_trad_field.touched {
border: 1px solid green !important;
}
+7 -2
View File
@@ -83,9 +83,8 @@ $colour4: #8a89ba
letter-spacing: -1px
color: transparent
&:before
font-family: "mnmliconsRegular"
font: 21px "mnmliconsRegular"
content: $icon-name
font-size: 20px
color: $color
// }}}
@@ -1667,6 +1666,12 @@ $colour4: #8a89ba
width: 82px
input
text-align: right
tr.oe_edition th.oe-record-selector
padding: 0 6px
@include text-to-icon("S")
input
display: none
// }}}
// Translation {{{
.oe_trad_field.touched
+17 -1
View File
@@ -169,6 +169,8 @@ openerp.web.list_editable = function (instance) {
});
}],
[record.attributes]);
}).then(function () {
$recordRow.addClass('oe_edition')
});
},
getCellsFor: function ($row) {
@@ -343,7 +345,6 @@ openerp.web.list_editable = function (instance) {
return form.do_show({reload: false});
}).pipe(function () {
self.record = record;
// TODO: [Save] button
// TODO: save on action button?
_(form.fields).each(function (field, name) {
configureField(name, field);
@@ -412,6 +413,21 @@ openerp.web.list_editable = function (instance) {
});
instance.web.ListView.List.include(/** @lends instance.web.ListView.List# */{
init: function () {
var self = this;
this._super.apply(this, arguments);
var selection_handler = _.find(this.$_element.data('events').click, function (h) {
return h.selector === 'th.oe-record-selector';
}).handler;
// TODO: cleaner way to do that?
this.$_element
.off('click', 'th.oe-record-selector')
.on('click', '.oe_edition th.oe-record-selector', function (e) {
e.stopImmediatePropagation();
self.view.saveEdition();
})
.on('click', 'th.oe-record-selector', selection_handler);
},
row_clicked: function (event) {
if (!this.options.editable) {
return this._super.apply(this, arguments);