Merge lp:~credativ/ocb-web/7.0-lp1153853 into lp:ocb-web

Proposed by Craig Gowing (credativ) on 2014-06-12
Status: Rejected
Rejected by: Holger Brunn (Therp) on 2014-11-24
Proposed branch: lp:~credativ/ocb-web/7.0-lp1153853
Merge into: lp:ocb-web
Diff against target: 49 lines (+19/-5)
2 files modified
addons/web/static/src/js/view_form.js (+6/-4)
addons/web/static/src/xml/base.xml (+13/-1)
To merge this branch: bzr merge lp:~credativ/ocb-web/7.0-lp1153853
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) 2014-06-12 Disapprove on 2014-11-24
Review via email: mp+222935@code.launchpad.net
To post a comment you must log in.
lp:~credativ/ocb-web/7.0-lp1153853 updated on 2014-06-24
4200. By Craig Gowing (credativ) on 2014-06-24

[FIX] Prevent form fields from turning into inputs, only fields in an embedded tree view

Holger Brunn (Therp) (hbrunn) wrote :

please make a pull request for https://github.com/OCA/OCB if you still consider this fix relevant.

Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on https://github.com/OCA/ocb - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

4200. By Craig Gowing (credativ) on 2014-06-24

[FIX] Prevent form fields from turning into inputs, only fields in an embedded tree view

4199. By Craig Gowing (credativ) on 2014-06-12

[FIX] Allow readonly text fields to be updated with an onchange handler in a tree view

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 2014-04-18 09:20:33 +0000
3+++ addons/web/static/src/js/view_form.js 2014-06-24 09:32:08 +0000
4@@ -2283,14 +2283,16 @@
5 },
6 render_value: function() {
7 var show_value = this.format_value(this.get('value'), '');
8- if (!this.get("effective_readonly")) {
9- this.$el.find('input').val(show_value);
10- } else {
11+ if (this.get("effective_readonly")) {
12 if (this.password) {
13 show_value = new Array(show_value.length + 1).join('*');
14 }
15- this.$(".oe_form_char_content").text(show_value);
16+ if (this.get("effective_invisible") && this.get("readonly") && !this.get("invisible") && this.name != "sequence") {
17+ this.set({"effective_invisible": false});
18+ }
19 }
20+ this.$el.find('input').val(show_value);
21+ this.$(".oe_form_char_content").text(show_value);
22 },
23 is_syntax_valid: function() {
24 if (!this.get("effective_readonly") && this.$("input").size() > 0) {
25
26=== modified file 'addons/web/static/src/xml/base.xml'
27--- addons/web/static/src/xml/base.xml 2014-04-09 09:34:22 +0000
28+++ addons/web/static/src/xml/base.xml 2014-06-24 09:32:08 +0000
29@@ -1025,7 +1025,19 @@
30 /><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"/>
31 </t>
32 <t t-if="widget.get('effective_readonly')">
33- <span class="oe_form_char_content"></span>
34+ <t t-if="!widget.get('effective_invisible')">
35+ <span class="oe_form_char_content"></span>
36+ </t>
37+ <t t-if="widget.get('effective_invisible')">
38+ <input t-att-type="widget.password ? 'password' : 'text'"
39+ t-att-id="widget.id_for_label"
40+ t-att-tabindex="widget.node.attrs.tabindex"
41+ t-att-autofocus="widget.node.attrs.autofocus"
42+ t-att-placeholder="widget.node.attrs.placeholder"
43+ t-att-maxlength="widget.field.size"
44+ disabled="disabled"
45+ />
46+ </t>
47 </t>
48 </span>
49 </t>

Subscribers

People subscribed via source and target branches