Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
odoo
Commits
866532a2
Commit
866532a2
authored
Sep 08, 2021
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Gestion des absences et retards (nouvelles règles La Cagette)
parent
6ad0f139
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
0 deletions
+103
-0
__init__.py
lacagette_addons/lacagette_membership/__init__.py
+4
-0
__openerp__.py
lacagette_addons/lacagette_membership/__openerp__.py
+27
-0
ir_cron.xml
lacagette_addons/lacagette_membership/data/ir_cron.xml
+23
-0
__init__.py
lacagette_addons/lacagette_membership/models/__init__.py
+5
-0
res_partner.py
lacagette_addons/lacagette_membership/models/res_partner.py
+14
-0
shift_registration.py
..._addons/lacagette_membership/models/shift_registration.py
+30
-0
No files found.
lacagette_addons/lacagette_membership/__init__.py
0 → 100644
View file @
866532a2
# -*- coding: utf-8 -*-
from
.
import
models
\ No newline at end of file
lacagette_addons/lacagette_membership/__openerp__.py
0 → 100644
View file @
866532a2
# -*- coding: utf-8 -*-
{
'name'
:
"La Cagette - Membership"
,
'summary'
:
"""
Tuning membership rules"""
,
'description'
:
"""
"""
,
'author'
:
"fracolo"
,
'website'
:
"https://lacagette-coop.fr"
,
#
'category'
:
'Uncategorized'
,
'version'
:
'0.0.2'
,
# any module necessary for this one to work correctly
'depends'
:
[
'base'
,
'coop_shift'
],
# always loaded
'data'
:
[
'data/ir_cron.xml'
,
# 'ir_config_parameter_data.xml'
],
'installable'
:
True
,
}
lacagette_addons/lacagette_membership/data/ir_cron.xml
0 → 100644
View file @
866532a2
<?xml version="1.0"?>
<!--
Copyright (C) 2021 - Today Cooperatic
Author : fracolo
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<record
forcecreate=
"True"
id=
"cron_ending_abcd_shift_preiod"
model=
"ir.cron"
>
<field
name=
"name"
>
Ending ABCD shift period
</field>
<field
name=
"user_id"
ref=
"base.user_root"
/>
<field
name=
"interval_number"
>
1
</field>
<field
name=
"interval_type"
>
days
</field>
<field
name=
"numbercall"
>
-1
</field>
<field
name=
"nextcall"
eval=
"(DateTime.now() + timedelta(days=1)).strftime('%Y-%m-%d 20:00:00')"
/>
<field
name=
"doall"
eval=
"False"
/>
<field
name=
"model"
eval=
"'shift.registration'"
/>
<field
name=
"function"
eval=
"'send_shift_missing_emails'"
/>
<field
name=
"args"
eval=
"'()'"
/>
<field
name=
"active"
eval=
"False"
/>
<field
name=
"priority"
>
2
</field>
</record>
</odoo>
\ No newline at end of file
lacagette_addons/lacagette_membership/models/__init__.py
0 → 100644
View file @
866532a2
# -*- coding: utf-8 -*-
from
.
import
res_partner
from
.
import
shift_registration
\ No newline at end of file
lacagette_addons/lacagette_membership/models/res_partner.py
0 → 100644
View file @
866532a2
# -*- coding: utf-8 -*-
from
openerp
import
_
,
api
,
models
,
fields
class
ResPartner
(
models
.
Model
):
_inherit
=
'res.partner'
# Columns Section
makeups_to_do
=
fields
.
Integer
(
"Number of make-ups to done"
,
default
=
0
)
\ No newline at end of file
lacagette_addons/lacagette_membership/models/shift_registration.py
0 → 100644
View file @
866532a2
# -*- coding: utf-8 -*-
from
openerp
import
_
,
api
,
models
,
fields
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
class
ShiftRegistration
(
models
.
Model
):
_inherit
=
'shift.registration'
is_late
=
fields
.
Boolean
(
"Was the registration validated within grace period ?"
,
default
=
False
)
is_makeup
=
fields
.
Boolean
(
"Is this registration a consequence of a makeup to do"
,
default
=
False
)
@api.multi
def
write
(
self
,
vals
):
res
=
super
(
ShiftRegistration
,
self
)
.
write
(
vals
)
if
'state'
in
vals
and
vals
[
'state'
]
==
'excused'
:
if
self
.
ids
:
for
s
in
self
.
env
[
'shift.registration'
]
\
.
search
([(
'id'
,
'in'
,
self
.
ids
)]):
new_makeups_to_do
=
s
.
partner_id
.
makeups_to_do
+
1
s
.
partner_id
.
update
({
'makeups_to_do'
:
new_makeups_to_do
})
return
res
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment