Merge pull request #4722 from expsa/bakry_hr

Bakry hr
This commit is contained in:
bakry 2025-09-21 11:33:00 +03:00 committed by GitHub
commit 7e04b99088
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 22 additions and 2 deletions

View File

@ -428,7 +428,7 @@ msgstr "تكلفة التدريب"
#: model:ir.model.fields,field_description:exp_official_mission.field_hr_job__course_ids
#: model_terms:ir.ui.view,arch_db:exp_official_mission.view_hr_job_cours_form_inherit
msgid "Courses"
msgstr "المسار التدريبي"
msgstr "المسار التدريبي للوظيفة"
#. module: exp_official_mission
#: model_terms:ir.actions.act_window,help:exp_official_mission.employee_course_name_action

View File

@ -2562,6 +2562,8 @@ class HrPayslipRun(models.Model):
elif month_range > 30 and contract_end_date.day > 30:
duration = relativedelta(contract_end_date, contract_start_date).days
if duration == 0:
duration = duration + 1
elif month_range == 28 and contract_end_date.day == 28:
duration = relativedelta(contract_end_date, contract_start_date).days + 3
@ -2791,6 +2793,8 @@ class HrPayslipRun(models.Model):
duration = relativedelta(contract_end_date, contract_start_date).days + 1
elif month_range > 30 and contract_end_date.day > 30:
duration = relativedelta(contract_end_date, contract_start_date).days
if duration == 0:
duration = duration + 1
elif month_range == 28 and contract_end_date.day == 28:
duration = relativedelta(contract_end_date, contract_start_date).days + 3
elif month_range == 29 and contract_end_date.day == 29:

View File

@ -3386,7 +3386,7 @@ msgstr "تأكد"
#: model:ir.model.fields.selection,name:hr_holidays_public.selection__hr_holiday_officials__state__confirm
#, python-format
msgid "confirm"
msgstr ""
msgstr "معتمد"
#. module: hr_holidays_public
#: model_terms:ir.ui.view,arch_db:hr_holidays_public.leaves_balance_form_view

View File

@ -1774,3 +1774,9 @@ msgstr "رقم الموظف"
msgid "My Requests"
msgstr "طلبـاتي"
#. module: hr_loans_salary_advance
#: code:addons/hr_loans_salary_advance/models/hr_loan_salary_advance.py:0
#, python-format
msgid "Sorry, This Loan Is Linked To The Payment Or Scheduling Loan."
msgstr "عفوآ, هذه القرض مرتبط بدفع وجدولة القروض."

View File

@ -184,6 +184,10 @@ class HrSalaryAdvance(models.Model):
def refused(self):
for item in self:
loan_suspension = self.env['hr.loan.payment.suspension'].search([('loan_id','=', item.id)], limit=1)
if item.id == loan_suspension.loan_id.id:
raise exceptions.Warning(_("Sorry, This Loan Is Linked To The Payment Or Scheduling Loan."))
for line in item.deduction_lines:
if line.paid is True:
raise exceptions.Warning(_('You can not Refuse Loan because Loan with Deduction in Salary'))
@ -206,6 +210,10 @@ class HrSalaryAdvance(models.Model):
def create_loan(self):
for item in self:
loan_suspension = self.env['hr.loan.payment.suspension'].search([('loan_id','=', item.id)], limit=1)
if item.id == loan_suspension.loan_id.id:
raise exceptions.Warning(_("Sorry, This Loan Is Linked To The Payment Or Scheduling Loan."))
if item.gm_propos_amount <=0:
raise exceptions.Warning(_("Sorry, Approved Amount Must Be Greater Than Zero"))

View File

@ -259,6 +259,8 @@ class HrLoanPaymentSuspension(models.Model):
for rec in self:
if rec.state != 'draft':
raise UserError(_('Sorry you cannot delete a document is not in draft state.'))
rec.suspend_ids.unlink()
suspension_false = self.env['hr.loan.installment.suspension'].search([('pay_suspend_id', '=', False)]).unlink()
return super(HrLoanPaymentSuspension, self).unlink()