[IMP] base_setup : set type object for button Header & footer

bzr revid: dbr@tinyerp.com-20120403122156-uiz1jehgb3zq1a6t
This commit is contained in:
DBR (OpenERP)
2012-04-03 17:51:56 +05:30
parent ec8d647a84
commit ea29fb6bf4
2 changed files with 23 additions and 2 deletions
+22 -1
View File
@@ -40,6 +40,27 @@ class general_configuration(osv.osv_memory):
help ="""It installs the report_webkit_sample module."""),
}
def base_setup_company(self, cr, uid, ids, context=None):
if context is None:
context = {}
data_obj = self.pool.get('ir.model.data')
user = self.pool.get('res.users').browse(cr, uid, uid)
context.update({'res_id': user.company_id.id})
company_view_id = data_obj.get_object_reference(cr, uid, 'base', 'view_company_form')
if company_view_id:
company_view_id = company_view_id and company_view_id[1] or False
return {
'view_mode': 'form',
'view_type': 'form',
'res_model': 'res.company',
'res_id': int(context.get('res_id')),
'views': [(company_view_id, 'form')],
'type': 'ir.actions.act_window',
'target': 'current',
'nodestroy':True,
'context': context,
}
general_configuration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -1
View File
@@ -10,7 +10,7 @@
<separator string="General Setting" colspan="4"/>
<group colspan="4" col="4">
<label string="Set Company Header and Footer :"/>
<button name="%(base_setup.action_base_setup_company)d" string="Header and Footer" type="action" icon="gtk-apply"/>
<button name="base_setup_company" string="Header and Footer" type="object" icon="gtk-apply"/>
<field name="module_multi_company"/>
<field name="module_share"/>
</group>