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
f4db68f7
Commit
f4db68f7
authored
Sep 29, 2021
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifications pour envoi mail de désinscription
parent
1964bd13
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
8 deletions
+13
-8
__openerp__.py
lacagette_addons/lacagette_membership/__openerp__.py
+1
-1
ir_config_parameter_data.xml
...ns/lacagette_membership/data/ir_config_parameter_data.xml
+1
-1
ir_cron.xml
lacagette_addons/lacagette_membership/data/ir_cron.xml
+1
-1
res_partner.py
lacagette_addons/lacagette_membership/models/res_partner.py
+7
-1
shift_registration.py
..._addons/lacagette_membership/models/shift_registration.py
+3
-4
No files found.
lacagette_addons/lacagette_membership/__openerp__.py
View file @
f4db68f7
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#
#
'category'
:
'Uncategorized'
,
'category'
:
'Uncategorized'
,
'version'
:
'0.0.
5
'
,
'version'
:
'0.0.
6
'
,
# any module necessary for this one to work correctly
# any module necessary for this one to work correctly
'depends'
:
[
'base'
,
'coop_membership'
,
'coop_shift'
],
'depends'
:
[
'base'
,
'coop_membership'
,
'coop_shift'
],
...
...
lacagette_addons/lacagette_membership/data/ir_config_parameter_data.xml
View file @
f4db68f7
<?xml version="1.0"?>
<?xml version="1.0"?>
<odoo
noupdate=
"
0
"
>
<odoo
noupdate=
"
1
"
>
<record
id=
"points_limit_to_get_suspended"
model=
"ir.config_parameter"
>
<record
id=
"points_limit_to_get_suspended"
model=
"ir.config_parameter"
>
<field
name=
"key"
>
lacagette_membership.points_limit_to_get_suspended
</field>
<field
name=
"key"
>
lacagette_membership.points_limit_to_get_suspended
</field>
...
...
lacagette_addons/lacagette_membership/data/ir_cron.xml
View file @
f4db68f7
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
Author : fracolo
Author : fracolo
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
-->
<odoo>
<odoo
noupdate=
"1"
>
<record
forcecreate=
"True"
id=
"cron_close_unnecessary_extensions"
model=
"ir.cron"
>
<record
forcecreate=
"True"
id=
"cron_close_unnecessary_extensions"
model=
"ir.cron"
>
<field
name=
"name"
>
Close unnecessary Extensions
</field>
<field
name=
"name"
>
Close unnecessary Extensions
</field>
<field
name=
"user_id"
ref=
"base.user_root"
/>
<field
name=
"user_id"
ref=
"base.user_root"
/>
...
...
lacagette_addons/lacagette_membership/models/res_partner.py
View file @
f4db68f7
...
@@ -36,6 +36,8 @@ class ResPartner(models.Model):
...
@@ -36,6 +36,8 @@ class ResPartner(models.Model):
new_values
[
'cooperative_state'
]
=
p
.
target_status
new_values
[
'cooperative_state'
]
=
p
.
target_status
if
new_values
[
'cooperative_state'
]
==
"unsubscribed"
:
if
new_values
[
'cooperative_state'
]
==
"unsubscribed"
:
new_values
[
'makeups_to_do'
]
=
2
if
absence_status
==
'absent'
else
1
new_values
[
'makeups_to_do'
]
=
2
if
absence_status
==
'absent'
else
1
new_values
[
'final_ftop_point'
]
=
-
2
new_values
[
'display_ftop_points'
]
=
-
2
"""
"""
unlink model: "shift.template.registration"
unlink model: "shift.template.registration"
to delete all future shifts linked to this coop.
to delete all future shifts linked to this coop.
...
@@ -43,7 +45,9 @@ class ResPartner(models.Model):
...
@@ -43,7 +45,9 @@ class ResPartner(models.Model):
for
streg
in
self
.
env
[
'shift.template.registration'
]
\
for
streg
in
self
.
env
[
'shift.template.registration'
]
\
.
search
([(
'partner_id'
,
'='
,
p
.
id
)]):
.
search
([(
'partner_id'
,
'='
,
p
.
id
)]):
streg
.
unlink
()
streg
.
unlink
()
mail_template
=
self
.
env
.
ref
(
'coop_membership.unsubscribe_email'
)
if
mail_template
:
mail_template
.
send_mail
(
p
.
id
)
p
.
update
(
new_values
)
p
.
update
(
new_values
)
#@api.onchange('cooperativestate') : could be used only if it is called from client
#@api.onchange('cooperativestate') : could be used only if it is called from client
...
@@ -106,8 +110,10 @@ class ResPartner(models.Model):
...
@@ -106,8 +110,10 @@ class ResPartner(models.Model):
elif
'current_cooperative_state'
in
vals
:
elif
'current_cooperative_state'
in
vals
:
state_to_record
=
vals
[
'current_cooperative_state'
]
state_to_record
=
vals
[
'current_cooperative_state'
]
del
vals
[
'current_cooperative_state'
]
if
len
(
state_to_record
)
>
0
:
if
len
(
state_to_record
)
>
0
:
self
.
_write_state_change
(
state_to_record
)
self
.
_write_state_change
(
state_to_record
)
return
super
(
ResPartner
,
self
)
.
update
(
vals
)
return
super
(
ResPartner
,
self
)
.
update
(
vals
)
@api.model
@api.model
...
...
lacagette_addons/lacagette_membership/models/shift_registration.py
View file @
f4db68f7
...
@@ -19,15 +19,14 @@ class ShiftRegistration(models.Model):
...
@@ -19,15 +19,14 @@ class ShiftRegistration(models.Model):
@api.multi
@api.multi
def
write
(
self
,
vals
):
def
write
(
self
,
vals
):
res
=
super
(
ShiftRegistration
,
self
)
.
write
(
vals
)
conf
=
self
.
env
[
'ir.config_parameter'
]
conf
=
self
.
env
[
'ir.config_parameter'
]
absence_status
=
conf
.
get_param
(
"lacagette_membership.absence_status"
)
absence_status
=
conf
.
get_param
(
"lacagette_membership.absence_status"
)
if
'state'
in
vals
and
vals
[
'state'
]
==
absence_status
:
if
'state'
in
vals
and
vals
[
'state'
]
==
absence_status
:
if
self
.
ids
:
if
self
.
ids
:
# it is the case when called from "absence cron job" run in external third-party
# it is the case when called from "absence cron job" run in external third-party
to_add
=
conf
.
get_param
(
"lacagette_membership.makeups_to_do_on_shift_missed"
)
to_add
=
2
if
absence_status
==
'absent'
else
1
for
s
in
self
.
env
[
'shift.registration'
]
\
for
s
in
self
.
env
[
'shift.registration'
]
\
.
search
([(
'id'
,
'in'
,
self
.
ids
)]):
.
search
([(
'id'
,
'in'
,
self
.
ids
)]):
new_makeups_to_do
=
s
.
partner_id
.
makeups_to_do
+
to_add
new_makeups_to_do
=
s
.
partner_id
.
makeups_to_do
+
to_add
s
.
partner_id
.
update
({
'makeups_to_do'
:
new_makeups_to_do
})
s
.
partner_id
.
update
({
'makeups_to_do'
:
new_makeups_to_do
})
return
res
return
super
(
ShiftRegistration
,
self
)
.
write
(
vals
)
\ No newline at end of file
\ 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