Merge lp:~unifield-team/unifield-web/us-1438 into lp:unifield-web

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 4796
Proposed branch: lp:~unifield-team/unifield-web/us-1438
Merge into: lp:unifield-web
Diff against target: 21 lines (+9/-2)
1 file modified
addons/openerp/widgets/form/_form.py (+9/-2)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/us-1438
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+299938@code.launchpad.net
To post a comment you must log in.
4796. By Quentin THEURET @Amaris

US-1438 [FIX] Check 'readonly' on 'attrs' keys of field attributes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/widgets/form/_form.py'
2--- addons/openerp/widgets/form/_form.py 2016-05-30 07:17:39 +0000
3+++ addons/openerp/widgets/form/_form.py 2016-07-19 15:22:24 +0000
4@@ -952,8 +952,15 @@
5 continue
6 try:
7 fields[name]['link'] = attrs.get('link', '1')
8- if fields[name].get('no_write_access') and 'attrs' in attrs:
9- del attrs['attrs']
10+ if fields[name].get('no_write_access') and 'attrs' in attrs and 'readonly' in attrs['attrs']:
11+ attrs_dict = eval(attrs['attrs'])
12+ if 'readonly' in attrs_dict:
13+ del attrs_dict['readonly']
14+
15+ if attrs_dict:
16+ attrs['attrs'] = unicode(attrs_dict)
17+ else:
18+ del attrs['attrs']
19 fields[name].update(attrs)
20 except:
21 print "-"*30,"\n malformed tag for:", attrs

Subscribers

People subscribed via source and target branches

to all changes: