Files
odoo_source/addons/hr/views/hr_job_views.xml
T
Denis Ledoux 141852dc66 [IMP] mail: hide Unread messages filter for email notification users
The goal of this revision is to add a group
`mail.group_mail_notification_type_inbox` which is granted
automatically when the user `notification_type` is set to `Inbox`
to be able to easily hide the filter `Unread messages` when
the user uses the `Email` notification type,
by simply adding `groups="mail.group_mail_notification_type_inbox"`
on the filter rather than overriding `_get_view` in every model.

The code overriding `_get_view` of `project.task`
to hide the filter "Unread messages" replaced
in this revision initially comes from
odoo/odoo@da868d28e2

> - In project.task search View:
>   - the filter for unread messages should be visible only if the current user
>     managing his notifications in Odoo

The above revision was part of the task 2844212

closes odoo/odoo#104328

Related: odoo/enterprise#33338
Related: odoo/upgrade#3996
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-11-24 12:26:01 +01:00

127 lines
6.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_hr_job_form" model="ir.ui.view">
<field name="name">hr.job.form</field>
<field name="model">hr.job</field>
<field name="arch" type="xml">
<form string="Job">
<field name="active" invisible="1"/>
<field name="company_id" invisible="1"/>
<sheet>
<div class="oe_button_box" name="button_box"/>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" placeholder="e.g. Sales Manager"/></h1>
</div>
<notebook>
<page string="Recruitment" name="recruitment_page">
<group>
<group name="recruitment">
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="department_id"/>
<field name="contract_type_id"/>
</group>
<group name="recruitment2">
<label for="no_of_recruitment"/>
<div class="o_row" name="recruitment_target">
<field name="no_of_recruitment" class="col-3 ps-0"/>
<span class="ps-1">new Employees</span>
</div>
</group>
</group>
</page>
<page string="Job Summary" name="job_description_page">
<field name="description" options="{'collaborative': true}"/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" options="{'open_attachments': True}"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="view_hr_job_tree" model="ir.ui.view">
<field name="name">hr.job.tree</field>
<field name="model">hr.job</field>
<field name="arch" type="xml">
<tree string="Job" sample="1">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="department_id"/>
<field name="no_of_recruitment"/>
<field name="no_of_employee" optional="hide"/>
<field name="expected_employees" optional="hide"/>
<field name="no_of_hired_employee" optional="hide"/>
<field name="message_needaction" invisible="1"/>
<field name="company_id" groups="base.group_multi_company" optional="hide"/>
</tree>
</field>
</record>
<record id="hr_job_view_kanban" model="ir.ui.view">
<field name="name">hr.job.kanban</field>
<field name="model">hr.job</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div>
<strong><field name="name"/></strong>
</div>
<div>
<span><field name="department_id"/>&amp;nbsp;</span>
</div>
<div t-if="!selection_mode">
<span>Vacancies : <field name="expected_employees"/></span>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_job_filter" model="ir.ui.view">
<field name="name">hr.job.search</field>
<field name="model">hr.job</field>
<field name="arch" type="xml">
<search string="Jobs">
<field name="name" string="Job Position"/>
<field name="department_id" operator="child_of"/>
<separator/>
<filter name="message_needaction" string="Unread Messages" domain="[('message_needaction', '=', True)]" groups="mail.group_mail_notification_type_inbox"/>
<separator/>
<filter name="archived" string="Archived" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter string="Department" name="department" domain="[]" context="{'group_by': 'department_id'}"/>
<filter string="Company" name="company" domain="[]" context="{'group_by': 'company_id'}" groups="base.group_multi_company"/>
<filter string="Employment Type" name="employment_type" domain="[]" context="{'group_by': 'contract_type_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_hr_job" model="ir.actions.act_window">
<field name="name">Job Positions</field>
<field name="res_model">hr.job</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_job_filter"/>
<field name="context">{"search_default_Current":1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Ready to recruit more efficiently?
</p><p>
Let's create a job position.
</p>
</field>
</record>
</data>
</odoo>