Reputation: 183
<record model="ir.actions.act_window" id="open_gtd_all_tasks_pci">
<field name="name">Tasks (GTD)</field>
<field name="res_model">project.task</field>
<field name="search_view_id" ref="project_gtd.view_task_gtd_search"/>
<field name="context">{'set_visible': True, 'gtd': True, 'search_default_timebox_id': 1, 'search_default_open': 1, 'search_default_open_project': 1, 'hide_stage': 0}</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
</record>
<record id="planningtask_calendar_view_inherit" model="ir.ui.view">
<field name="name">ic.team.planning.task.calendar.inherit</field>
<field name="model">ic.team.planning.task</field>
<field name="inherit_id" ref="ic_project_issue.ic_team_planning_task_calendar_view"/>
<field name="arch" type="xml">
<xpath expr="//calendar[@string='Team Planning']" position="attributes">
<attribute name="mode">week</attribute>
</xpath>
</field>
</record>
what different res_model with model,what the effect , when use model or res_model? i need explained :-)
Upvotes: 2
Views: 3303
Reputation: 2892
Here we have major different between res_model and model,
For Odoo Action of View:
model :
In model action is important for base record for the database table hear which is used to store the particular action of that record id.
In your example :
model="ir.actions.act_window"
As a ir_actions_act_window database table
id="open_gtd_all_tasks_pci"
As a unique id for that action table record
which is used to create a new record with the id,res_model,search_view_id,context,view_type,view_mode with ir_actions_act_window database
table
res_model :
Action of the particular model
For Odoo Design of View:
for model="ir.ui.view"
for the record as ir_ui_view database table to store a new record as planningtask_calendar_view_inherit
unique id
and same as for name,model,inherit_id fields for storing the record.
hear model field is for desgin the view for that particular model (database table).
In generally Odoo(OpenERP) understand . (dot) with particular model name and make it as _(underscore) and store that record it as the database table.
like res.partner
module Odoo (formally OpenERP) treat as res_partner
database table.
Upvotes: 3