diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-12-22 13:49:13 +0100 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-12-22 13:49:13 +0100 |
| commit | e05b605dca8c8cf02fec9d94cd080822792f930f (patch) | |
| tree | 78f5d65ddb14ef1c3464e63374c61c9411108ffd /addons/web/static/src | |
| parent | 8631222f1a52e962649fe0d1195b73e64e65add7 (diff) | |
| parent | d31512342a11480a3b0b2860e7e79a9f70047c91 (diff) | |
[fix] problem with list view in o2m and buttons that should be disabled in some cases
lp bug: https://launchpad.net/bugs/884207 fixed
bzr revid: nicolas.vanhoren@openerp.com-20111222124913-fezv69rxh7xoulkm
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base.css | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/formats.js | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index f2d80fff715..7392c1e9922 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -894,6 +894,10 @@ label.error { opacity: 0.75; } +.openerp .oe-listview .oe-field-cell .oe-listview-button-disabled img { + opacity: 0.5; +} + .openerp .oe-listview th.oe-actions { text-align: left; white-space: nowrap; diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 264cc836e2d..da89073ea68 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -252,14 +252,17 @@ openerp.web.format_cell = function (row_data, column, value_if_empty, process_mo } if (attrs.invisible) { return ''; } if (column.tag === 'button') { - return [ - '<button type="button" title="', column.string || '', '">', - '<img src="', openerp.connection.prefix, '/web/static/src/img/icons/', column.icon, '.png"', - ' alt="', column.string || '', '"/>', - '</button>' - ].join('') + return _.template('<button type="button" title="<%-title%>" <%=additional_attributes%> >' + + '<img src="<%-prefix%>/web/static/src/img/icons/<%-icon%>.png" alt="<%-alt%>"/>' + + '</button>', { + title: column.string || '', + additional_attributes: isNaN(row_data["id"].value) && openerp.web.BufferedDataSet.virtual_id_regex.test(row_data["id"].value) ? + 'disabled="disabled" class="oe-listview-button-disabled"' : '', + prefix: openerp.connection.prefix, + icon: column.icon, + alt: column.string || '', + }); } - if (!row_data[column.id]) { return value_if_empty === undefined ? '' : value_if_empty; } |
