Merge pull request #4012 from expsa/samir-aladawi-improves-hr-reports

Samir aladawi improves hr reports
This commit is contained in:
SamirLADOUI-sa 2025-07-24 01:16:41 +01:00 committed by GitHub
commit 07c1f08b2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 48 additions and 46 deletions

View File

@ -48,7 +48,6 @@
"views/hr_penalty_register_view.xml",
"views/employee_iqama_document_view.xml",
"views/res_users_views.xml",
"views/hr_holidays_views.xml",
"views/menus_view.xml",
# "views/res_config_settings.xml",
'report/hr_layout.xml',

View File

@ -31,4 +31,3 @@ from . import assets_document
from . import hr_department
from . import res_partner
from . import res_users
from . import hr_holidays

View File

@ -1,7 +0,0 @@
from odoo import models, fields
class HrHolidays(models.Model):
_inherit = 'hr.holidays'
emp_no = fields.Char(related='employee_id.emp_no')

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_holiday_allocation_tree_hr_holidays_community" model="ir.ui.view">
<field name="name">hr.holidays.allocation.tree.inherit</field>
<field name="model">hr.holidays</field>
<field name="inherit_id" ref="hr_holidays_community.view_holiday_allocation_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree/field[@name='employee_id']" position="before">
<field name="emp_no"/>
</xpath>
</field>
</record>
<record id="view_holiday_hr_holidays_community" model="ir.ui.view">
<field name="name">hr.holidays.tree.inherit</field>
<field name="model">hr.holidays</field>
<field name="inherit_id" ref="hr_holidays_community.view_holiday"/>
<field name="arch" type="xml">
<xpath expr="//tree/field[@name='employee_id']" position="before">
<field name="emp_no"/>
</xpath>
</field>
</record>
</odoo>

View File

@ -137,9 +137,7 @@
<field name="name">hr.holidays.allocation.tree</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<tree
decoration-info="state == 'draft'" decoration-warning="state in ['confirm', 'validate']"
decoration-success="state == 'validate1'" decoration-danger="state == 'refuse'" string="Allocation Requests"
<tree decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Allocation Requests"
decoration-bf="message_needaction == True">
<field name="employee_id"/>
<field name="department_id" />
@ -183,9 +181,7 @@
<field name="model">hr.holidays</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<tree
decoration-info="state == 'draft'" decoration-warning="state in ['confirm', 'validate']"
decoration-success="state == 'validate1'" decoration-danger="state == 'refuse'" string="Leaves Summary">
<tree decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Leaves Summary">
<field name="employee_id"/>
<field name="category_id" invisible="1"/>
<field name="department_id" invisible="1"/>
@ -280,9 +276,7 @@
<field name="name">hr.holidays.tree</field>
<field name="model">hr.holidays</field>
<field name="arch" type="xml">
<tree
decoration-info="state == 'draft'" decoration-warning="state in ['confirm', 'validate']"
decoration-success="state == 'validate1'" decoration-danger="state == 'refuse'" string="Leave Requests"
<tree decoration-danger="state == 'refuse'" decoration-info="state == 'draft'" string="Leave Requests"
decoration-bf="message_needaction == True">
<field name="employee_id"/>
<field name="holiday_type" string="Mode" groups="base.group_no_one"/>
@ -290,7 +284,7 @@
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="number_of_days_temp" string="Number of Days" sum="Remaining Days" decoration-bf="1"/>
<field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
<field name="state"/>
<field name="payslip_status" widget="toggle_button" options='{"active": "Reported in last payslips", "inactive": "To Report in Payslip"}' groups="hr_holidays_community.group_hr_holidays_manager"/>
<field name="category_id" invisible="1"/>
@ -526,7 +520,7 @@
Click here to create a new leave request.
</p>
</field>
<field name="domain">[('holiday_type', '=', 'employee'), ('type', '=', 'add')]</field>
<field name="domain">[('holiday_type','=','employee')]</field>
<field name="search_view_id" ref="view_hr_holidays_filter"/>
</record>

View File

@ -214,11 +214,47 @@
</field>
</record>
<record id="view_holiday_allocation_tree_hr_holidays_community" model="ir.ui.view">
<field name="name">hr.holidays.allocation.tree.inherit</field>
<field name="model">hr.holidays</field>
<field name="inherit_id" ref="hr_holidays_community.view_holiday_allocation_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-warning">state in ['confirm', 'validate']</attribute>
<attribute name="decoration-success">state == 'validate1'</attribute>
</xpath>
<xpath expr="//tree/field[@name='employee_id']" position="before">
<field name="emp_number"/>
</xpath>
</field>
</record>
<record id="view_holiday_simple_hr_holidays_community" model="ir.ui.view">
<field name="name">hr.holidays.allocation.tree.inherit</field>
<field name="model">hr.holidays</field>
<field name="inherit_id" ref="hr_holidays_community.view_holiday_simple"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-warning">state in ['confirm', 'validate']</attribute>
<attribute name="decoration-success">state == 'validate1'</attribute>
</xpath>
</field>
</record>
<record id="custom_view_holiday" model="ir.ui.view">
<field name="name">hr.holidays.tree.custom</field>
<field name="model">hr.holidays</field>
<field name="inherit_id" ref="hr_holidays_community.view_holiday"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="decoration-warning">state in ['confirm', 'validate']</attribute>
<attribute name="decoration-success">state == 'validate1'</attribute>
</xpath>
<xpath expr="//tree/field[@name='number_of_days']" position="attributes">
<attribute name="name">number_of_days_temp</attribute>
<attribute name="decoration-bf">1</attribute>
</xpath>
<xpath expr="//field[@name='date_from']" position="attributes">
<attribute name="widget">date</attribute>
</xpath>
@ -231,6 +267,9 @@
<xpath expr="//field[@name='date_to']" position="after">
<field name="create_date"/>
</xpath>
<xpath expr="//tree/field[@name='employee_id']" position="before">
<field name="emp_number"/>
</xpath>
<xpath expr="//field[@name='employee_id']" position="after">
<field name="department_id"/>
</xpath>
@ -273,5 +312,9 @@
</field>
</record>
<!-- view_hr_holidays_filter_inherit end -->
<record id="hr_holidays_community.open_company_allocation" model="ir.actions.act_window">
<field name="domain" eval="[('holiday_type', '=', 'employee'), ('type', '=', 'add')]" />
</record>
</data>
</odoo>