Skip to Content
Menu
This question has been flagged
1 Reply
3328 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
Related Posts Replies Views Activity
1
Apr 24
1473
1
Dec 23
2743
1
Oct 23
6959
2
Nov 22
2421
0
Nov 22
2739