From ef954a8a957bddafbf7eb67418a4300892f88997 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 14 Dec 2011 18:29:52 +0100 Subject: [PATCH] [ADD] ListView: Added pencil icon linking to form view bzr revid: fme@openerp.com-20111214172952-xp4c6h6fccbyzt8r --- addons/web/static/src/css/base.css | 6 ++++- addons/web/static/src/img/pencil.gif | Bin 0 -> 129 bytes addons/web/static/src/js/view_list.js | 25 ++++++++++++------ .../web/static/src/js/view_list_editable.js | 7 +++-- addons/web/static/src/xml/base.xml | 8 +++++- 5 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 addons/web/static/src/img/pencil.gif diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 04fff6c9375..4bc0575a797 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -822,9 +822,12 @@ label.error { border-bottom: 1px solid #E3E3E3; } -.openerp .oe-listview .oe-record-selector { +.openerp .oe-listview .oe-record-selector, .openerp .oe-listview .oe-record-edit-link { border-bottom: 1px solid #E3E3E3; } +.openerp .oe-listview .oe-record-edit-link { + cursor: pointer; +} .openerp .oe-listview .oe-field-cell { cursor: pointer; @@ -1193,6 +1196,7 @@ label.error { } .openerp .oe_datepicker_root { display: inline-block; + width: 100%; } .openerp .oe_forms.oe_frame .oe_datepicker_root { width: 100%; diff --git a/addons/web/static/src/img/pencil.gif b/addons/web/static/src/img/pencil.gif new file mode 100644 index 0000000000000000000000000000000000000000..6e9aa5ef6599bb02e966d34994cc9f42a126ea5f GIT binary patch literal 129 zcmZ?wbhEHb'); } + if (this.options.edit_link) { + cells.push(''); + } _(this.columns).each(function(column) { if (column.invisible === '1') { return; diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index b2edf55b314..50a3028d837 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -116,7 +116,7 @@ openerp.web.list_editable = function (openerp) { openerp.web.ListView.List.include(/** @lends openerp.web.ListView.List# */{ row_clicked: function (event) { if (!this.options.editable) { - return this._super(event); + return this._super.apply(this, arguments); } this.edit_record($(event.currentTarget).data('id')); }, @@ -248,7 +248,10 @@ openerp.web.list_editable = function (openerp) { .end() .find('td:last').removeClass('oe-field-cell').end(); if (self.options.selectable) { - $new_row.prepend(''); + $new_row.prepend(''); + } + if (self.options.edit_link) { + $new_row.prepend(''); } // pad in case of groupby _(self.columns).each(function (column) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index cf517fef490..503e6ac3318 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -567,7 +567,7 @@ - + + @@ -666,6 +668,9 @@ +
@@ -596,6 +596,7 @@ @@ -609,6 +610,7 @@
+ + + +