Merge pull request #3218 from expsa/bakry_hr3

Bakry hr3
This commit is contained in:
bakry 2025-05-18 16:52:12 +03:00 committed by GitHub
commit 9bdc52517f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 435 additions and 41 deletions

View File

@ -2536,3 +2536,196 @@ msgstr ""
#: model_terms:ir.ui.view,arch_db:attendances.late_attendance_report_template
msgid "وقت الدخول"
msgstr ""
#. module: attendances
#: model:ir.model.fields,field_description:attendances.field_hr_attendance_transaction__company_id
#: model:ir.model.fields,field_description:attendances.field_attendance_attendance__company_id
#: model:ir.model.fields,field_description:attendances.field_hr_attendance_register__company_id
msgid "Company"
msgstr "الشركة"
#. module: attendances
#: model:ir.model.fields,field_description:attendances.field_hr_attendance_transaction__employee_number
#: model:ir.model.fields,field_description:attendances.field_attendance_attendance__employee_number
#: model_terms:ir.ui.view,arch_db:attendances.employee_attendance_transactions_form_view
#: model_terms:ir.ui.view,arch_db:attendances.attendance_transaction_tree_view
msgid "Employee Number"
msgstr "رقم الموظف"
#. module: attendences
#: model_terms:ir.ui.view,arch_db:attendances.resource_calendar_inherited_form
msgid "Overtime Accounts Settings"
msgstr "إعداد الحسابات"
#. module: attendences
#: model:ir.model.fields,field_description:hr_base.field_resource_calendar__journal_overtime_id
#: model_terms:ir.ui.view,arch_db:attendances.resource_calendar_inherited_form
msgid "Journal Overtime"
msgstr "دفتر اليومية"
#. module: attendences
#: model:ir.model.fields,field_description:hr_base.field_resource_calendar__account_overtime_id
#: model_terms:ir.ui.view,arch_db:attendances.resource_calendar_inherited_form
msgid "Account Overtime"
msgstr "حساب الصرف"
#. module: attendances
#: model:ir.model.fields,field_description:attendances.field_hr_attendance_transaction__department_id
#: model_terms:ir.ui.view,arch_db:attendances.employee_attendance_transactions_form_view
#: model_terms:ir.ui.view,arch_db:attendances.attendance_transaction_tree_view
msgid "Department Name"
msgstr "إسم القسم"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.view_attendance_transaction_filter
msgid "Employee"
msgstr "الموظف"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.view_attendance_transaction_filter
msgid "Department"
msgstr "القسم"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.view_attendance_transaction_filter
msgid "Absent"
msgstr "الغياب"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.view_attendance_transaction_filter
#: model_terms:ir.ui.view,arch_db:attendances.attendance_view_filter
msgid "My Attendance"
msgstr "حضوري"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.view_attendance_transaction_filter
#: model_terms:ir.ui.view,arch_db:attendances.attendance_view_filter
msgid "Attendance Today"
msgstr "حضور اليوم"
#. module: hr_base
#: model:ir.model.fields,field_description:hr_base.field_resource_calendar__approval_by
msgid "Approval By"
msgstr "التصديق بواسطة"
#. module: hr_base
#: model:ir.model.fields.selection,name:hr_base.selection__resource_calendar__approval_by__direct_manager
msgid "Direct Manager"
msgstr "المدير المباشر"
#. module: hr_base
#: model:ir.model.fields.selection,name:hr_base.selection__resource_calendar__approval_by__hr_manager
msgid "HR Manager"
msgstr "مدير الموارد البشرية"
#. module: attendances
#: model:ir.model.fields,field_description:attendances.field_resource_calendar__register_before
msgid "Attendance Register Before"
msgstr "تسجيل الحضور قبل"
#. module: attendances
#: model:ir.model.fields,help:attendances.field_resource_calendar__register_before
msgid "The Maximum Number of Days to Request Missing Attendance"
msgstr "الحد الأقصى لعدد الأيام لطلب تسجيل بصمة مفقوده"
#. module: attendances
#: code:addons/attendances/wizard/attendances_report_wiz.py:0
#, python-format
msgid "Please select Employees Name"
msgstr "الرجاء إختيار أسماء الموظفين"
#. module: attendances
#: model:ir.model.fields,field_description:attendances.field_hr_attendance_register__employee_no
#: model:ir.model.fields,field_description:attendances.field_hr_reasons_lateness__employee_no
#: model_terms:ir.ui.view,arch_db:attendances.hr_attendance_register_tree_view
#: model_terms:ir.ui.view,arch_db:attendances.hr_attendance_register_form_view
#: model_terms:ir.ui.view,arch_db:attendances.employee_lateness_reasons_form_view
#: model_terms:ir.ui.view,arch_db:attendances.hr_lateness_tree_view
msgid "Employee Number"
msgstr "رقم الموظف"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.hr_attendance_register_filter
#: model_terms:ir.ui.view,arch_db:attendances.view_attendance_transaction_filter
#: model_terms:ir.ui.view,arch_db:attendances.hr_reasons_lateness_filter
#: model_terms:ir.ui.view,arch_db:attendances.attendance_view_filter
#, python-format
msgid "Branch"
msgstr "الفروع"
#. module: attendances
#: code:addons/attendances/models/hr_attendance_register.py:0
#, python-format
msgid "Sorry, The Approval For The Direct Manager '%s' Only OR HR Manager!"
msgstr "للأسف، لموافقة المدير المباشر '%s' فقط او مدير الموارد البشرية !"
#. module: attendances
#: code:addons/attendances/models/hr_attendance_register.py:0
#, python-format
msgid "Sorry, The Refuse For The Direct Manager '%s' Only OR HR Manager!"
msgstr "للأسف، لرفض المدير المباشر '%s' فقط او مدير الموارد البشرية !"
#. module: attendances
#: code:addons/attendances/models/hr_attendance_register.py:0
#, python-format
msgid "Sorry,You must enter the Names Of Employees!"
msgstr "للأسف، يجب ادخال اسماء الموظفين!"
#. module: attendances
#: model:ir.model.fields,field_description:attendances.field_hr_employee__hr_presence_state
#: model:ir.model.fields,field_description:attendances.field_hr_employee_base__hr_presence_state
#: model:ir.model.fields,field_description:attendances.field_hr_employee_public__hr_presence_state
msgid "Attendance State"
msgstr "حالة الحضور"
#. module: attendances
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee__hr_icon_display__presence_present
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee__hr_presence_state__present
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_base__hr_icon_display__presence_present
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_base__hr_presence_state__present
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_public__hr_icon_display__presence_present
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_public__hr_presence_state__present
msgid "Present"
msgstr "متواجـد"
#. module: attendances
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee__hr_icon_display__presence_to_define
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee__hr_presence_state__to_define
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_base__hr_icon_display__presence_to_define
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_base__hr_presence_state__to_define
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_public__hr_icon_display__presence_to_define
#: model:ir.model.fields.selection,name:attendances.selection__hr_employee_public__hr_presence_state__to_define
msgid "Not Present"
msgstr "غير متواجـد"
#. module: attendances
#: model:ir.model.fields,field_description:attendances.field_hr_attendance_report__department_ids
msgid "Departments"
msgstr "الأقسام"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.employee_lateness_absense_overtime_form_view
msgid "Attendance Date From"
msgstr "تاريخ الحضور من"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.employee_lateness_absense_overtime_form_view
msgid "Attendance Date To"
msgstr "تاريخ الحضور إلى"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.employee_lateness_absense_overtime_form_view
msgid "Deduction Date From"
msgstr "تاريخ الخصم من"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.employee_lateness_absense_overtime_form_view
msgid "Deduction Date To"
msgstr "تاريخ الخصم إلى"
#. module: attendances
#: model_terms:ir.ui.view,arch_db:attendances.resource_calendar_inherited_form
msgid "Accounting Info"
msgstr "اعداد الحسابات"

