if update:
    doc = etree.XML(res['arch'])
if not can_create:
    for t in doc.xpath('//' + view_type):
        t.attrib['create'] = 'false'
res['arch'] = etree.tostring(doc)
return res
Odoo/OpenERP: hiding create button from treeview