modify on official_mission_id222
This commit is contained in:
parent
41c9092188
commit
2518cce77d
|
|
@ -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 "مجموع الساعات"
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
action="employee_training_action" />
|
||||
|
||||
<record model="ir.ui.view" id="employee_training_form_view">
|
||||
|
||||
<field name="name">Employee Training</field>
|
||||
<field name="model">hr.official.mission</field>
|
||||
<field name="arch" type="xml">
|
||||
|
|
@ -546,7 +547,7 @@
|
|||
<field name="official_mission_id"
|
||||
readonly="1"
|
||||
string='Mission Type'
|
||||
context="{'form_view_ref': 'exp_official_mission.employee_training_action'}"
|
||||
context="{'form_view_ref': 'exp_official_mission.employee_training_form_view'}"
|
||||
/>
|
||||
<field name="days" readonly="1" />
|
||||
<field name="hours" readonly="1" widget="float_time" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue