~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to msf_button_access_rights/ir_ui_view.py

[FIX] undefined variable. view parsing mechanism.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
            try:
65
65
                buttons = self.parse_view(vals['arch'], model_id[0], view_id)
66
66
            except (ValueError, etree.XMLSyntaxError) as e:
67
 
                logging.getLogger(self._name).warn('Error when parsing view %s' % i)
 
67
                logging.getLogger(self._name).warn('Error when parsing view %s' % view_id)
68
68
                print e
69
69
                buttons = False
70
70
                
175
175
        button_object_list = []
176
176
        
177
177
        if view_xml_text:
178
 
            view_xml = etree.fromstring(view_xml_text.encode('utf8'))
 
178
            view_xml = etree.fromstring(isinstance(view_xml_text, unicode) and view_xml_text.encode('utf8') or view_xml_text)
179
179
            buttons = view_xml.xpath("//button[ @name and @type != 'special' and not (@position) ]")
180
180
            
181
181
            for button in buttons: