Merge lp:~openerp-commiter/openerp-web/trunk-bug-985005-psa into lp:openerp-web

Proposed by Paramjit Singh Sahota(OpenERP)
Status: Rejected
Rejected by: Nicolas Vanhoren (OpenERP)
Proposed branch: lp:~openerp-commiter/openerp-web/trunk-bug-985005-psa
Merge into: lp:openerp-web
Diff against target: 22 lines (+3/-2)
1 file modified
addons/web/static/src/js/view_form.js (+3/-2)
To merge this branch: bzr merge lp:~openerp-commiter/openerp-web/trunk-bug-985005-psa
Reviewer Review Type Date Requested Status
Nicolas Vanhoren (OpenERP) (community) Disapprove
Review via email: mp+108293@code.launchpad.net

Description of the change

Hello,

   I have modified code for set and get readonly modifers.

Thanks & Regards,
PSA (Paramjit).

To post a comment you must log in.
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Why would we want to handle the readonly property in buttons??? That has no sense, can you edit a button??

review: Disapprove
Revision history for this message
Numérigraphe (numerigraphe) wrote :

For what it's worth: in the GTK client, readonly buttons are displayed, inactive and grayed out. It does make sense.
Lionel.

Unmerged revisions

2491. By Paramjit Singh Sahota(OpenERP)

[FIX][Trunk] Attrs readonly condition works not properly.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2012-05-31 16:06:12 +0000
3+++ addons/web/static/src/js/view_form.js 2012-06-01 07:01:22 +0000
4@@ -1510,6 +1510,7 @@
5 init: function(view, node) {
6 this._super(view, node);
7 this.force_disabled = false;
8+ this.set({"readonly": this.modifiers['readonly'] === true}); //setting the value to readonly
9 this.string = (this.node.attrs.string || '').replace(/_/g, '');
10 if (this.node.attrs.default_focus == '1') {
11 // TODO fme: provide enter key binding to widgets
12@@ -1583,8 +1584,8 @@
13 self.view.reload();
14 });
15 },
16- check_disable: function() {
17- var disabled = (this.force_disabled || !this.view.is_interactible_record());
18+ check_disable: function() {
19+ var disabled = (this.get('readonly') || this.force_disabled || !this.view.is_interactible_record());
20 this.$element.prop('disabled', disabled);
21 this.$element.css('color', disabled ? 'grey' : '');
22 }