~unifield-team/unifield-web/uf-2235

« back to all changes in this revision

Viewing changes to addons/openerp/widgets/_interface.py

  • Committer: jf
  • Date: 2013-05-24 16:03:21 UTC
  • mfrom: (4708.1.2 unifield-web)
  • Revision ID: jfb@tempo-consulting.fr-20130524160321-an28w20b8lsl3vq1
UF-748 [FIX] js performance
OEB-101 [FIX] exponential call to form_onAttrChange
lp:~unifield-team/unifield-web/web-UF-748

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
            editable=self.editable,
215
215
            inline=self.inline,
216
216
            attrs={
 
217
                'attrs': self.attributes or None,
217
218
                'change_default': self.change_default or None,
218
219
                'callback': self.callback or None,
219
220
                'onchange': self.onchange
221
222
 
222
223
        if self.readonly:
223
224
            params['attrs']['disabled'] = 'disabled'
 
225
        if self.states:
 
226
            states = self.states
 
227
            # convert into JS
 
228
            if isinstance(states, dict):
 
229
                states = dict([(k, dict(v)) for k, v in states.iteritems()])
 
230
            params['attrs']['states'] = simplejson.dumps(states)
224
231
 
225
232
 
226
233
class ConcurrencyInfo(TinyInputWidget):