How to Modify Odoo Action Window

like adding or removing kanban view, etc

vITraining Admin

Some times we need to 'override' the action window of an Odoo object. Action window is not overridable but we must replace it entirely to modify it.

Example, to remove the kanban view at the hr.applicant views.

The original action window is:

<record model="ir.actions.act_window" id="action_hr_job_applications">
 <field name="name">Applications</field>
 <field name="res_model">hr.applicant</field>
 <field name="view_mode">kanban,tree,form,graph,calendar,pivot</field>
 <field name="context">{'search_default_job_id': [active_id], 'default_job_id': active_id}</field>
 <field name="help" type="html">
 <p>
 Odoo helps you track applicants in the recruitment
 process and follow up all operations: meetings, interviews, etc.
     </p>
<p>
 Applicants and their attached CV are created automatically when an email is sent.
         If you install the document management modules, all resumes are indexed automatically,
 so that you can easily search through their content.
    </p>
 </field>
</record>


Then, at our addon XML, copy that code entirely, and replace the content as needed (example, remove the kanban view options):

<record model="ir.actions.act_window" id="action_hr_job_applications"> 
<field name="name">Applications</field>
<field name="res_model">hr.applicant</field>
<field name="view_mode">tree,form,graph,calendar,pivot</field>
<field name="context">{'search_default_job_id': [active_id], 'default_job_id': active_id}</field>
<field name="help" type="html">
 <p>
Odoo helps you track applicants in the recruitment
  process and follow up all operations: meetings, interviews, etc.
 </p>
<p>
 Applicants and their attached CV are created automatically when an email is sent.
  If you install the document management modules, all resumes are indexed automatically,
  so that you can easily search through their content.
 </p>
</field>
</record>


This is part of Advanced Odoo Programming provided by vitraining.com. For more schedule and information please click shop.vitraining.com/page/traning