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
b6d31ca5
Commit
b6d31ca5
authored
Nov 17, 2021
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1487 Clean all futur shifts, including extra shift template registration one
parent
ca04e2c6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
ir_config_parameter_data.xml
...ns/lacagette_membership/data/ir_config_parameter_data.xml
+4
-0
res_partner.py
lacagette_addons/lacagette_membership/models/res_partner.py
+6
-2
No files found.
lacagette_addons/lacagette_membership/data/ir_config_parameter_data.xml
View file @
b6d31ca5
...
@@ -8,6 +8,10 @@
...
@@ -8,6 +8,10 @@
<field
name=
"key"
>
lacagette_membership.points_limit_to_get_unsubscribed
</field>
<field
name=
"key"
>
lacagette_membership.points_limit_to_get_unsubscribed
</field>
<field
name=
"value"
>
-3
</field>
<field
name=
"value"
>
-3
</field>
</record>
</record>
<record
id=
"makeups_to_do_after_unsubscribed"
model=
"ir.config_parameter"
>
<field
name=
"key"
>
lacagette_membership.makeups_to_do_after_unsubscribed
</field>
<field
name=
"value"
>
2
</field>
</record>
<record
id=
"absence_status"
model=
"ir.config_parameter"
>
<record
id=
"absence_status"
model=
"ir.config_parameter"
>
<field
name=
"key"
>
lacagette_membership.absence_status
</field>
<field
name=
"key"
>
lacagette_membership.absence_status
</field>
<field
name=
"value"
>
excused
</field>
<field
name=
"value"
>
excused
</field>
...
...
lacagette_addons/lacagette_membership/models/res_partner.py
View file @
b6d31ca5
...
@@ -28,6 +28,7 @@ class ResPartner(models.Model):
...
@@ -28,6 +28,7 @@ class ResPartner(models.Model):
# final_ftop_point, target_status
# final_ftop_point, target_status
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"
)
makeups_todo_after_unsubscribed
=
conf
.
get_param
(
"lacagette_membership.makeups_to_do_after_unsubscribed"
)
result
=
'done'
result
=
'done'
for
p
in
self
.
env
[
'res.partner'
]
\
for
p
in
self
.
env
[
'res.partner'
]
\
.
search
([(
'target_status'
,
'!='
,
""
)]):
.
search
([(
'target_status'
,
'!='
,
""
)]):
...
@@ -37,7 +38,7 @@ class ResPartner(models.Model):
...
@@ -37,7 +38,7 @@ class ResPartner(models.Model):
if
final_points
<
0
:
if
final_points
<
0
:
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'
]
=
makeups_todo_after_unsubscribed
new_values
[
'final_'
+
p
.
shift_type
+
'_point'
]
=
-
2
new_values
[
'final_'
+
p
.
shift_type
+
'_point'
]
=
-
2
if
p
.
shift_type
==
'standard'
:
if
p
.
shift_type
==
'standard'
:
new_values
[
'display_std_points'
]
=
-
2
new_values
[
'display_std_points'
]
=
-
2
...
@@ -50,7 +51,10 @@ class ResPartner(models.Model):
...
@@ -50,7 +51,10 @@ 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
()
for
sreg
in
self
.
env
[
'shift.registration'
]
\
.
search
([(
'partner_id'
,
'='
,
p
.
id
),
(
'date_begin'
,
'>'
,
datetime
.
datetime
.
now
()
.
isoformat
())]):
sreg
.
unlink
()
mail_template
=
self
.
env
.
ref
(
'coop_membership.unsubscribe_email'
)
mail_template
=
self
.
env
.
ref
(
'coop_membership.unsubscribe_email'
)
if
mail_template
:
if
mail_template
:
mail_template
.
send_mail
(
p
.
id
)
mail_template
.
send_mail
(
p
.
id
)
...
...
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