Merge lp:~openerp-dev/openobject-client/6.1-opw-575612-rgo into lp:openobject-client/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: 2065
Merged at revision: 2069
Proposed branch: lp:~openerp-dev/openobject-client/6.1-opw-575612-rgo
Merge into: lp:openobject-client/6.1
Diff against target: 21 lines (+3/-5)
1 file modified
bin/widget/model/field.py (+3/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.1-opw-575612-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+109359@code.launchpad.net

Description of the change

Hello,

Steps to reproduce this issue:

1 - create a account_move entry manually.
2 - confirm and then set to draft by cancel button (need account_cancel) enabled.
3 - you can see that all the fields have remained as read-only.
if you come out of the form view and enter it again, it will work as it should again.

This fix fixes this issue, kindly review it.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget/model/field.py'
2--- bin/widget/model/field.py 2011-12-09 09:33:16 +0000
3+++ bin/widget/model/field.py 2012-06-08 13:21:19 +0000
4@@ -159,15 +159,13 @@
5 ro = model.mgroup._readonly
6 state_changes = dict(self.attrs.get('states',{}).get(state,[]))
7 if 'readonly' in state_changes:
8- self.get_state_attrs(model)['readonly'] = state_changes.get('readonly', False)
9+ self.get_state_attrs(model)['readonly'] = state_changes.get('readonly', False) or ro
10 else:
11- if self.attrs.get('readonly', False) or ro:
12- self.get_state_attrs(model)['readonly'] = True
13+ self.get_state_attrs(model)['readonly'] = self.attrs.get('readonly', False) or ro
14 if 'required' in state_changes:
15 self.get_state_attrs(model)['required'] = state_changes.get('required', False)
16 else:
17- if self.attrs.get('required', False):
18- self.get_state_attrs(model)['required'] = self.attrs['required']
19+ self.get_state_attrs(model)['required'] = self.attrs.get('required', False)
20 if 'value' in state_changes:
21 self.set(model, state_changes['value'], modified=True)
22

Subscribers

People subscribed via source and target branches