modify on fields and report
This commit is contained in:
parent
ee00790b82
commit
7f895b40c8
|
|
@ -423,4 +423,6 @@
|
|||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -245,13 +245,15 @@ class ReportAttendancePublic(models.AbstractModel):
|
|||
all_days = {l.date for l in lines}
|
||||
absent = {l.date for l in lines if l.is_absent}
|
||||
vacation = {l.date for l in lines if l.normal_leave}
|
||||
|
||||
holidays = {l.date for l in lines if l.public_holiday}
|
||||
|
||||
iq = getattr(emp, 'iqama_number', False) or getattr(emp, 'saudi_number', '')
|
||||
calendar_name = lines[0].calendar_id.name if lines and lines[0].calendar_id else ''
|
||||
summary_rows.append({
|
||||
'employee_number': emp.emp_no or '',
|
||||
'name': emp.name,
|
||||
'seq': seq if seq else '',
|
||||
'seq': f"{seq} - {calendar_name}" if seq else '',
|
||||
'iqama': iq.display_name or '',
|
||||
'department': emp.department_id.name,
|
||||
'job': emp.sudo().job_id.name,
|
||||
|
|
@ -489,10 +491,11 @@ class ReportAttendancegeneral(models.AbstractModel):
|
|||
holidays = {l.date for l in lines if l.public_holiday}
|
||||
|
||||
iq = getattr(emp, 'iqama_number', False) or getattr(emp, 'saudi_number', '')
|
||||
calendar_name = lines[0].calendar_id.name if lines and lines[0].calendar_id else ''
|
||||
summary_rows.append({
|
||||
'employee_number': emp.emp_no or '',
|
||||
'name': emp.name,
|
||||
'seq': seq if seq else '',
|
||||
'seq': f"{seq} - {calendar_name}" if seq else '',
|
||||
'iqama': iq.display_name or '',
|
||||
'department': emp.department_id.name,
|
||||
'job': emp.sudo().job_id.name,
|
||||
|
|
@ -701,11 +704,12 @@ class AttendancesReportXls(models.AbstractModel):
|
|||
total_absent += len(absent)
|
||||
|
||||
iq = getattr(emp, 'iqama_number', False) or getattr(emp, 'saudi_number', '')
|
||||
calendar_name = lines[0].calendar_id.name if lines and lines[0].calendar_id else ''
|
||||
|
||||
sheet.write_row(row, 1, [
|
||||
emp.emp_no or '',
|
||||
emp.name,
|
||||
seq if seq else '',
|
||||
f"{seq} - {calendar_name}" if seq else '',
|
||||
iq.display_name,
|
||||
emp.department_id.name,
|
||||
|
||||
|
|
|
|||
|
|
@ -1412,10 +1412,9 @@ msgid "Expiration date"
|
|||
msgstr "تاريخ الانتهاء"
|
||||
|
||||
#. module: employee_requests
|
||||
#: model:ir.model.fields,field_description:employee_requests.field_hr_employee__date_of_expiry
|
||||
#: model:ir.model.fields,field_description:employee_requests.field_hr_employee__expiration_date_passport
|
||||
msgid "Expiry Date"
|
||||
msgstr "تاريخ النهاية"
|
||||
msgid "Passport Expiry Date"
|
||||
msgstr "تاريخ انتهاء الجواز"
|
||||
|
||||
#. module: employee_requests
|
||||
#: model_terms:ir.ui.view,arch_db:employee_requests.view_employee_form_leave_inherit_001
|
||||
|
|
@ -1792,10 +1791,20 @@ msgstr ""
|
|||
msgid "Is Last Record?"
|
||||
msgstr "أخر سجل؟"
|
||||
|
||||
|
||||
#. module: employee_requests
|
||||
#: model:ir.model.fields,field_description:employee_requests.field_hr_employee__date_issuance_passport
|
||||
msgid "Issue Date"
|
||||
msgstr "تاريخ الاصدار"
|
||||
msgid "Passport Issue Date"
|
||||
msgstr "تاريخ اصدار الجواز"
|
||||
|
||||
|
||||
|
||||
#. module: employee_requests
|
||||
#: model:ir.model.fields,field_description:employee_requests.field_hr_employee__date_issuance_saudi_id
|
||||
msgid "Saudi Issue Date"
|
||||
msgstr "تاريخ اصدار الهوية الوطنية "
|
||||
|
||||
|
||||
|
||||
#. module: employee_requests
|
||||
#: model:ir.model.fields,field_description:employee_requests.field_hr_clearance_form__it_mg
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ class HrEmployee(models.Model):
|
|||
_inherit = "hr.employee"
|
||||
|
||||
# passport fields to private information page
|
||||
date_issuance_passport = fields.Date()
|
||||
expiration_date_passport = fields.Date()
|
||||
date_issuance_passport = fields.Date(string="Passport Issue Date")
|
||||
expiration_date_passport = fields.Date(string="Passport Expiry Date")
|
||||
place_issuance_passport = fields.Char()
|
||||
own_license = fields.Boolean()
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,16 @@
|
|||
domain="[('employee_ref','=',id),('document_type','=','saudi')]"
|
||||
context="{'default_employee_ref':id,'default_document_type':'saudi'}"
|
||||
attrs="{'invisible':[('check_nationality','=',False)],'required':[('check_nationality','=',True)],'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="date_issuance_saudi_id" string="Date of issue" widget="date"
|
||||
attrs="{'invisible':[('check_nationality','=',False)],'required':[('check_nationality','=',True)]}"/>
|
||||
<field name="expiration_date_saudi_id" string="Expiration date" widget="date"
|
||||
attrs="{'invisible':[('check_nationality','=',False)],'required':[('check_nationality','=',True)]}"/>
|
||||
|
||||
<!-- ,'required':[('check_nationality','=',True)]-->
|
||||
<field name="date_issuance_saudi_id" widget="date"
|
||||
attrs="{'invisible':[('check_nationality','=',False)]}"/>
|
||||
|
||||
|
||||
|
||||
<!-- ,'required':[('check_nationality','=',True)]-->
|
||||
<field name="expiration_date_saudi_id" string="Saudi Expiry Date" widget="date"
|
||||
attrs="{'invisible':[('check_nationality','=',False)]}"/>
|
||||
<field name="place_issuance_saudi_id" string="Place of issue"
|
||||
attrs="{'invisible':[('check_nationality','=',False)]}"/>
|
||||
|
||||
|
|
@ -47,9 +53,12 @@
|
|||
domain="[('employee_ref','=',id),('document_type','=','Iqama')]"
|
||||
attrs="{'invisible':[('check_nationality','=',True)],'required':[('check_nationality','=',False)],'readonly':[('state','!=','draft')]}"
|
||||
context="{'default_employee_ref':id,'default_document_type':'Iqama'}"/>
|
||||
<field name="date_issuance_passport" string="Passport Issue Date" widget="date"
|
||||
|
||||
|
||||
<field name="date_issuance_passport" widget="date"
|
||||
/>
|
||||
<field name="emp_iqama_job" string="Identity Job"
|
||||
|
||||
<field name="emp_iqama_job" string="Identity Job"
|
||||
attrs="{'invisible':[('check_nationality','=',True)]}"/>
|
||||
<field name="expiration_date_passport" string="Passport Expiry Date" widget="date"
|
||||
/>
|
||||
|
|
@ -58,28 +67,24 @@
|
|||
|
||||
<field name="place_issuance_passport" string="Place Issue Passport"
|
||||
attrs="{'invisible':[('check_nationality','=',True)]}"/>
|
||||
<field name="iqama_creat_date" string="Identity Issue Date"
|
||||
|
||||
<field name="iqama_creat_date"
|
||||
attrs="{'invisible':[('check_nationality','=',True)],'required':[('check_nationality','=',False)]}"/>
|
||||
|
||||
</group>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='iqama_creat_date']" position="after">
|
||||
<field name="own_license" string="Own a license" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='own_license']" position="after">
|
||||
<field name="license_number_id" string="License number"
|
||||
domain="[('employee_ref','=',id),('document_type','=','license')]"
|
||||
attrs="{'invisible':[('own_license','=',False)],'readonly':[('state','!=','draft')]}"
|
||||
context="{'default_employee_ref':id,'default_document_type':'license'}"/>
|
||||
<field name="expiry_license" string="Expiry date of license"
|
||||
<field name="expiry_license" string="License Expiry Date"
|
||||
attrs="{'invisible':[('own_license','=',False)]}" widget="date"/>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='work_permit']" position="replace">
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//page[@name='hr_settings']" position="after">
|
||||
<page name="medical_insurance" string="Accommodation and Medical insurance">
|
||||
<group>
|
||||
|
|
|
|||
|
|
@ -156,8 +156,12 @@
|
|||
<filter name="group_department" string="Department" domain="[]" context="{'group_by': 'department_id'}"/>
|
||||
<filter name="group_branch" string="Branch" domain="[]" context="{'group_by': 'is_branch'}"/>
|
||||
<filter name="group_state" string="State" domain="[]" context="{'group_by': 'state'}"/>
|
||||
|
||||
|
||||
</group>
|
||||
<separator/>
|
||||
|
||||
|
||||
<filter string="My Permissions" name="my_permission" domain="[('employee_id.user_id', '=', uid)]"/>
|
||||
<separator/>
|
||||
</search>
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ msgstr "تاريخ انتهاء الجواز"
|
|||
|
||||
#. module: exp_ticket_request
|
||||
#: model:ir.model.fields,field_description:exp_ticket_request.field_hr_ticket_request__passport_expiry_date
|
||||
msgid "Passport Expiry Date."
|
||||
msgid "Passport Expiry Date"
|
||||
msgstr "تاريخ انتهاء الجواز"
|
||||
|
||||
#. module: exp_ticket_request
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ class HrTicketing(models.Model):
|
|||
state = fields.Selection(STATE_SELECTION, string='Status', default='draft', tracking=True)
|
||||
leave_ticket = fields.Boolean(string='Leave Ticket')
|
||||
passport_issue_place = fields.Char(related='employee_id.place_issuance_passport', string='Passport Issue Place')
|
||||
passport_issue_date = fields.Date(related='employee_id.date_issuance_passport', string='Passport Issue Date.')
|
||||
passport_expiry_date = fields.Date(related='employee_id.expiration_date_passport', string='Passport Expiry Date.')
|
||||
passport_issue_date = fields.Date(related='employee_id.date_issuance_passport', string='Passport Issue Date')
|
||||
passport_expiry_date = fields.Date(related='employee_id.expiration_date_passport', string="Passport Expiry Date")
|
||||
position_type = fields.Selection([('Consultant_director', _('Managerial')), ('normal', _('Normal Job'))],
|
||||
_('Position Type'), )
|
||||
request_date = fields.Date(string='Request Date', default=fields.Date.today)
|
||||
|
|
|
|||
|
|
@ -2081,8 +2081,6 @@ msgstr ""
|
|||
#: model:ir.model.fields,field_description:hr_base.field_employee_card__expiry_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_employee_family_iqama__expiry_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_employee_iqama__expiry_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__expiration_date_passport
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__expiration_date_saudi_id
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__expiry
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__iqama_expiy_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_res_company_tree__expiry_date
|
||||
|
|
@ -2090,6 +2088,21 @@ msgstr ""
|
|||
msgid "Expiry Date"
|
||||
msgstr "تاريخ النهاية"
|
||||
|
||||
|
||||
|
||||
#. module: hr_base
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__expiration_date_passport
|
||||
msgid "Passport Expiry Date"
|
||||
msgstr "تاريخ انتهاء الجواز"
|
||||
|
||||
|
||||
|
||||
#. module: hr_base
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__expiration_date_saudi_id
|
||||
#: model_terms:ir.ui.view,arch_db:hr_base.employee__iqama_document_form_view
|
||||
msgid "Saudi Expiry Date"
|
||||
msgstr " تاريخ انتهاء الهوية الوطنية"
|
||||
|
||||
#. module: hr_base
|
||||
#: model_terms:ir.ui.view,arch_db:hr_base.eos_form_view
|
||||
#: model_terms:ir.ui.view,arch_db:hr_base.leaving_form_view
|
||||
|
|
@ -2615,15 +2628,30 @@ msgstr "هل مواطن؟"
|
|||
#: model:ir.model.fields,field_description:hr_base.field_employee_card__issue_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_employee_family_iqama__issue_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_employee_iqama__issue_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__date_issuance_passport
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__date_issuance_saudi_id
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__iqama_creat_date
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__issue
|
||||
#: model:ir.model.fields,field_description:hr_base.field_res_company_tree__issue_date
|
||||
#: model_terms:ir.ui.view,arch_db:hr_base.employee__iqama_document_form_view
|
||||
msgid "Issue Date"
|
||||
msgstr "تاريخ الإصدار"
|
||||
|
||||
|
||||
|
||||
#. module: hr_base
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__date_issuance_passport
|
||||
msgid "Passport Issue Date"
|
||||
msgstr "تاريخ اصدار الجواز "
|
||||
|
||||
#. module: hr_base
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__date_issuance_saudi_id
|
||||
msgid "Saudi Issue Date"
|
||||
msgstr "تاريخ اصدار الهوية الوطنية"
|
||||
|
||||
|
||||
module: hr_base
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_employee__iqama_creat_date
|
||||
msgid "Iqama Issue Date"
|
||||
msgstr "تاريخ اصدار الاقامة"
|
||||
|
||||
#. module: hr_base
|
||||
#: model:ir.model.fields,field_description:hr_base.field_hr_dependent__issue_place
|
||||
msgid "Issue Place"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class HrEmployee(models.Model):
|
|||
|
||||
# iqama fields in employee view
|
||||
identity_number = fields.Char(compute_sudo=True, compute='_compute_identity_number', string='Identity Number',store=True)
|
||||
iqama_creat_date = fields.Date(related="iqama_number.issue_date", readonly=True)
|
||||
iqama_creat_date = fields.Date(related="iqama_number.issue_date", readonly=True,string="Iqama Issue Date")
|
||||
iqama_expiy_date = fields.Date(related="iqama_number.expiry_date", readonly=True)
|
||||
iqama_job = fields.Many2one(related="iqama_number.job_id", readonly=True)
|
||||
emp_iqama_job = fields.Char(related="iqama_number.emp_iqama_job", readonly=True)
|
||||
|
|
@ -57,12 +57,12 @@ class HrEmployee(models.Model):
|
|||
issue = fields.Date("Issue Date")
|
||||
expiry = fields.Date("Expiry Date")
|
||||
# passport fields to private information page
|
||||
date_issuance_passport = fields.Date(related="passport_id.issue_date", readonly=True)
|
||||
expiration_date_passport = fields.Date(related="passport_id.expiry_date", readonly=True)
|
||||
date_issuance_passport = fields.Date(related="passport_id.issue_date", readonly=True,string="Passport Issue Date")
|
||||
expiration_date_passport = fields.Date(related="passport_id.expiry_date", readonly=True,string="Passport Expiry Date")
|
||||
place_issuance_passport = fields.Char(related="passport_id.place_issue_id", readonly=True)
|
||||
|
||||
# related fields if employee is saudi
|
||||
date_issuance_saudi_id = fields.Date(related="saudi_number.issue_date", readonly=True)
|
||||
date_issuance_saudi_id = fields.Date(related="saudi_number.issue_date",string="Saudi Issue Date", readonly=True)
|
||||
expiration_date_saudi_id = fields.Date(related="saudi_number.expiry_date")
|
||||
place_issuance_saudi_id = fields.Char(related="saudi_number.place_issue_id", readonly=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -45,19 +45,19 @@
|
|||
<field name="arch" type="xml">
|
||||
<button name="%(hr.plan_wizard_action)d" position="before">
|
||||
|
||||
<button name="complete_state" string="Complete Employee Data" class="oe_highlight" type="object"
|
||||
states="draft" groups="hr.group_hr_user"/>
|
||||
<button name="complete_state" string="Complete Employee Data" class="oe_highlight" type="object"
|
||||
states="draft" groups="hr.group_hr_user"/>
|
||||
|
||||
<button name="open_sate" string="Approved" type="object" class="oe_highlight"
|
||||
states="complete" groups="hr.group_hr_manager"/>
|
||||
<button name="open_sate" string="Approved" type="object" class="oe_highlight"
|
||||
states="complete" groups="hr.group_hr_manager"/>
|
||||
|
||||
<button name="create_contract" string="Create Contract" class="oe_highlight" type="object"
|
||||
states="complete" groups="hr.group_hr_manager,hr.group_hr_user"/>
|
||||
<button name="create_contract" string="Create Contract" class="oe_highlight" type="object"
|
||||
states="complete" groups="hr.group_hr_manager,hr.group_hr_user"/>
|
||||
|
||||
<button name="draft_state" string="Rest TO Draft" class="oe_highlight" type="object"
|
||||
states="complete,open" groups="hr.group_hr_manager"
|
||||
confirm="Are you sure to Rest To Draft This Record?"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
<button name="draft_state" string="Rest TO Draft" class="oe_highlight" type="object"
|
||||
states="complete,open" groups="hr.group_hr_manager"
|
||||
confirm="Are you sure to Rest To Draft This Record?"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</button>
|
||||
|
||||
|
||||
|
|
@ -271,7 +271,8 @@
|
|||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page name="attachments" string="Employee Attachments" groups="hr.group_hr_user">
|
||||
<page name="attachments" string="Employee Attachments"
|
||||
groups="hr.group_hr_user">
|
||||
<field name="attachment_ids" attrs="{'readonly':[('state','!=','draft')]}">
|
||||
<tree string="Attachments" editable="bottom">
|
||||
<field name="doc_name" string="Attachment Name"/>
|
||||
|
|
@ -409,15 +410,19 @@
|
|||
<tree decoration-danger="state == 'out_of_service'" decoration-info="state == 'draft'"
|
||||
string="Employees">
|
||||
<field name="emp_no"/>
|
||||
<field name="english_name"/>
|
||||
<field name="english_name" optional="hide"/>
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="job_id"/>
|
||||
<field name="country_id" optional="hide" />
|
||||
<field name="gender" optional="hide" />
|
||||
<!-- <field name="identity_number" />-->
|
||||
<!--field name="saudi_number" string="Saudi ID"/>
|
||||
<field name="iqama_number" string="Identity No"/>
|
||||
<field name="iqama_expiy_date" string="Identity Expiry Date"/-->
|
||||
<field name="identity_number" string="Identity No"/>
|
||||
<field name="bank_code"/>
|
||||
<field name="bank_code" optional="hide"/>
|
||||
<field name="iqama_expiy_date" string="Identity Expiry Date" optional="hide"/>
|
||||
<field name="work_location" invisible="1"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
|
@ -433,7 +438,7 @@
|
|||
<field name="inherit_id" ref="hr.view_employee_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//field[@name="name"]' position='after'>
|
||||
<field name="english_name"/>
|
||||
<field name="english_name" />
|
||||
<field name="emp_no"/>
|
||||
<field name="identity_number"/>
|
||||
<field name="state"/>
|
||||
|
|
@ -444,81 +449,81 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- employee_view_kanban_inherit -->
|
||||
<!-- employee_view_kanban_inherit -->
|
||||
|
||||
<record id="hr_employee_kanban_inherit" model="ir.ui.view">
|
||||
<field name="name">hr employee kanban </field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//field[@name="name"]' position='after'>
|
||||
<span t-if="record.emp_no.raw_value" class="o_kanban_record_subtitle">
|
||||
<field name="emp_no"/>
|
||||
</span>
|
||||
<record id="hr_employee_kanban_inherit" model="ir.ui.view">
|
||||
<field name="name">hr employee kanban </field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//field[@name="name"]' position='after'>
|
||||
<span t-if="record.emp_no.raw_value" class="o_kanban_record_subtitle">
|
||||
<field name="emp_no"/>
|
||||
</span>
|
||||
|
||||
<span t-if="record.department_id.raw_value" class="o_kanban_record_subtitle">
|
||||
<field name="department_id"/>
|
||||
</span>
|
||||
<span t-if="record.department_id.raw_value" class="o_kanban_record_subtitle">
|
||||
<field name="department_id"/>
|
||||
</span>
|
||||
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_users_simple_form_inherit_hr" model="ir.ui.view">
|
||||
<field name="name">view.users.simple.form.inherit.hr</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_simple_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<record id="view_users_simple_form_inherit_hr" model="ir.ui.view">
|
||||
<field name="name">view.users.simple.form.inherit.hr</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_simple_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<xpath expr="//label[@for='login']" position="attributes">
|
||||
<attribute name="string">Login</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//label[@for='login']" position="attributes">
|
||||
<attribute name="string">Login</attribute>
|
||||
</xpath>
|
||||
|
||||
|
||||
<xpath expr="//field[@name='mobile']" position="after">
|
||||
<field name="create_employee_id" force_save="1" invisible="1"/>
|
||||
<field name="create_employee" force_save="1" string="Create Employee" invisible="not context.get('allow_create_employee', True)" attrs="{'invisible': [('create_employee_id', '>', 0)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<xpath expr="//field[@name='mobile']" position="after">
|
||||
<field name="create_employee_id" force_save="1" invisible="1"/>
|
||||
<field name="create_employee" force_save="1" string="Create Employee" invisible="not context.get('allow_create_employee', True)" attrs="{'invisible': [('create_employee_id', '>', 0)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_hr_employee_create_user" model="ir.actions.server">
|
||||
<field name="name">Create User</field>
|
||||
<field name="model_id" ref="model_hr_employee"/>
|
||||
<field name="binding_model_id" ref="model_hr_employee"/>
|
||||
<field name="binding_view_types">form</field>
|
||||
<field name="groups_id" eval="[(4, ref('hr.group_hr_user'))]"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
action = records.action_create_user()
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_hr_employee_create_user" model="ir.actions.server">
|
||||
<field name="name">Create User</field>
|
||||
<field name="model_id" ref="model_hr_employee"/>
|
||||
<field name="binding_model_id" ref="model_hr_employee"/>
|
||||
<field name="binding_view_types">form</field>
|
||||
<field name="groups_id" eval="[(4, ref('hr.group_hr_user'))]"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
action = records.action_create_user()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- end hr.employee -->
|
||||
<!-- end hr.employee -->
|
||||
|
||||
<!-- hr_employee_public_view_kanban_inherit -->
|
||||
<!-- hr_employee_public_view_kanban_inherit -->
|
||||
|
||||
<record id="hr_employee_public_view_kanban_inherit" model="ir.ui.view">
|
||||
<field name="name">hr employee public kanban </field>
|
||||
<field name="model">hr.employee.public</field>
|
||||
<field name="inherit_id" ref="hr.hr_employee_public_view_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//templates" position="before">
|
||||
<field name="current_leave_id"/>
|
||||
<field name="current_leave_state"/>
|
||||
<field name="leave_date_from"/>
|
||||
<field name="leave_date_to"/>
|
||||
</xpath>
|
||||
<xpath expr="//li[@id='last_login']" position="inside">
|
||||
<span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
|
||||
t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
|
||||
t-att-title="moment(record.leave_date_from.raw_value).format('ddd Do MMM') + ' - ' + moment(record.leave_date_to.raw_value).format('ddd Do MMM')">
|
||||
<record id="hr_employee_public_view_kanban_inherit" model="ir.ui.view">
|
||||
<field name="name">hr employee public kanban </field>
|
||||
<field name="model">hr.employee.public</field>
|
||||
<field name="inherit_id" ref="hr.hr_employee_public_view_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//templates" position="before">
|
||||
<field name="current_leave_id"/>
|
||||
</span>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- end hr.employee.public -->
|
||||
<field name="current_leave_state"/>
|
||||
<field name="leave_date_from"/>
|
||||
<field name="leave_date_to"/>
|
||||
</xpath>
|
||||
<xpath expr="//li[@id='last_login']" position="inside">
|
||||
<span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
|
||||
t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
|
||||
t-att-title="moment(record.leave_date_from.raw_value).format('ddd Do MMM') + ' - ' + moment(record.leave_date_to.raw_value).format('ddd Do MMM')">
|
||||
<field name="current_leave_id"/>
|
||||
</span>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- end hr.employee.public -->
|
||||
|
||||
<record id="view_hr_job_form_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.job.form.inherit</field>
|
||||
|
|
|
|||
|
|
@ -168,9 +168,8 @@ msgstr "مستند خروج"
|
|||
|
||||
#. module: hr_docs_expiry
|
||||
#: model:ir.model.fields,field_description:hr_docs_expiry.field_hr_employee__expiry_license
|
||||
#: model:ir.model.fields,field_description:hr_docs_expiry.field_hr_employee_document__expiry_date
|
||||
msgid "Expiry Date"
|
||||
msgstr "تاريخ النهاية"
|
||||
msgid "License Expiry Date"
|
||||
msgstr " تاريخ انتهاء الرخصة"
|
||||
|
||||
#. module: hr_docs_expiry
|
||||
#: model:ir.model.fields,field_description:hr_docs_expiry.field_hr_employee_document__file_examination
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ class HrEmployee(models.Model):
|
|||
related="license_number_id.expiry_date",
|
||||
readonly=True,
|
||||
default=fields.date.today(),
|
||||
string="License Expiry Date"
|
||||
)
|
||||
document_count = fields.Integer(compute="_document_count", string="# Documents")
|
||||
|
||||
|
|
|
|||
|
|
@ -1813,11 +1813,27 @@ class HRHolidays(models.Model):
|
|||
current_date = (datetime.utcnow() + timedelta(hours=3))
|
||||
date_from_value = datetime.strptime(str(item.date_from), "%Y-%m-%d %H:%M:%S")
|
||||
date_to_value = datetime.strptime(str(item.date_to), "%Y-%m-%d %H:%M:%S")
|
||||
if date_to_value < date_from_value:
|
||||
raise exceptions.Warning(_('Sorry Date TO must be bigger than Date From'))
|
||||
if (date_from_value - current_date).days + 1 < item.holiday_status_id.request_before:
|
||||
raise exceptions.Warning(_('Sorry your request must be before %s Days of your leave') \
|
||||
% item.holiday_status_id.request_before)
|
||||
|
||||
user = self.env.user
|
||||
|
||||
# Check if user is **NOT** in the HR group
|
||||
if not user.has_group("hr.group_hr_user"):
|
||||
if date_to_value < date_from_value:
|
||||
raise exceptions.Warning(_('Sorry, Date TO must be later than Date FROM'))
|
||||
|
||||
if (date_from_value - current_date).days + 1 < item.holiday_status_id.request_before:
|
||||
raise exceptions.Warning(
|
||||
_('Sorry, your leave request must be submitted at least %s days in advance.')
|
||||
% item.holiday_status_id.request_before
|
||||
)
|
||||
|
||||
# if date_to_value < date_from_value:
|
||||
# raise exceptions.Warning(_('Sorry Date TO must be bigger than Date From'))
|
||||
# if (date_from_value - current_date).days + 1 < item.holiday_status_id.request_before:
|
||||
# raise exceptions.Warning(_('Sorry your request must be before %s Days of your leave') \
|
||||
# % item.holiday_status_id.request_before)
|
||||
|
||||
|
||||
self.number_of_days_temp = self._get_number_of_days(item.date_from, item.date_to, self.employee_id.id,
|
||||
self.holiday_status_id.official_holidays,
|
||||
self.holiday_status_id.working_days)
|
||||
|
|
|
|||
Loading…
Reference in New Issue