View File

@ -42,6 +42,16 @@ class HrAttendanceTransactions(models.Model):
has_sign_in = fields.Boolean(readonly=True)
has_sign_out = fields.Boolean(readonly=True)
to_date = fields.Boolean(string='Today',compute='_attendance_today', store=True)
@api.depends('date','employee_id')
def _attendance_today(self):
today = datetime.now().date()
for item in self:
if item.date==today:
item.to_date = True
else:
item.to_date = False
def get_additional_hours(self):
for rec in self:
@ -52,6 +62,7 @@ class HrAttendanceTransactions(models.Model):
@api.depends('employee_id')
def get_hours(self):
self._attendance_today()
module = self.env['ir.module.module'].sudo()
official_mission_module = module.search([('state', '=', 'installed'), ('name', '=', 'exp_official_mission')])
holidays_module = module.search([('state', '=', 'installed'), ('name', '=', 'hr_holidays_public')])

View File

@ -123,7 +123,8 @@
<filter name="group_branch" string="Branch" domain="[]" context="{'group_by': 'is_branch'}"/>
</group>
<separator/>
<filter string="Attendance Today" name="today_less" domain="[('date','&lt;=',time.strftime('%%Y-%%m-%%d'))]"/>
<!--filter string="Attendance Today" name="today_less" domain="[('date','&lt;=',time.strftime('%%Y-%%m-%%d'))]"/-->
<filter string="Attendance Today" name="today_less" domain="[('to_date', '=', 'True')]"/>
<separator/>
<separator/>
<filter string="My Attendance" name="my_attendance" domain="[('employee_id.user_id', '=', uid)]"/>

