Merge lp:~unifield-team/unifield-web/OEB38_m2o_editable into lp:unifield-web

Proposed by Matthieu Dietrich @ camptocamp
Status: Merged
Merged at revision: 4554
Proposed branch: lp:~unifield-team/unifield-web/OEB38_m2o_editable
Merge into: lp:unifield-web
Diff against target: 16 lines (+5/-1)
1 file modified
addons/openerp/static/javascript/m2o.js (+5/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/OEB38_m2o_editable
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+67054@code.launchpad.net
To post a comment you must log in.
4552. By Matthieu Dietrich @ camptocamp

[FIX] OEB-38: m2o: field can become non-editable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/static/javascript/m2o.js'
2--- addons/openerp/static/javascript/m2o.js 2011-06-22 09:33:54 +0000
3+++ addons/openerp/static/javascript/m2o.js 2011-07-06 14:51:42 +0000
4@@ -412,7 +412,11 @@
5 m2o.on_change();
6 } else {
7 var id = jQuery(m2o.field).attr('id');
8- jQuery(idSelector(id + '_text')).val('');
9+ // If the text on m2o field is related to any existing ID,
10+ // we won't set the text to blank while clicking on search
11+ if (!m2o.field.value) {
12+ jQuery(idSelector(id + '_text')).val('');
13+ }
14 open_search_window(m2o.relation, domain, context, m2o.name, 1, text);
15 }
16 }, 'json');

Subscribers

People subscribed via source and target branches

to all changes: