[IMP] base_setup : set type object for button Header & footer
bzr revid: dbr@tinyerp.com-20120403122156-uiz1jehgb3zq1a6t
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user