View File

@ -145,10 +145,28 @@
<field name="request_after_day" groups="hr.group_hr_manager,hr.group_hr_user"/>
</group>
<group string="Overtime Accounts Settings" >
<!--group string="Overtime Accounts Settings" >
<field name="journal_overtime_id" string="Journal Overtime"/>
<field name="account_overtime_id" string="Account Overtime"/>
</group>
</group-->
<notebook>
<page string="Accounting Info">
<group>
<field name="transfer_by_emp_type" />
<field name="journal_overtime_id" string="Journal Overtime"/>
<field name="account_overtime_id" string="Account Overtime"
attrs="{'invisible' : [('transfer_by_emp_type', '=', True)]}"/>
</group>
<field name="account_ids" attrs="{'invisible' : [('transfer_by_emp_type', '=', False)]}">
<tree editable="bottom">
<field name="emp_type_id"/>
<field name="debit_account_id"/>
</tree>
</field>
</page>
</notebook>
</page>
</notebook>
<notebook attrs="{'invisible':[('is_full_day','=',True)]}">
@ -260,10 +278,27 @@
<field name="request_after_day" groups="hr.group_hr_manager,hr.group_hr_user"/>
</group>
<group string="Overtime Accounts Settings" >
<!--group string="Overtime Accounts Settings" >
<field name="journal_overtime_id" string="Journal Overtime"/>
<field name="account_overtime_id" string="Account Overtime"/>
</group>
</group-->
<notebook>
<page string="Accounting Info">
<group>
<field name="transfer_by_emp_type" />
<field name="journal_overtime_id" string="Journal Overtime"/>
<field name="account_overtime_id" string="Account Overtime"
attrs="{'invisible' : [('transfer_by_emp_type', '=', True)]}"/>
</group>
<field name="account_ids" attrs="{'invisible' : [('transfer_by_emp_type', '=', False)]}">
<tree editable="bottom">
<field name="emp_type_id"/>
<field name="debit_account_id"/>
</tree>
</field>
</page>
</notebook>
</page>
</notebook>

View File

@ -3967,3 +3967,16 @@ msgstr "ساعات شهرية"
#, python-format
msgid "Date To must be on the same day as Date From."
msgstr "يجب أن يكون يوم تاريخ البداية هو نفسه يوم تاريخ النهاية."
#. module: employee_requests
#: code:addons/employee_requests/models/employee_overtime_request.py:0
#, python-format
msgid "You Must Enter The Journal Name Overtim Setting."
msgstr "يجب إدخال إسم دفتر اليومية لإعدادات العمل الإضافي"
#. module: employee_requests
#: code:addons/employee_requests/models/employee_overtime_request.py:0
#, python-format
msgid "Employee %s, has no Overtime Account Setting Base On Employee Type."
msgstr "الموظف %s, ليس لديه إعدادات حساب بند صرف للأجر الإضافي حسب نوع الموظف."

View File

