Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] [18.0] hr_grade_rank: migrated module #656

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions hr_grade_rank/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

{
"name": "HR-Grade Rank",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"summary": "Manage grade and rank of employee",
"author": "Serpent Consulting Services Pvt. Ltd.",
"maintainer": "Serpent Consulting Services Pvt. Ltd.",
"category": "Human Resources",
"website": "https://www.serpentcs.com",
"depends": ["hr"],
"data": ["security/ir.model.access.csv", "views/hr_grade_rank_view.xml"],
"data": [
"security/ir.model.access.csv",
"views/hr_grade_rank_view.xml"
],
"images": ["static/description/Banner_hr_grade_rank.png"],
"sequence": 1,
"installable": True,
Expand Down
1 change: 0 additions & 1 deletion hr_grade_rank/models/hr_grade_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class GradeGrade(models.Model):


class HrEmployee(models.Model):

_inherit = "hr.employee"

grade_id = fields.Many2one("grade.grade", "Grade")
Expand Down
2 changes: 1 addition & 1 deletion hr_grade_rank/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_rank_rank,access_rank_rank,model_rank_rank,base.group_user,1,1,1,0
access_grade_grade,access_grade_grade,model_grade_grade,base.group_user,1,1,1,0
146 changes: 67 additions & 79 deletions hr_grade_rank/views/hr_grade_rank_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,55 @@
<form string="Employees Grade">
<sheet>
<group>
<field name="name" required="1" />
<field name="name" required="1"/>
</group>
<notebook>
<page string="Ranks">
<field name="rank_ids">
<tree>
<field name="name" />
<field name="salary_range" />
<field name="description" />
</tree>
<list>
<field name="name"/>
<field name="salary_range"/>
<field name="description"/>
</list>
</field>
</page>
</notebook>
<field name="description" placeholder="Description" />
<field name="description" placeholder="Description"/>
</sheet>
</form>
</field>
</record>

<!-- GRADE TREE VIEW -->
<record id="view_employee_grade_tree" model="ir.ui.view">
<field name="name">grade.grade.tree</field>
<record id="view_employee_grade_list" model="ir.ui.view">
ShwetaSerpentCS marked this conversation as resolved.
Show resolved Hide resolved
<field name="name">grade.grade.list</field>
<field name="model">grade.grade</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="description" />
</tree>
<list>
<field name="name"/>
<field name="description"/>
</list>
</field>
</record>

<!-- GRADE ACTION -->
<record id="action_employee_grade" model="ir.actions.act_window">
<field name="name">Grades</field>
<field name="res_model">grade.grade</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>

<!-- Employee Rank/Grade Menu -->
<menuitem
id="menu_employee_grade_rank"
parent="hr.menu_human_resources_configuration"
sequence="30"
name="Employee Grades and Rank"
/>
<menuitem id="menu_employee_grade_rank"
parent="hr.menu_human_resources_configuration"
sequence="30"
name="Employee Grades and Rank"/>

<!-- GRADE MENU -->
<menuitem
id="menu_grade"
sequence="2"
parent="hr_grade_rank.menu_employee_grade_rank"
action="action_employee_grade"
/>
<menuitem id="menu_grade"
sequence="2"
parent="hr_grade_rank.menu_employee_grade_rank"
action="action_employee_grade"/>

<!-- RANK FORM VIEW -->
<record id="view_employee_rank_form" model="ir.ui.view">
Expand All @@ -70,71 +66,67 @@
<form string="Employees Rank">
<sheet>
<group>
<field name="name" required="1" />
<field name="name" required="1"/>
</group>
<group>
<field name="salary_range" />
<field name="salary_range"/>
</group>
<field name="description" placeholder="Description" />
<field name="description" placeholder="Description"/>
</sheet>
</form>
</field>
</record>

<!-- RANK TREE VIEW -->
<record id="view_employee_rank_tree" model="ir.ui.view">
<field name="name">rank.rank.tree</field>
<record id="view_employee_rank_list" model="ir.ui.view">
ShwetaSerpentCS marked this conversation as resolved.
Show resolved Hide resolved
<field name="name">rank.rank.list</field>
<field name="model">rank.rank</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="salary_range" />
<field name="description" />
</tree>
<list>
<field name="name"/>
<field name="salary_range"/>
<field name="description"/>
</list>
</field>
</record>

<!-- RANK ACTION -->
<record id="action_employee_rank" model="ir.actions.act_window">
<field name="name">Ranks</field>
<field name="res_model">rank.rank</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>

<!-- RANK MENU -->
<menuitem
id="menu_rank"
parent="hr_grade_rank.menu_employee_grade_rank"
action="action_employee_rank"
sequence="4"
/>
<menuitem id="menu_rank"
parent="hr_grade_rank.menu_employee_grade_rank"
action="action_employee_rank"
sequence="4"/>

<!-- EMPLOYEES INHERITED FORM VIEW -->
<record id="view_employee_form_grade_rank" model="ir.ui.view">
<field name="name">hr.employee.form.grade.rank</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form" />
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="job_id" position="after">
<field name="grade_id" />
<field
name="rank_id"
context="{'grade': grade_id}"
options="{'no_open': True, 'no_create': True}"
/>
<field name="grade_id"/>
<field name="rank_id"
context="{'grade': grade_id}"
options="{'no_open': True, 'no_create': True}"/>
</field>
</field>
</record>

<!-- EMPLOYEES INHERITED TREE VIEW -->
<record id="view_employee_tree_grade_rank" model="ir.ui.view">
<field name="name">hr.employee.tree.grade.rank</field>
<record id="view_employee_list_grade_rank" model="ir.ui.view">
ShwetaSerpentCS marked this conversation as resolved.
Show resolved Hide resolved
<field name="name">hr.employee.list.grade.rank</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_tree" />
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<field name="job_id" position="after">
<field name="grade_id" />
<field name="rank_id" />
<field name="grade_id"/>
<field name="rank_id"/>
</field>
</field>
</record>
Expand All @@ -143,23 +135,19 @@
<record id="view_employee_filter_grade_rank" model="ir.ui.view">
<field name="name">Employees Grade Rank</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter" />
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<filter name="group_job" position="after">
<filter
string="Grade"
icon="terp-gtk-select-all"
domain="[]"
name='grade'
context="{'group_by':'grade_id'}"
/>
<filter
string="Rank"
icon="terp-gtk-select-all"
domain="[]"
name='rank'
context="{'group_by':'rank_id'}"
/>
<filter string="Grade"
icon="terp-gtk-select-all"
domain="[]"
name='grade'
context="{'group_by':'grade_id'}"/>
<filter string="Rank"
icon="terp-gtk-select-all"
domain="[]"
name='rank'
context="{'group_by':'rank_id'}"/>
</filter>
</field>
</record>
Expand All @@ -168,19 +156,19 @@
<record id="hr_kanban_view_emp_grade_rank" model="ir.ui.view">
<field name="name">hr.employee.kanban.grade.rank</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.hr_kanban_view_employees" />
<field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field name="grade_id" />
<field name="rank_id" />
<field name="grade_id"/>
<field name="rank_id"/>
</xpath>
<xpath expr="//field[@name='work_phone']" position="after">
<li t-if="record.grade_id.raw_value">
<field name="grade_id" />
</li>
<li t-if="record.rank_id.raw_value">
<field name="rank_id" />
</li>
<div t-if="record.grade_id.raw_value">
<field name="grade_id"/>
</div>
<div t-if="record.rank_id.raw_value">
<field name="rank_id"/>
</div>
</xpath>
</field>
</record>
Expand Down