← Back to team overview

credativ team mailing list archive

[Merge] lp:~credativ/openerp-web/7.0-lp1153853 into lp:openerp-web/7.0

 

Craig Gowing (credativ) has proposed merging lp:~credativ/openerp-web/7.0-lp1153853 into lp:openerp-web/7.0.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1153853 in OpenERP Server: "On change method doesn't update inline editing read only value"
  https://bugs.launchpad.net/openobject-server/+bug/1153853

For more details, see:
https://code.launchpad.net/~credativ/openerp-web/7.0-lp1153853/+merge/222938
-- 
https://code.launchpad.net/~credativ/openerp-web/7.0-lp1153853/+merge/222938
Your team credativ is subscribed to branch lp:~credativ/openerp-web/7.0-lp1153853.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2014-04-18 09:20:33 +0000
+++ addons/web/static/src/js/view_form.js	2014-06-12 12:38:29 +0000
@@ -2283,14 +2283,15 @@
     },
     render_value: function() {
         var show_value = this.format_value(this.get('value'), '');
-        if (!this.get("effective_readonly")) {
-            this.$el.find('input').val(show_value);
-        } else {
+        if (this.get("effective_readonly")) {
             if (this.password) {
                 show_value = new Array(show_value.length + 1).join('*');
             }
-            this.$(".oe_form_char_content").text(show_value);
+            if (this.get("effective_invisible") && this.get("readonly") && !this.get("invisible") && this.name != "sequence") {
+                this.set({"effective_invisible": false});
+            }
         }
+        this.$el.find('input').val(show_value);
     },
     is_syntax_valid: function() {
         if (!this.get("effective_readonly") && this.$("input").size() > 0) {

=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml	2014-04-09 09:34:22 +0000
+++ addons/web/static/src/xml/base.xml	2014-06-12 12:38:29 +0000
@@ -1025,7 +1025,14 @@
             /><img class="oe_field_translate oe_input_icon" t-if="widget.field.translate" t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"' width="16" height="16" border="0"/>
         </t>
         <t t-if="widget.get('effective_readonly')">
-            <span class="oe_form_char_content"></span>
+            <input t-att-type="widget.password ? 'password' : 'text'"
+                t-att-id="widget.id_for_label"
+                t-att-tabindex="widget.node.attrs.tabindex"
+                t-att-autofocus="widget.node.attrs.autofocus"
+                t-att-placeholder="widget.node.attrs.placeholder"
+                t-att-maxlength="widget.field.size"
+                disabled="disabled"
+            />
         </t>
     </span>
 </t>
@@ -1066,7 +1073,15 @@
             />            
         </t>
         <t t-if="widget.get('effective_readonly')">
-            <span class="oe_form_text_content"></span>
+            <textarea rows="6"
+                t-att-name="widget.name"
+                class="field_text"
+                t-att-tabindex="widget.node.attrs.tabindex"
+                t-att-autofocus="widget.node.attrs.autofocus"
+                t-att-placeholder="! widget.get('effective_readonly') ? widget.node.attrs.placeholder : ''"
+                t-att-maxlength="widget.field.size"
+                disabled="disabled"
+            />
         </t>
     </div>
 </t>