@ -207,29 +207,38 @@ class employee_overtime_request(models.Model):
if self.transfer_type == 'accounting':
for item in self:
for record in item.line_ids_over_time:
emp_type = record.employee_id.employee_type_id
account_debit_id = record.employee_id.contract_id.working_hours.get_debit_overtim_account_id(emp_type)
journal_id = record.employee_id.contract_id.working_hours.journal_overtime_id
if not journal_id:
raise exceptions.Warning(_('You Must Enter The Journal Name Overtim Setting.'))
if not account_debit_id:
raise exceptions.Warning(_('Employee %s, has no Overtime Account Setting Base On Employee Type.'
) % record.employee_id.name)
debit_line_vals = {
'name': record.employee_id.name,
'debit': record.price_hour,
'account_id': item.account_id.id,
'account_id': account_debit_id.id,
'partner_id': record.employee_id.user_id.partner_id.id
}
credit_line_vals = {
'name': record.employee_id.name,
'credit': record.price_hour,
'account_id': item.journal_id.default_account_id.id,
'account_id': journal_id.default_account_id.id,
'partner_id': record.employee_id.user_id.partner_id.id
}
if not record.move_id:
move = record.env['account.move'].create({
'state': 'draft',
'journal_id': item.journal_id.id,
'journal_id': journal_id.id,
'date': item.request_date,
'ref': record.employee_id.name,
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
'res_model': 'employee.overtime.request',
'res_id': self.id
})
record.account_id = account_debit_id.id
record.journal_id = journal_id.id
record.move_id = move.id
self.state = "validated"
if self.transfer_type == 'payroll':
@ -422,13 +431,13 @@ class HrEmployeeOverTime(models.Model):
employee_id.remove(line.employee_id.id)
return {'domain': {'employee_id': [('id', 'in', employee_id)]}}
@api.model
'''@api.model
def default_get(self, fields):
res = super(HrEmployeeOverTime, self).default_get(fields)
if self._context.get('account_id') and self._context.get('journal_id'):
res['account_id'] = self._context.get('account_id')
res['journal_id'] = self._context.get('journal_id')
return res
return res'''
@api.depends('employee_id.contract_id', 'over_time_workdays_hours', 'over_time_vacation_hours', 'employee_id',
'calculate_from_total')

View File

@ -92,9 +92,12 @@ class EmployeeOtherRequest(models.Model):
if not item.employee_dependant:
raise exceptions.Warning(_('Please The dependents were not Included'))
if item.employee_id.contract_id.contract_status == 'single':
raise exceptions.Warning(_('You can not Add Fimaly record Because Employee is Single'))
#if item.employee_id.contract_id.contract_status == 'single':
#raise exceptions.Warning(_('You can not Add Fimaly record Because Employee is Single'))
else:
for rec in item.employee_dependant:
if not rec.attachment:
raise exceptions.Warning(_('Please Insert dependents Attachments Files Below!'))
item.state = "submit"
if item.request_type == 'qualification':

View File

@ -91,11 +91,13 @@
</p>
<br/>
<h4 style="text-align: center;">
<strong>وتقبلوا تحياتنا،،،</strong>
<span>مدير إدارة الموارد البشرية</span>
</h4>
<br/>
<h4 style="text-align: center;">
<strong>إدارة الموارد البشرية</strong>
<span>Director of Human Resource</span>
<br/>
<br/>
<span t-esc="env.user.sudo().company_id.hr_manager_id.name"/>
</h4>
<br/>

View File

@ -85,15 +85,15 @@
<field name="reason" string="Reason" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="exception" groups="hr_base.group_executive_manager,hr.group_hr_user" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="journal_id" string="Journal"
<!--field name="journal_id" string="Journal"
attrs="{'invisible':[('transfer_type','!=','accounting')], 'readonly':[('state','!=','executive_office')], 'required': [('state', '=', 'executive_office'),('transfer_type','=','accounting')]}" force_save="1"/>
<field name="account_id" string="Account"
attrs="{'invisible':[('transfer_type','!=','accounting')], 'readonly':[('state','!=','executive_office')], 'required': [('state', '=', 'executive_office'),('transfer_type','=','accounting')]}" force_save="1"/>
attrs="{'invisible':[('transfer_type','!=','accounting')], 'readonly':[('state','!=','executive_office')], 'required': [('state', '=', 'executive_office'),('transfer_type','=','accounting')]}" force_save="1"/-->
</group>
</group>
<separator string="Employees Over Time"/>
<field name="line_ids_over_time" context="{'account_id': account_id, 'journal_id': journal_id}" force_save="1"
<field name="line_ids_over_time" force_save="1"
attrs="{'readonly':[('state','not in',('submit','draft'))], 'required': [('state', '=', 'hr_aaproval')]}">
<tree string="Employee Over Time" editable="bottom">
<field name="employee_id"/>

