Skip to content

Commit

Permalink
Merge PR #538 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by remytms
  • Loading branch information
github-grap-bot committed Jan 27, 2025
2 parents 4f1153d + e45e1ba commit 9c69f6c
Show file tree
Hide file tree
Showing 31 changed files with 6,104 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup/shift_attendance/odoo/addons/shift_attendance
6 changes: 6 additions & 0 deletions setup/shift_attendance/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
73 changes: 73 additions & 0 deletions shift_attendance/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
======================
Shift Attendance Sheet
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:41330284c2edb9171c31179edc34bf2bc1f3510cfd5f226cec22583b0f18a591
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-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
:target: https://github.com/beescoop/Obeesdoo/tree/16.0/shift_attendance
:alt: beescoop/Obeesdoo

|badge1| |badge2| |badge3|

Volunteer Timetable Management

**Table of contents**

.. contents::
:local:

Changelog
=========

12.0.1.2.0 (2022-12-16)
~~~~~~~~~~~~~~~~~~~~~~~

**Bugfixes**

- Repair UI bug where there are two left-hand entries for changing shifts settings
in the settings interface. (`#488 <https://github.com/beescoop/Obeesdoo/issues/488>`_)

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

Bugs are tracked on `GitHub Issues <https://github.com/beescoop/Obeesdoo/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/beescoop/Obeesdoo/issues/new?body=module:%20shift_attendance%0Aversion:%2016.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
~~~~~~~

* Elouan Le Bars
* Coop IT Easy SC

Contributors
~~~~~~~~~~~~

* BEES coop - Cellule IT
* Coop IT Easy SC

Maintainers
~~~~~~~~~~~

This module is part of the `beescoop/Obeesdoo <https://github.com/beescoop/Obeesdoo/tree/16.0/shift_attendance>`_ project on GitHub.

You are welcome to contribute.
2 changes: 2 additions & 0 deletions shift_attendance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
37 changes: 37 additions & 0 deletions shift_attendance/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This module depends on `shift_worker_status`.
# If someone needs this module but has another worker_status rules
# this module can be splitted into a generic part, and a specific part
# that implement the worker_status rules.
{
"name": "Shift Attendance Sheet",
"summary": """
Volunteer Timetable Management""",
"author": "Elouan Le Bars, Coop IT Easy SC, Odoo Community Association (OCA)",
"website": "https://github.com/beescoop/Obeesdoo",
"category": "Cooperative management",
"version": "16.0.1.0.0",
"depends": [
"eater",
"member_card",
"shift",
"shift_worker_status",
"mail",
"barcodes",
],
"data": [
"data/system_parameter.xml",
"data/cron.xml",
"data/mail_template.xml",
"security/group.xml",
"security/ir.model.access.csv",
"views/res_config_settings_view.xml",
"wizard/validate_attendance_sheet.xml",
"wizard/generate_missing_attendance_sheets.xml",
"views/attendance_sheet.xml",
],
"demo": [
"demo/users.xml",
"demo/workers.xml",
],
"license": "AGPL-3",
}
31 changes: 31 additions & 0 deletions shift_attendance/data/cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="ir_cron_generate_attendance_sheet" model="ir.cron">
<field name="name">Generate Attendance Sheets</field>
<field name="model_id" ref="model_shift_sheet" />
<field name="state">code</field>
<field name="code">model._generate_attendance_sheet()</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">4</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
<field name="active" eval="False" />
</record>

<record id="ir_cron_check_non_validated_sheet" model="ir.cron">
<field name="name">Check for non-validated sheets</field>
<field name="model_id" ref="model_shift_sheet" />
<field name="state">code</field>
<field name="code">model._cron_non_validated_sheets()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
<field
name="nextcall"
eval="datetime.now().replace(hour=00, minute=00, second=10)"
/>
<field name="active" eval="False" />
</record>
</odoo>
160 changes: 160 additions & 0 deletions shift_attendance/data/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Mail template are declared in a NOUPDATE block
so users can freely customize/delete them -->
<record id="email_template_non_attendance" model="mail.template">
<field name="name">Shift Non-attendance</field>
<field name="subject">Non-attendance to your last shift</field>
<field
name="partner_to"
>{{ object.replaced_id.id or object.worker_id.id }}</field>
<field name="model_id" ref="shift.model_shift_shift" />
<field name="auto_delete" eval="True" />
<field name="lang">{{ object.worker_id.lang }}</field>
<field name="body_html" type="html">

<t t-if="object.replaced_id">
<p>Hello <t t-out="object.replaced_id.name" />,</p>

<p>
You have been recorded as non-attended during your last shift
(<span t-field="object.start_time" />),
and you were supposed to replace
<t t-out="object.worker_id.name" />.
</p>
</t>


<t t-else="">
<p>Hello <t t-out="object.worker_id.name" />,</p>

<p>
You have been recorded as non-attended during your last shift
(<span t-field="object.start_time" />).
</p>
</t>


<t t-if="object.worker_id.working_mode == 'regular'">
<p t-if="object.state == 'absent_0'">
Super-cooperator assigned you 0 compensation, so you
won't have any additionnal shift to do before your
next regular shift.
</p>

<p t-elif="object.state == 'absent_1'">
Super-cooperator assigned you 1 compensation, so you
have to attend one additionnal shift before your
next regular shift.
</p>

