Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
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
2
Merge Requests
2
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
third-party
Commits
d7c64f69
Commit
d7c64f69
authored
Jan 24, 2025
by
Yvon Kerdoncuff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manualy recompute status after performing makeup operation only
parent
252f9b15
Pipeline
#4084
canceled with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
admin.py
members/admin.py
+2
-0
models.py
members/models.py
+2
-1
models.py
shifts/models.py
+4
-1
No files found.
members/admin.py
View file @
d7c64f69
...
@@ -462,6 +462,8 @@ def update_members_makeups_core(members_data, res = None):
...
@@ -462,6 +462,8 @@ def update_members_makeups_core(members_data, res = None):
# otherwise this is handled automatically by odoo when points are changed
# otherwise this is handled automatically by odoo when points are changed
if
member_data
[
"points_diff"
]
>
0
:
if
member_data
[
"points_diff"
]
>
0
:
update_makeups_res
=
cm
.
update_member_makeups
(
member_data
)
update_makeups_res
=
cm
.
update_member_makeups
(
member_data
)
# No need to manually call status recompute after that because we update member point
# (and this triggers status update in odoo).
if
res
:
if
res
:
res
[
"res"
]
.
append
(
update_makeups_res
)
res
[
"res"
]
.
append
(
update_makeups_res
)
...
...
members/models.py
View file @
d7c64f69
...
@@ -1060,7 +1060,8 @@ class CagetteMember(models.Model):
...
@@ -1060,7 +1060,8 @@ class CagetteMember(models.Model):
'mid'
:
self
.
id
,
'mid'
:
self
.
id
,
'update'
:
res_item
'update'
:
res_item
}
}
# No need to manually call status recompute after that because when we use this method,
# we always call an odoo method that triggers status update after that
return
res
return
res
...
...
shifts/models.py
View file @
d7c64f69
...
@@ -340,8 +340,11 @@ class CagetteShift(models.Model):
...
@@ -340,8 +340,11 @@ class CagetteShift(models.Model):
[
partner_id
],
[
partner_id
],
{
"makeups_to_do"
:
self
.
get_member_makeups_to_do
(
partner_id
)
-
1
}
{
"makeups_to_do"
:
self
.
get_member_makeups_to_do
(
partner_id
)
-
1
}
)
)
# Usually not needed because another odoo method that automaticaly triggers status recompute is
# often called after a makeup change, manual update IS REQUIRED here.
self
.
o_api
.
execute
(
'res.partner'
,
'recompute_member_states'
,
[
partner_id
])
except
Exception
as
e
:
except
Exception
as
e
:
coop_logger
.
error
(
"Decrement makeups to do :
%
s,
%
s"
,
str
(
e
),
str
(
data
))
coop_logger
.
error
(
"Decrement makeups to do
and recompute member states
:
%
s,
%
s"
,
str
(
e
),
str
(
data
))
return
st_r_id
,
res_decrement
return
st_r_id
,
res_decrement
...
...
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