View File

@ -2692,6 +2692,39 @@ msgstr "للأسف الموظف %s, لايمكن تجاوز عدد %s يوم, و
msgid "Approve By"
msgstr "تصديق بواسطة"
#. module: exp_official_mission
#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_official_mission_type_form_view
msgid "Accounting Info"
msgstr "اعداد الحسابات"
#. module: exp_official_mission
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_official_mission_type__transfer_by_emp_type
#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_official_mission_type_form_view
msgid "Transfer By Emp Type"
msgstr "ترحيل حسب نوع الموظف"
#. module: exp_official_mission
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_mission_type_account__emp_type_id
msgid "Employee Type"
msgstr "نوع الموظف"
#. module: exp_official_mission
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_mission_type_account__debit_account_id
msgid "Debit Account"
msgstr "بند الصرف"
#. module: exp_official_mission
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
#, python-format
msgid "You Must Enter The Journal Name Mission Type %s."
msgstr "يجب إدخال اعدادات اسم دفتر اليومية لـ %s."
#. module: exp_official_mission
#: code:addons/exp_official_mission/models/hr_official_mission.py:0
#, python-format
msgid "Employee %s, The Mission %s Has No Account Setting Base On Employee Type."
msgstr "الموظف %s,لايوجد إعدادات بند الصرف لـ %s حسب نوع الموظف."
#. module: exp_official_mission
#: model:ir.model.fields.selection,name:exp_official_mission.selection__hr_official_mission_type__approve_by__direct_manager
msgid "Direct Manager"

View File

@ -568,25 +568,35 @@ class HrOfficialMission(models.Model):
if self.employee_ids and self.mission_type.related_with_financial:
# move amounts to journal entries
if self.move_type == 'accounting':
if self.mission_type.account_id and self.mission_type.journal_id:
#if self.mission_type.account_id and self.mission_type.journal_id:
if self.mission_type.related_with_financial==True:
for item in self.employee_ids:
emp_type = item.employee_id.employee_type_id
account_debit_id = self.mission_type.get_debit_mission_account_id(emp_type)
journal_id = self.mission_type.journal_id
if not journal_id:
raise exceptions.Warning(_('You Must Enter The Journal Name Mission Type %s.')% self.mission_type.name)
if not account_debit_id:
raise exceptions.Warning(_('Employee %s, The Mission %s Has No Account Setting Base On Employee Type.'
) % (item.employee_id.name,self.mission_type.name))
if item.amount > 0.0:
debit_line_vals = {
'name': item.employee_id.name + ' in official mission "%s" ' % self.mission_type.name,
'debit': item.amount,
'account_id': self.mission_type.account_id.id,
#'account_id': self.mission_type.account_id.id,
'account_id': account_debit_id.id,
'partner_id': item.employee_id.user_id.partner_id.id
}
credit_line_vals = {
'name': item.employee_id.name + ' in official mission "%s" ' % self.mission_type.name,
'credit': item.amount,
'account_id': self.mission_type.journal_id.default_account_id.id,
'account_id': journal_id.default_account_id.id,
'partner_id': item.employee_id.user_id.partner_id.id
}
if not item.account_move_id:
move = self.env['account.move'].create({
'state': 'draft',
'journal_id': self.mission_type.journal_id.id,
'journal_id': journal_id.id,
'date': date.today(),
'ref': 'Official mission for employee "%s" ' % item.employee_id.name,
'line_ids': [(0, 0, debit_line_vals), (0, 0, credit_line_vals)],
@ -595,9 +605,9 @@ class HrOfficialMission(models.Model):
})
# fill account move for each employee
item.write({'account_move_id': move.id})
else:
raise exceptions.Warning(
_('You do not have account or journal in mission type "%s" ') % self.mission_type.name)
#else:
#raise exceptions.Warning(
#_('You do not have account or journal in mission type "%s" ') % self.mission_type.name)
# move amounts to advantages of employee in contract
elif self.move_type == 'payroll':
@ -972,6 +982,9 @@ class HrOfficialMissionType(models.Model):
special_hours = fields.Boolean(string='Special Hours', default=False)
approve_by = fields.Selection([('direct_manager', 'Direct Manager'), ('depart_manager', 'HR Department')], default='direct_manager', required=True)
transfer_by_emp_type = fields.Boolean('Transfer By Emp Type')
account_ids = fields.One2many('hr.mission.type.account', 'mission_id')
@api.onchange('duration_type')
def _change_duration_type(self):
for rec in self:
@ -987,6 +1000,21 @@ class HrOfficialMissionType(models.Model):
raise exceptions.Warning(_('You Can Not Delete Mission Type, Because There is a Related other record'))
return super(HrOfficialMissionType, self).unlink()
#get acoount IDs base on Mission Type account config
def get_debit_mission_account_id(self, emp_type):
if not self.transfer_by_emp_type : return self.account_id
account_mapping = self.account_ids.filtered(lambda a: a.emp_type_id.id == emp_type.id)
return account_mapping[0].debit_account_id if account_mapping else False
class HrMissionTypeAccount(models.Model):
_name = 'hr.mission.type.account'
_description = 'Mission Type Account Mapping'
mission_id = fields.Many2one('hr.official.mission.type', string="Mission Type", required=True, ondelete="cascade")
emp_type_id = fields.Many2one('hr.contract.type', string="Employee Type", required=True)
debit_account_id = fields.Many2one('account.account', string="Debit Account", required=True)
class HrOfficialMissionEmployee(models.Model):
_name = 'hr.official.mission.employee'

