Merge pull request #168 from expsa/abuzar_task_hr

fix some bug
This commit is contained in:
AbuzarExp 2024-07-11 16:54:32 +03:00 committed by GitHub
commit 590df69aa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 1 additions and 30 deletions

View File

@ -404,7 +404,6 @@ class SalaryRuleInput(models.Model):
number_of_days= number_of_days + 1
if pyroll_days ==31:
number_of_days= number_of_days - 1
print('###############111111###################',number_of_days)
if holiday.number_of_days_temp >= 0: # if holiday.number_of_days_temp <= 0:
payslip.worked_days_line_ids = [(0, 0, {
'name': "Unpaid Holidays For this month",
@ -429,7 +428,6 @@ class SalaryRuleInput(models.Model):
number_of_days= number_of_days + 1
if pyroll_days ==31:
number_of_days= number_of_days - 1
print('###############222222#################',number_of_days)
if number_of_days >= 0: # number_of_days <= 0
payslip.worked_days_line_ids = [(0, 0, {
'name': "Unpaid Holidays For this month",
@ -454,7 +452,6 @@ class SalaryRuleInput(models.Model):
number_of_days= number_of_days + 1
if pyroll_days ==31:
number_of_days= number_of_days - 1
print('###############3333333###############',number_of_days)
if number_of_days >= 0: # number_of_days <= 0
payslip.worked_days_line_ids = [(0, 0, {
'name': "Unpaid Holidays For this month",
@ -477,7 +474,6 @@ class SalaryRuleInput(models.Model):
number_of_days= number_of_days + 1
if number_of_days ==31:
number_of_days= number_of_days - 1
print('###############4444444###############',number_of_days)
if number_of_days >= 0: # number_of_days <= 0
payslip.worked_days_line_ids = [(0, 0, {
'name': "Unpaid Holidays For this month",
@ -690,7 +686,6 @@ class SalaryRuleInput(models.Model):
number_of_days = number_of_days + 2
if pyroll_days == 29:
number_of_days = number_of_days + 1
print('###############reconcile1111############',start_holiday,end_holiday)
if number_of_days >= 0: # number_of_days <= 0
payslip.worked_days_line_ids = [(0, 0, {
'name': "Exclusion or Reconcile Paid Holidays",
@ -701,7 +696,6 @@ class SalaryRuleInput(models.Model):
'number_of_hours': 0.0,
'contract_id': payslip.contract_id.id})]
elif payslip.date_to >= end_holiday and start_holiday >= payslip.date_from:
print('###############reconcile222222############',start_holiday,end_holiday)
pyroll_days = relativedelta(pyroll_end, payroll_start).days + 1
number_of_days = relativedelta(pyroll_end, start_holiday).days + 1
@ -732,7 +726,6 @@ class SalaryRuleInput(models.Model):
if pyroll_days == 31:
number_of_days = number_of_days - 1
print('###############reconcile3333############',start_holiday,end_holiday,pyroll_days)
if number_of_days >= 0: # number_of_days <= 0
payslip.worked_days_line_ids = [(0, 0, {
'name': "Exclusion or Reconcile Paid Holidays",
@ -751,7 +744,6 @@ class SalaryRuleInput(models.Model):
number_of_days = number_of_days + 1
if number_of_days ==31:
number_of_days= number_of_days - 1
print('###############reconcile444444############',start_holiday,end_holiday)
if number_of_days >= 0: # number_of_days <= 0
payslip.worked_days_line_ids = [(0, 0, {
'name': "Exclusion or Reconcile Paid Holidays",

View File

@ -123,7 +123,6 @@ class OvertimeReportXls(models.AbstractModel):
def generate_xlsx_report(self, workbook, data, datas):
x = self.env['report.hr_base_reports.overtime_report']
result = OvertimeReportView._get_report_values(x, False, data['form'])
print('result', result)
start_date = data['form']['date_from']
end_date = data['form']['date_to']
sheet = workbook.add_worksheet(U'Overtime Report')

View File

@ -83,7 +83,6 @@ class ContractExtension(models.Model):
date_end = datetime.datetime.strptime(str(item.date_to), '%Y-%m-%d').date()
trial_duration = relativedelta.relativedelta(date_end, date_start).months
if trial_duration > 3:
print(".................................")
raise exceptions.Warning(_('The period of trail duration must be not more than 3 months'))
def confirm(self):

View File

@ -169,7 +169,6 @@ class Employee(models.Model):
('holiday_status_id.limit', '=', False),
('state', '=', 'validate')
], fields=['number_of_days', 'employee_id'], groupby=['employee_id'])
print('leaves count', leaves)
mapping = dict([(leave['employee_id'][0], leave['number_of_days']) for leave in leaves])
for employee in self:
employee.leaves_count = mapping.get(employee.id)
@ -182,7 +181,6 @@ class Employee(models.Model):
employee.show_leaves = True
else:
employee.show_leaves = False
print('show', employee.show_leaves)
def _compute_absent_employee(self):
today_date = datetime.datetime.utcnow().date()

View File

@ -105,7 +105,6 @@ class HolidaysType(models.Model):
for holiday_status in self:
result = data_days.get(holiday_status.id, {})
print('result', result)
holiday_status.max_leaves = result.get('max_leaves', 0)
holiday_status.leaves_taken = result.get('leaves_taken', 0)
holiday_status.remaining_leaves = result.get('remaining_leaves', 0)

View File

@ -555,8 +555,6 @@ class HRHolidays(models.Model):
next_years_value = create_year_date + item.number_of_years
range_year_value = datetime.strftime(fields_date,
"{0}-12-31 23:59:59".format(next_years_value))
# print('range2', range_year_value)
# print('tttt', range_year_value >= str(current_date_time))
if 365 > days >= item.number_of_days or \
days >= 365 and range_year_value >= str(current_date_time):
if not already_exist.holiday_ids:

View File

@ -128,6 +128,7 @@
<button string="HR Manager Approve" name="financial_manager" type="object"
attrs="{'invisible':[('state','!=','validate')]}"
states="validate"
groups="hr_holidays_community.group_hr_holidays_user"
class="oe_highlight"/>

View File

@ -339,8 +339,6 @@ class HrSalaryAdvance(models.Model):
# total_number += record.total_deductions - recordss
total_number = total_number - emp_deduction
print("********************************",self.request_type.percentage)
print("********************************",self.request_type)
percentage = self.request_type.percentage / 100
percentage_salary = self.monthly_salary * percentage

View File

@ -8,11 +8,8 @@ sys.path.append("zk")
conn = None
zk = ZK('192.168.1.10', port=4370, timeout=5)
try:
print('Connecting to device ...')
conn = zk.connect()
print('Disabling device ...')
conn.disable_device()
print('Firmware Version: : {}'.format(conn.get_firmware_version()))
# print '--- Get User ---'
users = conn.get_users()
for user in users:
@ -20,16 +17,7 @@ try:
if user.privilege == const.USER_ADMIN:
privilege = 'Admin'
print('- UID #{}'.format(user.uid))
print(' Name : {}'.format(user.name))
print(' Privilege : {}'.format(privilege))
print(' Password : {}'.format(user.password))
print(' Group ID : {}'.format(user.group_id))
print(' User ID : {}'.format(user.user_id))
print("Voice Test ...")
conn.test_voice()
print('Enabling device ...')
conn.enable_device()
except Exception as e:
print("Process terminate : {}".format(e))

View File

@ -246,7 +246,6 @@ class TOBase(models.AbstractModel):
period_start_date = last_dt + relativedelta(days=1)
res.sort()
# print(res)
return res
def get_days_of_month_from_date(self, dt):