Skip to content
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

[FIX] beesdoo_shift: Check working mode as well as shift_id #390

Merged
merged 5 commits into from
May 26, 2022
Merged
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
7 changes: 7 additions & 0 deletions beesdoo_shift/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ Configuration
Changelog
=========

12.0.1.1.4 (2022-05-26)
**Bugfixes**

- When changing a regular worker to an irregular worker via the wizard, no longer
give an error when their (former) shift is full. (`#390 <https:/beescoop/obeesdoo/issues/390>`_)


12.0.1.1.1 (2022-05-26)
**Bugfixes**

Expand Down
2 changes: 1 addition & 1 deletion beesdoo_shift/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Thibault Francois, Elouan Le Bars, Coop IT Easy SCRLfs",
"website": "https:/beescoop/Obeesdoo",
"category": "Cooperative management",
"version": "12.0.1.1.3",
"version": "12.0.1.1.4",
"depends": ["mail"],
"data": [
"data/system_parameter.xml",
Expand Down
7 changes: 7 additions & 0 deletions beesdoo_shift/readme/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
12.0.1.1.4 (2022-05-26)
**Bugfixes**

- When changing a regular worker to an irregular worker via the wizard, no longer
give an error when their (former) shift is full. (`#390 <https:/beescoop/obeesdoo/issues/390>`_)


12.0.1.1.1 (2022-05-26)
**Bugfixes**

Expand Down
34 changes: 20 additions & 14 deletions beesdoo_shift/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,19 @@ <h1 class="title">Beescoop Shift Management</h1>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="id2">Configuration</a></li>
<li><a class="reference internal" href="#changelog" id="id3">Changelog</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
<li><a class="reference internal" href="#configuration" id="id3">Configuration</a></li>
<li><a class="reference internal" href="#changelog" id="id4">Changelog</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id5">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id6">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id7">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id8">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id9">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id2">Configuration</a></h1>
<h1><a class="toc-backref" href="#id3">Configuration</a></h1>
<ul class="simple">
<li>Translate cooperative status selection field, the terms to translate are:<ul>
<li>shift_status_up_to_date,</li>
Expand All @@ -404,7 +404,13 @@ <h1><a class="toc-backref" href="#id2">Configuration</a></h1>
</ul>
</div>
<div class="section" id="changelog">
<h1><a class="toc-backref" href="#id3">Changelog</a></h1>
<h1><a class="toc-backref" href="#id4">Changelog</a></h1>
<p>12.0.1.1.4 (2022-05-26)
<strong>Bugfixes</strong></p>
<ul class="simple">
<li>When changing a regular worker to an irregular worker via the wizard, no longer
give an error when their (former) shift is full. (<a class="reference external" href="https:/beescoop/obeesdoo/issues/390">#390</a>)</li>
</ul>
<p>12.0.1.1.1 (2022-05-26)
<strong>Bugfixes</strong></p>
<ul class="simple">
Expand All @@ -413,32 +419,32 @@ <h1><a class="toc-backref" href="#id3">Changelog</a></h1>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id5">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https:/beescoop/obeesdoo/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https:/beescoop/obeesdoo/issues/new?body=module:%20beesdoo_shift%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id5">Credits</a></h1>
<h1><a class="toc-backref" href="#id6">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id6">Authors</a></h2>
<h2><a class="toc-backref" href="#id7">Authors</a></h2>
<ul class="simple">
<li>Thibault Francois</li>
<li>Elouan Le Bars</li>
<li>Coop IT Easy SCRLfs</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
<h2><a class="toc-backref" href="#id8">Contributors</a></h2>
<ul class="simple">
<li>Beescoop - Cellule IT</li>
<li>Coop IT Easy SCRLfs</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id9">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https:/beescoop/obeesdoo/tree/12.0/beesdoo_shift">beescoop/obeesdoo</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
Expand Down
6 changes: 5 additions & 1 deletion beesdoo_shift/wizard/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ def unsubscribe(self):
@api.multi
def subscribe(self):
self = self._check()
if self.shift_id and self.shift_id.remaining_worker <= 0:
if (
self.shift_id
and self.working_mode == "regular"
and self.shift_id.remaining_worker <= 0
):
raise UserError(_("There is no remaining spot in this shift"))

# cleanup previous shift template subscriptions
Expand Down