Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
6 changes: 1 addition & 5 deletions volunteer_attendance/README.rst
Original file line number Diff line number Diff line change
@@ -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
=====================
Expand All @@ -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
Expand Down
10 changes: 4 additions & 6 deletions volunteer_attendance/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
"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",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
SPDX-FileCopyrightText: 2025 Coop IT Easy SC

SPDX-License-Identifier: AGPL-3.0-or-later
-->
<odoo>
<record
id="volunteer_shift_attendance_status_demo_present"
model="volunteer.shift.attendance.status"
>
<field name="name">Present</field>
<field name="description">Present during shift</field>
<field name="company_id" />
</record>

<record
id="volunteer_shift_attendance_status_demo_absent"
model="volunteer.shift.attendance.status"
>
<field name="name">Absent</field>
<field name="description">Unjustified absence during shift</field>
<field name="company_id" />
</record>

<record
id="volunteer_shift_attendance_status_demo_excused"
model="volunteer.shift.attendance.status"
>
<field name="name">Excused</field>
<field name="description">Justified absence during shift</field>
<field name="company_id" />
</record>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions volunteer_attendance/models/volunteer_shift_participation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def _check_no_attendance_status_for_canceled_participation(self):

# 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()
return super().write(vals)
if "attendance_status_id" in vals:
vals["attendance_date"] = fields.Datetime.now()
return super().write(vals)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ho, this one, I didn’t catch it the first time.

write should always return and call the parent function. So write this:

Suggested change
if "attendance_status_id" in vals:
vals["attendance_date"] = fields.Datetime.now()
return super().write(vals)
if "attendance_status_id" in vals:
vals["attendance_date"] = fields.Datetime.now()
return super().write(vals)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, missed it myself. Thanks, done !

14 changes: 14 additions & 0 deletions volunteer_attendance/security/volunteer_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
SPDX-FileCopyrightText: 2025 Coop IT Easy SC

SPDX-License-Identifier: AGPL-3.0-or-later
-->
<odoo>
<record id="volunteer_attendance_status_rule_company" model="ir.rule">
<field name="name">Volunteer Attendance Status: Company Access</field>
<field name="model_id" ref="model_volunteer_shift_attendance_status" />
<field name="domain_force">[('company_id', 'in', company_ids + [False])]
</field>
</record>
</odoo>
2 changes: 1 addition & 1 deletion volunteer_attendance/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Volunteer Attendances</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:98eae0e33d84c4a84fa98c6fee18b1f918e2a210537971887984a726de4e88b4
!! source digest: sha256:05f84ac2073b75506f103a749e6902b5a2f17f7007418068c1aafcead3547aeb
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/beescoop/Obeesdoo/tree/16.0/volunteer_attendance"><img alt="beescoop/Obeesdoo" src="https://img.shields.io/badge/github-beescoop%2FObeesdoo-lightgray.png?logo=github" /></a></p>
<p>Specify status of a volunteer’s attendance to a shift.</p>
Expand Down
1 change: 0 additions & 1 deletion volunteer_attendance/views/volunteer_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ SPDX-FileCopyrightText: 2025 Coop IT Easy SC
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<odoo>
<!-- Attendance Status Submenu -->
<menuitem
id="volunteer_attendance_separator_menu"
name="Attendances"
Expand Down