From b68ee7ea4ef7cb48e7fd97088658b324ab638119 Mon Sep 17 00:00:00 2001 From: blackbelts <74664702+eslamtalaat74@users.noreply.github.com> Date: Tue, 17 Jun 2025 17:19:14 +0300 Subject: [PATCH] modify on official_mission_id --- odex25_hr/exp_official_mission/i18n/ar_001.po | 9 ++++ .../models/hr_official_mission.py | 7 ++- .../views/hr_official_mission.xml | 44 +++++++++++-------- .../exp_official_mission/views/training.xml | 7 +-- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/odex25_hr/exp_official_mission/i18n/ar_001.po b/odex25_hr/exp_official_mission/i18n/ar_001.po index abe7212e7..9978c0fee 100644 --- a/odex25_hr/exp_official_mission/i18n/ar_001.po +++ b/odex25_hr/exp_official_mission/i18n/ar_001.po @@ -515,6 +515,15 @@ msgstr "تاريخ البداية" msgid "Date Request" msgstr "تاريخ الطلب" +#. module: exp_official_mission +#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_especially_hours_form_view +#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_especially_hours_tree_view +#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_official_mission_form_view +#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_training_form_view +#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_training_tree_view +msgid "Date Requestt" +msgstr "التاريخ " + #. module: exp_official_mission #: model:ir.model.fields,field_description:exp_official_mission.field_hr_official_mission__date_to #: model:ir.model.fields,field_description:exp_official_mission.field_hr_official_mission_employee__date_to diff --git a/odex25_hr/exp_official_mission/models/hr_official_mission.py b/odex25_hr/exp_official_mission/models/hr_official_mission.py index ea78d1399..769e908b8 100644 --- a/odex25_hr/exp_official_mission/models/hr_official_mission.py +++ b/odex25_hr/exp_official_mission/models/hr_official_mission.py @@ -297,6 +297,7 @@ class HrOfficialMission(models.Model): weekend_names = [d.name.lower() for d in weekend_days] date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names] + item.date_duration = len(date_range) else: @@ -362,7 +363,11 @@ class HrOfficialMission(models.Model): date_range = [d for d in date_range if d.strftime('%A').lower() not in weekend_names] - line.days = len(date_range) + if not item.table_ids: + line.days = len(date_range) + else: + unique_dates = set(item.table_ids.mapped('date')) + item.days = len(unique_dates) if item.mission_type.related_with_financial is True: if item.mission_type.type_of_payment == 'fixed': if item.mission_type.day_price: diff --git a/odex25_hr/exp_official_mission/views/hr_official_mission.xml b/odex25_hr/exp_official_mission/views/hr_official_mission.xml index 849da4d4a..8e37aa605 100644 --- a/odex25_hr/exp_official_mission/views/hr_official_mission.xml +++ b/odex25_hr/exp_official_mission/views/hr_official_mission.xml @@ -167,24 +167,24 @@ - - + + - - - - - - - - - - + + + + + + + + + + @@ -243,11 +243,11 @@ search - - - - - + + + + + @@ -256,7 +256,7 @@ - + @@ -287,7 +287,12 @@ - + + + @@ -342,6 +347,7 @@ + diff --git a/odex25_hr/exp_official_mission/views/training.xml b/odex25_hr/exp_official_mission/views/training.xml index 01662e423..7ed7b7262 100644 --- a/odex25_hr/exp_official_mission/views/training.xml +++ b/odex25_hr/exp_official_mission/views/training.xml @@ -369,11 +369,11 @@ - + + required="1" widget="float_time"/> + required="1" widget="float_time"/> @@ -430,6 +430,7 @@ +