This question has been flagged
1 Reply
3103 Views

Hi,

I found these below in Odoo 12 source code and I don't really understand which model will be use: "mail.activity.type" or "hr.expense.sheet".

And we should use it in which situation? Thank you!

<record id="mail_activity_type_action_config_hr_expense" model="ir.actions.act_window">
<field name="name">Activity Types</field>
<field name="res_model">mail.activity.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('res_model_id', '=', False), ('res_model_id.model', '=', 'hr.expense.sheet')]</field>
<field name="context">{'default_res_model': 'hr.expense.sheet'}</field>
</record>
Avatar
Discard
Best Answer

It is the action for 'mail.activity.type'.

The context let you define default values for fields (not only). Thus, in case you use this action, all new activity types would get by default the value for the field 'res_model' as 'hr.expense.sheet'. For example, 'default_name': 'Some name' will make default name as 'Some name'

Avatar
Discard