diff --git a/addons/hr_work_entry/i18n/hr_work_entry.pot b/addons/hr_work_entry/i18n/hr_work_entry.pot index 91e98c34334..a64e0ef1f7b 100644 --- a/addons/hr_work_entry/i18n/hr_work_entry.pot +++ b/addons/hr_work_entry/i18n/hr_work_entry.pot @@ -221,8 +221,7 @@ msgstr "" #. module: hr_work_entry #: model:ir.model.fields,field_description:hr_work_entry.field_hr_work_entry__duration -#: model_terms:ir.ui.view,arch_db:hr_work_entry.hr_work_entry_view_form -msgid "Period" +msgid "Duration" msgstr "" #. module: hr_work_entry diff --git a/addons/hr_work_entry/models/hr_work_entry.py b/addons/hr_work_entry/models/hr_work_entry.py index c6a19ab4263..f9c9b01baf6 100644 --- a/addons/hr_work_entry/models/hr_work_entry.py +++ b/addons/hr_work_entry/models/hr_work_entry.py @@ -21,8 +21,8 @@ class HrWorkEntry(models.Model): employee_id = fields.Many2one('hr.employee', required=True, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", index=True) date_start = fields.Datetime(required=True, string='From') date_stop = fields.Datetime(compute='_compute_date_stop', store=True, readonly=False, string='To') - duration = fields.Float(compute='_compute_duration', store=True, string="Period", readonly=False) - work_entry_type_id = fields.Many2one('hr.work.entry.type', index=True) + duration = fields.Float(compute='_compute_duration', store=True, string="Duration", readonly=False) + work_entry_type_id = fields.Many2one('hr.work.entry.type', index=True, default=lambda self: self.env['hr.work.entry.type'].search([], limit=1)) color = fields.Integer(related='work_entry_type_id.color', readonly=True) state = fields.Selection([ ('draft', 'Draft'), diff --git a/addons/hr_work_entry/views/hr_work_entry_views.xml b/addons/hr_work_entry/views/hr_work_entry_views.xml index 2ae4320d659..324963075d2 100644 --- a/addons/hr_work_entry/views/hr_work_entry_views.xml +++ b/addons/hr_work_entry/views/hr_work_entry_views.xml @@ -46,27 +46,23 @@ Note: Validated work entries cannot be modified. -
-

- -

-
+ - diff --git a/addons/hr_work_entry_contract/i18n/hr_work_entry_contract.pot b/addons/hr_work_entry_contract/i18n/hr_work_entry_contract.pot index 446826a6866..74dc4b8522f 100644 --- a/addons/hr_work_entry_contract/i18n/hr_work_entry_contract.pot +++ b/addons/hr_work_entry_contract/i18n/hr_work_entry_contract.pot @@ -59,8 +59,15 @@ msgstr "" #. module: hr_work_entry_contract #: model_terms:ir.ui.view,arch_db:hr_work_entry_contract.hr_work_entry_regeneration_wizard msgid "" -"Warning: Work Entry Regeneration will erase all " -"manual configuration (work entry type, deferred time off, ...)." +"Warning: The work entry regeneration will delete " +"all manual changes on the selected period." +msgstr "" + +#. module: hr_work_entry_contract +#: model_terms:ir.ui.view,arch_db:hr_work_entry_contract.hr_work_entry_regeneration_wizard +msgid "" +"Attention: Regenerating these work entries will result in all the manual\n" +" configurations (work entry type, homeworking location, ...) to be lost." msgstr "" #. module: hr_work_entry_contract diff --git a/addons/hr_work_entry_contract/tests/test_work_entry.py b/addons/hr_work_entry_contract/tests/test_work_entry.py index 14bec1f00c2..6dc3ef43fea 100644 --- a/addons/hr_work_entry_contract/tests/test_work_entry.py +++ b/addons/hr_work_entry_contract/tests/test_work_entry.py @@ -96,6 +96,7 @@ class TestWorkEntry(TestWorkEntryBase): 'date_start': self.start, 'date_stop': self.end, }) + work_entry1.work_entry_type_id = False self.assertFalse(work_entry1.action_validate(), "It should not validate work_entries without a type") self.assertEqual(work_entry1.state, 'conflict', "It should change to conflict state") work_entry1.work_entry_type_id = self.work_entry_type diff --git a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml index a299eb87031..c28f0769a5b 100644 --- a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml +++ b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml @@ -27,7 +27,7 @@
- Warning: Work Entry Regeneration will erase all manual configuration (work entry type, deferred time off, ...). + Warning: The work entry regeneration will delete all manual changes on the selected period.
@@ -55,9 +55,10 @@ attrs="{'invisible': ['|', ('search_criteria_completed', '=', False), ('valid', '=', False)]}"/>