View File

@ -12,5 +12,5 @@ access_employee_course_name_hr,access_employee_course_name_hr,model_employee_cou
access_ticket_class_user,access_ticket_class_user,model_ticket_class,hr.group_hr_user,1,1,1,0
access_employee_mission_selection_wizard,employee.mission.selection.wizard,model_employee_mission_selection_wizard,base.group_user,1,1,1,1
access_training_appraisal_wizard,training_appraisal_wizard,model_training_appraisal_wizard,base.group_user,1,1,1,1
access_hr_mission_type_account_hr_user,access_hr_mission_type_account,model_hr_mission_type_account,hr.group_hr_user,1,1,1,1
access_hr_mission_type_account_emp,access_hr_mission_type_account,model_hr_mission_type_account,base.group_user,1,0,0,0

1 id name model_id:id group_id/id perm_read perm_write perm_create perm_unlink
12 access_ticket_class_user access_ticket_class_user model_ticket_class hr.group_hr_user 1 1 1 0
13 access_employee_mission_selection_wizard employee.mission.selection.wizard model_employee_mission_selection_wizard base.group_user 1 1 1 1
14 access_training_appraisal_wizard training_appraisal_wizard model_training_appraisal_wizard base.group_user 1 1 1 1
15 access_hr_mission_type_account_hr_user access_hr_mission_type_account model_hr_mission_type_account hr.group_hr_user 1 1 1 1
16 access_hr_mission_type_account_emp access_hr_mission_type_account model_hr_mission_type_account base.group_user 1 0 0 0

View File

@ -216,8 +216,7 @@
<field name="date_to" readonly="1"/>
<field name="account_move_id" string="Account Move" readonly="1" force_save="1"
groups="hr_base.group_account_manager,hr.group_hr_user"
attrs="{'column_invisible':['|',('parent.related_with_financial','=',False),
('parent.move_type','!=','accounting')]}"/>
attrs="{'invisible': [('account_move_id', '=', False)]}"/>
</group>

View File

@ -72,14 +72,33 @@
attrs="{'invisible':[('related_with_financial','=',False)],'required':[('related_with_financial','=',True)]}"/>
<field name="approve_by"/>
<separator string="Accounting"
<!--separator string="Accounting"
attrs="{'invisible':[('related_with_financial','=',False)]}"/>
<field name="account_id" string="Account"
attrs="{'invisible':[('related_with_financial','=',False)],'required':[('related_with_financial','=',True)]}"/>
<field name="journal_id" string="Journal"
attrs="{'invisible':[('related_with_financial','=',False)],'required':[('related_with_financial','=',True)]}"/>
attrs="{'invisible':[('related_with_financial','=',False)],'required':[('related_with_financial','=',True)]}"/-->
</group>
</group>
<notebook>
<page string="Accounting Info">
<group>
<field name="transfer_by_emp_type" />
<field name="journal_id" string="Journal"
attrs="{'required':[('related_with_financial','=',True)]}"/>
<field name="account_id" string="Account"
attrs="{'required':[('related_with_financial','=',True),('transfer_by_emp_type', '=', False)],
'invisible' : [('transfer_by_emp_type', '=', True)]}"/>
</group>
<field name="account_ids" attrs="{'invisible' : [('transfer_by_emp_type', '=', False)]}">
<tree editable="bottom">
<field name="emp_type_id"/>
<field name="debit_account_id"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>

View File

@ -54,6 +54,12 @@ class EmployeePromotions(models.Model):
self.current_salary = self.employee_id.contract_id.total_allowance
self.old_basic_salary = self.employee_id.contract_id.salary
@api.onchange('new_degree')
def _new_basic_salary(self):
for rec in self:
if rec.new_degree:
rec.new_basic_salary = rec.sudo().new_degree.base_salary
@api.constrains('new_basic_salary')
def check_new_basic_salary(self):
if self.new_basic_salary < 0:

View File

@ -7,7 +7,7 @@
<field name="inherit_id" ref="exp_official_mission.employee_official_mission_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='destination']" position="after">
<field name="include_in_experience" attrs="{'readonly':[('state','not in',('direct_manager','depart_manager'))]}"/>
<field name="include_in_experience" attrs="{'readonly':[('state','not in',('direct_manager','depart_manager'))]}" invisible='1'/>
</xpath>
<xpath expr="//field/tree/field[@name='account_move_id']" position="after">
<field name="include_in_experience" attrs="{'column_invisible':[('parent.include_in_experience','!=',True)],'readonly':[('parent.state','not in',('direct_manager','depart_manager'))]}"/>

View File

@ -4795,5 +4795,19 @@ msgstr "تسجيل الدخول الافتراضي"
msgid "Login"
msgstr "تسجيل الدخول"
#. module: hr_base
#: model:ir.model.fields,field_description:hr_base.field_resource_calendar__transfer_by_emp_type
msgid "Transfer By Emp Type"
msgstr "ترحيل حسب نوع الموظف"
#. module: hr_base
#: model:ir.model.fields,field_description:hr_base.field_hr.overtim.accounts__emp_type_id
msgid "Employee Type"
msgstr "نوع الموظف"
#. module: hr_base
#: model:ir.model.fields,field_description:hr_base.field_hr.overtim.accounts__debit_account_id
msgid "Debit Account"
msgstr "بند الصرف"

View File

@ -847,6 +847,24 @@ class HrAttendances(models.Model):
journal_overtime_id = fields.Many2one('account.journal')
account_overtime_id = fields.Many2one('account.account')
transfer_by_emp_type = fields.Boolean('Transfer By Emp Type')
account_ids = fields.One2many('hr.overtim.accounts', 'overtim_id')
#get account IDs base on Overtim Employees Type account config
def get_debit_overtim_account_id(self, emp_type):
if not self.transfer_by_emp_type : return self.account_overtime_id
account_mapping = self.account_ids.filtered(lambda a: a.emp_type_id.id == emp_type.id)
return account_mapping[0].debit_account_id if account_mapping else False
class HrOvertimAccounts(models.Model):
_name = 'hr.overtim.accounts'
_description = 'Overtim Account Mapping'
overtim_id = fields.Many2one('resource.calendar', string="Overtim Type", required=True, ondelete="cascade")
emp_type_id = fields.Many2one('hr.contract.type', string="Employee Type", required=True)
debit_account_id = fields.Many2one('account.account', string="Debit Account", required=True)
class HrQualificationName(models.Model):
_name = "hr.qualification.name"
_description = "HR Qualification Name"

View File