<p t-elif="object.state == 'absent_2'">
Super-cooperator assigned you 2 compensations, so
you have to attend two additionnal shifts before
your next regular shift.
</p>

<p t-if="object.replaced_id">
You were supposed to replace <t t-out="object.worker_id.name" />.
You have to do
<t
t-out="(object.replaced_id.cooperative_status_ids.sr + object.replaced_id.cooperative_status_ids.sc) * -1"
/>
shifts before your next regular shift.
</p>

<p t-else="">
You have to do
<t
t-out="(object.worker_id.cooperative_status_ids.sr + object.worker_id.cooperative_status_ids.sc) * -1"
/>
shifts before your next regular shift.
</p>
</t>

<t t-if="object.worker_id.working_mode == 'irregular'">
<p>
Your shift counter is at
<t t-out="object.worker_id.cooperative_status_ids.sr" />.
</p>
<p t-if="object.worker_id.cooperative_status_ids.future_alert_date">
It should be superior or equal to 1 before the
<span t-field="object.worker_id.cooperative_status_ids.future_alert_date" />.
</p>
</t>

<p t-if="object.replaced_id">
Your current status is
"<t t-out="object.replaced_id.cooperative_status_ids.get_status_value()" />".
</p>

<p t-else="">
Your current status is
"<t t-out="object.worker_id.cooperative_status_ids.get_status_value()" />".
</p>

<p>
If you have any question regarding this non-attendance,
just answer this e-mail.
</p>

<p>
Cooperatively yours,<br />
The Members' office volunteers
</p>

<p>
<t t-out="object.create_uid.company_id.name" /><br
t-if="object.create_uid.company_id.name"
/>
<t t-out="object.create_uid.company_id.street" /><br
t-if="object.create_uid.company_id.street"
/>
<t t-out="object.create_uid.company_id.street2" /><br
t-if="object.create_uid.company_id.street2"
/>
<t t-out="object.create_uid.company_id.zip" /> <t
t-out="object.create_uid.company_id.city"
/><br
t-if="object.create_uid.company_id.zip or object.create_uid.company_id.city"
/>
<t t-if="object.create_uid.company_id.country_id">
<t
t-out="object.create_uid.company_id.state_id and object.create_uid.company_id.state_id.name or ''"
/>
<t t-out="object.create_uid.company_id.country_id.name or ''" /><br />
</t>
<t t-if="object.create_uid.company_id.phone">
Phone: <t t-out="object.create_uid.company_id.phone" /><br />
</t>

<t t-if="object.create_uid.company_id.website">
Web: <span t-field="object.create_uid.company_id.website" /><br />
</t>
<t t-if="object.create_uid.company_id.logo">
<img
src="/web/binary/company_logo"
style="vertical-align:baseline;max-width:100px;"
/>
</t>
</p>

</field>
</record>

<record id="email_template_non_validated_sheet" model="mail.template">
<field name="name">Non-validated sheet</field>
<field
name="subject"
>[{{object.day}}] Non-validated sheet {{object.time_slot}}</field>
<field name="model_id" ref="model_shift_sheet" />
<field name="auto_delete" eval="True" />
<field name="body_html" type="html">

<p t-out="object.day" />
<p>The attendance sheet for <t t-out="object.time_slot" /> is not validated.</p>
<p>Please, do it as soon as possible so as to update workers' status.</p>

</field>
</record>
</odoo>
11 changes: 11 additions & 0 deletions shift_attendance/data/system_parameter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="param_card_support" model="ir.config_parameter">
<field name="key">shift_attendance.card_support</field>
<field name="value">False</field>
</record>
<record id="param_attendance_sheet_generation_interval" model="ir.config_parameter">
<field name="key">shift_attendance.attendance_sheet_generation_interval</field>
<field name="value">15</field>
</record>
</odoo>
42 changes: 42 additions & 0 deletions shift_attendance/demo/users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2019 Coop IT Easy
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- Generic and permanent account -->

<record id="shift_partner_1_demo" model="res.partner">
<field name="firstname">Generic Account</field>
<field name="lastname">Demo</field>
<field name="email">generic@demo.net</field>
</record>

<record id="shift_partner_2_demo" model="res.partner">
<field name="firstname">Permanent Member</field>
<field name="lastname">Demo</field>
<field name="is_company" eval="False" />
<field name="email">permanent@demo.net</field>
<field name="city">Ixelles</field>
<field name="zip">1050</field>
<field name="country_id" ref="base.be" />
</record>

<record id="shift_user_1_demo" model="res.users">
<field name="partner_id" ref="shift_partner_1_demo" />
<field name="login">generic</field>
<field name="password">demo</field>
<field
name="groups_id"
eval="[(4,ref('base.group_user')), (4,ref('shift_attendance.group_shift_attendance_sheet'))]"
/>
</record>

<record id="shift_user_2_demo" model="res.users">
<field name="partner_id" ref="shift_partner_2_demo" />
<field name="login">permanent</field>
<field name="password">demo</field>
<field name="groups_id" eval="[(4,ref('shift.group_shift_management'))]" />
</record>

</odoo>
Loading

0 comments on commit 9c69f6c

Please sign in to comment.