diff --git a/volunteer_attendance/README.rst b/volunteer_attendance/README.rst index 0b847c3e6..5baec7e92 100644 --- a/volunteer_attendance/README.rst +++ b/volunteer_attendance/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ===================== Volunteer Attendances ===================== @@ -17,7 +13,7 @@ Volunteer Attendances .. |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/license-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-beescoop%2FObeesdoo-lightgray.png?logo=github @@ -61,6 +57,14 @@ Contributors Maintainers ~~~~~~~~~~~ +.. |maintainer-remytms| image:: https://github.com/remytms.png?size=40px + :target: https://github.com/remytms + :alt: remytms + +Current maintainer: + +|maintainer-remytms| + This module is part of the `beescoop/Obeesdoo `_ project on GitHub. You are welcome to contribute. diff --git a/volunteer_attendance/__manifest__.py b/volunteer_attendance/__manifest__.py index 56380f9bc..c5b29ead6 100644 --- a/volunteer_attendance/__manifest__.py +++ b/volunteer_attendance/__manifest__.py @@ -9,21 +9,20 @@ "category": "Volunteer management", "website": "https://github.com/beescoop/Obeesdoo", "author": "Coop IT Easy SC", + "maintainers": ["remytms"], "license": "AGPL-3", "application": False, "depends": ["base", "volunteer", "mail"], "data": [ "security/ir.model.access.csv", + "security/volunteer_security.xml", "views/volunteer_shift_attendance_status_views.xml", "views/volunteer_menu.xml", "views/volunteer_shift_views.xml", "views/volunteer_volunteer_views.xml", "views/volunteer_shift_participation_views.xml", ], - "demo": [], - "assets": { - "web.assets_backend": [ - "volunteer/static/src/scss/volunteer_shift.scss", - ], - }, + "demo": [ + "demo/volunteer_shift_attendance_status_demo.xml", + ], } diff --git a/volunteer_attendance/demo/volunteer_shift_attendance_status_demo.xml b/volunteer_attendance/demo/volunteer_shift_attendance_status_demo.xml new file mode 100644 index 000000000..cb4ec0c1d --- /dev/null +++ b/volunteer_attendance/demo/volunteer_shift_attendance_status_demo.xml @@ -0,0 +1,34 @@ + + + + + Present + Present during shift + + + + + Absent + Unjustified absence during shift + + + + + Excused + Justified absence during shift + + + diff --git a/volunteer_attendance/models/volunteer_shift.py b/volunteer_attendance/models/volunteer_shift.py index a81146e97..cc9a9bcb5 100644 --- a/volunteer_attendance/models/volunteer_shift.py +++ b/volunteer_attendance/models/volunteer_shift.py @@ -49,5 +49,6 @@ def action_display_attendance_state(self): "domain": [ ("shift_id", "=", [self.id]), ("attendance_status_id", "=", None), + ("registration_state", "!=", "canceled"), ], } diff --git a/volunteer_attendance/models/volunteer_shift_attendance_status.py b/volunteer_attendance/models/volunteer_shift_attendance_status.py index af07a91e2..16f2a3419 100644 --- a/volunteer_attendance/models/volunteer_shift_attendance_status.py +++ b/volunteer_attendance/models/volunteer_shift_attendance_status.py @@ -19,7 +19,6 @@ class VolunteerShiftAttendanceStatus(models.Model): comodel_name="res.company", string="Company", default=lambda self: self.env.user.company_id, - required=True, ) # SQL Constraints diff --git a/volunteer_attendance/models/volunteer_shift_participation.py b/volunteer_attendance/models/volunteer_shift_participation.py index 8bdefec9d..9d833bfd7 100644 --- a/volunteer_attendance/models/volunteer_shift_participation.py +++ b/volunteer_attendance/models/volunteer_shift_participation.py @@ -23,20 +23,19 @@ def _check_no_attendance_status_for_canceled_participation(self): for participation in self: if ( participation.registration_state == "canceled" - and participation.attendance_status_id is not None + and participation.attendance_status_id.id ): raise ValidationError( _( "An attendance status for a canceled participation " - "will not be taken into account for the attendance state " - "of the shift." + "will not be taken into account. " ) ) # Methods - @api.depends("attendance_status_id") def write(self, vals): """Set attendance status modification date to now at modification""" - vals["attendance_date"] = fields.Datetime.now() + if "attendance_status_id" in vals: + vals["attendance_date"] = fields.Datetime.now() return super().write(vals) diff --git a/volunteer_attendance/security/volunteer_security.xml b/volunteer_attendance/security/volunteer_security.xml new file mode 100644 index 000000000..b5127b5ed --- /dev/null +++ b/volunteer_attendance/security/volunteer_security.xml @@ -0,0 +1,14 @@ + + + + + Volunteer Attendance Status: Company Access + + [('company_id', 'in', company_ids + [False])] + + + diff --git a/volunteer_attendance/static/description/index.html b/volunteer_attendance/static/description/index.html index 3c1243622..155167a34 100644 --- a/volunteer_attendance/static/description/index.html +++ b/volunteer_attendance/static/description/index.html @@ -367,7 +367,7 @@

Volunteer Attendances

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:98eae0e33d84c4a84fa98c6fee18b1f918e2a210537971887984a726de4e88b4 +!! source digest: sha256:05f84ac2073b75506f103a749e6902b5a2f17f7007418068c1aafcead3547aeb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 beescoop/Obeesdoo

Specify status of a volunteer’s attendance to a shift.

@@ -410,6 +410,8 @@

Contributors

Maintainers

+

Current maintainer:

+

remytms

This module is part of the beescoop/Obeesdoo project on GitHub.

You are welcome to contribute.

diff --git a/volunteer_attendance/views/volunteer_menu.xml b/volunteer_attendance/views/volunteer_menu.xml index 0c6a1e6da..224902b24 100644 --- a/volunteer_attendance/views/volunteer_menu.xml +++ b/volunteer_attendance/views/volunteer_menu.xml @@ -5,7 +5,6 @@ SPDX-FileCopyrightText: 2025 Coop IT Easy SC SPDX-License-Identifier: AGPL-3.0-or-later --> -