From 2518cce77d8e325991e777e0598d0457497242c7 Mon Sep 17 00:00:00 2001 From: blackbelts <74664702+eslamtalaat74@users.noreply.github.com> Date: Wed, 18 Jun 2025 09:24:47 +0300 Subject: [PATCH] modify on official_mission_id222 --- odex25_hr/exp_official_mission/i18n/ar_001.po | 3 ++- .../models/hr_official_mission.py | 15 +++++++++++++-- odex25_hr/exp_official_mission/views/training.xml | 3 ++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/odex25_hr/exp_official_mission/i18n/ar_001.po b/odex25_hr/exp_official_mission/i18n/ar_001.po index fe9789d70..7548f531d 100644 --- a/odex25_hr/exp_official_mission/i18n/ar_001.po +++ b/odex25_hr/exp_official_mission/i18n/ar_001.po @@ -693,6 +693,7 @@ msgstr "المدة بالساعات" #: 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_training_form_view #: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_training_tree_view + msgid "Total Hours" msgstr "مجموع الساعات" @@ -1809,7 +1810,7 @@ msgstr "نوع طلب التذكرة" #: 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 #: model_terms:ir.ui.view,arch_db:exp_official_mission.hr_employees_training_lines_form - +#: model_terms:ir.ui.view,arch_db:exp_official_mission.employee_training_tree_view msgid "Total Hours" msgstr "مجموع الساعات" 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 f234ec0cf..3e6f9f67e 100644 --- a/odex25_hr/exp_official_mission/models/hr_official_mission.py +++ b/odex25_hr/exp_official_mission/models/hr_official_mission.py @@ -1726,11 +1726,22 @@ class MissionTable(models.Model): date = fields.Date() - hour_from = fields.Float(default=8) - hour_to = fields.Float(default=16) + hour_from = fields.Float() + hour_to = fields.Float() trainer_id = fields.Many2one('res.partner', string="Trainer") destination_id = fields.Many2one('hr.official.mission', string="Destination ") + @api.model + def default_get(self, fields_list): + res = super().default_get(fields_list) + parent_id = self.env.context.get('default_destination_id') + if parent_id: + parent = self.env['hr.official.mission'].browse(parent_id) + if parent and parent.hour_from: + res['hour_from'] = parent.hour_from + res['hour_to'] = parent.hour_to + return res + @api.constrains('date', 'destination_id') def _check_date_within_destination(self): for rec in self: diff --git a/odex25_hr/exp_official_mission/views/training.xml b/odex25_hr/exp_official_mission/views/training.xml index 5393c5671..56bbe09b7 100644 --- a/odex25_hr/exp_official_mission/views/training.xml +++ b/odex25_hr/exp_official_mission/views/training.xml @@ -15,6 +15,7 @@ action="employee_training_action" /> + Employee Training hr.official.mission @@ -546,7 +547,7 @@