-
Notifications
You must be signed in to change notification settings - Fork 41
[16.0][FIX] volunteer_attendance: various fixes #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 16.0
Are you sure you want to change the base?
Changes from 2 commits
d4c3caf
e99a2be
e37b5ac
7d86dcc
09c60e1
fb7edbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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) | ||||||||||||||
|
||||||||||||||
| 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) |
There was a problem hiding this comment.
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 !
| 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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either leave required or remove but do not comment. I think here it should be removed as a False value for Company is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, didn't remove comments yet. I'll trim it now :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.