@ -76,3 +76,5 @@ access_work_location_hr,Access.emplpyee_work_location_hr,model_work_location,hr.
access_work_location_hr_group_user,Access.employee_work_location_group_user,model_work_location,base.group_user,1,1,1,1
access_ir_sequence_group_hr_user,ir_sequence group_hr_user,base.model_ir_sequence,hr.group_hr_user,1,1,1,1
access_company_document_type_hr_group_user,Access.company_document_type_group_user,model_company_document_type,hr.group_hr_user,1,1,1,1
access_hr_overtim_accounts_hr_user,access_hr_overtim_accounts,model_hr_overtim_accounts,hr.group_hr_user,1,1,1,1
access_hr_overtim_accounts_emp,access_hr_overtim_accounts,model_hr_overtim_accounts,base.group_user,1,0,0,0

1 id name model_id:id group_id/id perm_read perm_write perm_create perm_unlink
76 access_work_location_hr_group_user Access.employee_work_location_group_user model_work_location base.group_user 1 1 1 1
77 access_ir_sequence_group_hr_user ir_sequence group_hr_user base.model_ir_sequence hr.group_hr_user 1 1 1 1
78 access_company_document_type_hr_group_user Access.company_document_type_group_user model_company_document_type hr.group_hr_user 1 1 1 1
79 access_hr_overtim_accounts_hr_user access_hr_overtim_accounts model_hr_overtim_accounts hr.group_hr_user 1 1 1 1
80 access_hr_overtim_accounts_emp access_hr_overtim_accounts model_hr_overtim_accounts base.group_user 1 0 0 0

View File

@ -21,7 +21,7 @@
<field name="arch" type="xml">
<search string="Search Leave">
<field name="name"/>
<filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
<!--filter domain="[('state','in',('confirm','validate1'))]" string="To Approve" name="approve"/>
<filter string="Approved Leaves" domain="[('state', '=', 'validate')]" name="validated"/>
<separator/>
<filter name="active_types" string="Active Types" domain="[('holiday_status_id.active', '=', True)]" help="Filters only on allocations and requests that belong to an leave type that is 'active' (active field is True)"/>
@ -41,7 +41,9 @@
<filter string="My Requests" name="my_leaves" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter name="leaves" string="Leaves" domain="[('type', '=', 'remove')]"/>
<filter name="allocations" string="Allocations" domain="[('type', '=', 'add')]"/>
<filter name="allocations" string="Allocations" domain="[('type', '=', 'add')]"/-->
<filter string="My Requests" name="my_leaves" domain="[('user_id', '=', uid)]"/>
<separator/>
<field name="employee_id"/>
<field name="department_id"/>
<field name="holiday_status_id"/>

View File

@ -458,6 +458,9 @@ class HRHolidays(models.Model):
if holiday_dfrm or holiday_dto or holiday_btw:
raise exceptions.Warning(
_('Sorry The Replacement Employee %s Actually On Holiday For this Period') % rec.replace_by.name)
rec.delegate_acc = True
else:
rec.delegate_acc = False
def send_email_holiday(self, holiday, emp):
if holiday.visible_fields and holiday.remained_before > 0 and holiday.leave_type=='annual':
@ -1810,14 +1813,17 @@ class HRHolidays(models.Model):
microsecond=0)
if self.holiday_status_id.include_weekend:
self.include_weekend()
self.date_on = True
self.set_date()
@api.onchange('date_from')
def _onchange_date_from_2(self):
if self.date_to:
self.date_to = False
self.number_of_days_temp = False
self.date_on = True
self.set_date()
'''@api.onchange('date_from')
def _onchange_date_from_2(self):
if self.date_to:
self.date_to = False
self.number_of_days_temp = False'''
@api.onchange('date_to')
def _onchange_date_to(self):

View File

@ -46,7 +46,7 @@
'readonly':[('state','not in',('draft','confirm','validate'))]}"
groups="hr_holidays_community.group_hr_holidays_user,hr_base.group_division_manager"
domain="[('id', '!=', employee_id),('state', '=', 'open')]"/>
<field name="delegate_acc" attrs="{'readonly':[('state','!=','confirm')],'invisible':[('type','!=','remove')]}"
<field name="delegate_acc" attrs="{'readonly':[('state','!=','confirm')],'invisible':['|',('replace_by', '=', False),('type','!=','remove')]}"
groups="hr_base.group_division_manager,hr_holidays_community.group_hr_holidays_user"/>
<field name="notes" string="Notes" invisible="1"/>
<field name="canceled_duration" string="Canceled Duration"