Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions hr_leave_no_validation_editable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
===============================
Hr Leave No Validation Editable
===============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ac267f239a86e7fe1da4460729a088a6eeb60e40e04f8a4ec58395d1312ab60d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-solvosci%2Fslv--hr-lightgray.png?logo=github
:target: https://github.com/solvosci/slv-hr/tree/17.0/hr_leave_no_validation_editable
:alt: solvosci/slv-hr

|badge1| |badge2| |badge3|

Adds new button to edit leave that have been self-validated before the
end date.

**Table of contents**

.. contents::
:local:

Usage
=====

#. Create an leave with a type that doesn't require validation #. Go to
My Time Of > Time Of Request > Form #. A new button called "Update Data"
appears on the form #. Depending on whether the leave is for dates or
also includes a time zone, the wizard will display more or fewer fields.
#. Once edited, click "Edit Data" #. This triggers Reject > Draft > Edit
> Confirm

Known issues / Roadmap
======================

Add the missing functionality, which is being able to edit shifts, i.e.
morning and afternoon

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/solvosci/slv-hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/solvosci/slv-hr/issues/new?body=module:%20hr_leave_no_validation_editable%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Solvos

Contributors
------------

- Christian Santamaría <[email protected]>
- Iria Alonso <[email protected]>

Maintainers
-----------

This module is part of the `solvosci/slv-hr <https://github.com/solvosci/slv-hr/tree/17.0/hr_leave_no_validation_editable>`_ project on GitHub.

You are welcome to contribute.
2 changes: 2 additions & 0 deletions hr_leave_no_validation_editable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
19 changes: 19 additions & 0 deletions hr_leave_no_validation_editable/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# © 2025 Solvos Consultoría Informática (<http://www.solvos.es>)
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
{
"name": "Hr Leave No Validation Editable",
"summary": """
Adds button to be able to edit your own leaves that do not require validation before the end date.
""",
"author": "Solvos",
"license": "LGPL-3",
"version": "17.0.1.0.0",
"category": "Human Resources",
"website": "https://github.com/solvosci/slv-hr",
"depends": ['hr_holidays'],
"data": [
"views/hr_leave_views.xml",
"wizards/hr_leave_edit_data_wizard_views.xml",
],
'installable': True,
}
435 changes: 435 additions & 0 deletions hr_leave_no_validation_editable/i18n/es.po

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions hr_leave_no_validation_editable/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_leave
33 changes: 33 additions & 0 deletions hr_leave_no_validation_editable/models/hr_leave.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# © 2025 Solvos Consultoría Informática (<http://www.solvos.es>)
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html

from odoo import models, fields,_
from odoo.exceptions import ValidationError


class HrLeave(models.Model):
_inherit = 'hr.leave'

def action_update_hr_leave_wizard(self):
if self.env.user != self.employee_id.user_id or self.holiday_status_id.validation_type != 'no_validation' or self.request_date_from <= fields.Date.today() or self.request_unit_half:
raise ValidationError(_("Only your own leave that do not require validation before today can be edited."))
wizard_id = self.env['hr.leave.edit.data.wizard'].sudo().create({
'hr_leave_id': self.id,
'request_date_from': self.request_date_from,
'request_date_to': self.request_date_to,
'date_from': self.date_from,
'date_to': self.date_to,
'request_unit_hours': self.request_unit_hours,
'request_unit_half': self.request_unit_half,
'request_hour_from': self.request_hour_from,
'request_hour_to': self.request_hour_to,
'name': self.name,
})
return {
'name': _('Update Hr Leave'),
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'hr.leave.edit.data.wizard',
'res_id': wizard_id.id,
'target': 'new',
}
2 changes: 2 additions & 0 deletions hr_leave_no_validation_editable/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Christian Santamaría \<[email protected]\>
* Iria Alonso \<[email protected]\>
1 change: 1 addition & 0 deletions hr_leave_no_validation_editable/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds new button to edit leave that have been self-validated before the end date.
1 change: 1 addition & 0 deletions hr_leave_no_validation_editable/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the missing functionality, which is being able to edit shifts, i.e. morning and afternoon
6 changes: 6 additions & 0 deletions hr_leave_no_validation_editable/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#. Create an leave with a type that doesn't require validation
#. Go to My Time Of > Time Of Request > Form
#. A new button called "Update Data" appears on the form
#. Depending on whether the leave is for dates or also includes a time zone, the wizard will display more or fewer fields.
#. Once edited, click "Edit Data"
#. This triggers Reject > Draft > Edit > Confirm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading