contoh dengan xml dan menuitem
<record id="me_action_res_company_form" model="ir.actions.act_window">
<field name="name">Companies</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="res_model">res.company</field>
<field name="res_id">1</field>
<field name="target">current</field>
<field name="help">Create and manage the companies that will be managed by Odoo from here. Shops or subsidiaries can be created and maintained from here.</field>
</record>
<menuitem
parent="me_menu_pos_setting_root"
id="me_menu_pos_company"
action="me_action_res_company_form"
name="Company"/>
kalau dengan function di python codenya
def open_company(self, cr, uid, ids, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context)
return {
'type': 'ir.actions.act_window',
'name': 'My Company',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'res.company',
'res_id': user.company_id.id,
'target': 'current',
}
<button type="object" name="open_company" string="Configure your company data" icon="fa-cogs" class="oe_inline oe_link"/>
kurang lebih seperti itu
Tambahkan Komentar