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
24fc11d0
Commit
24fc11d0
authored
Apr 18, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add origin for every shift_registration modifications made outside Odoo interface
parent
8a020cf0
Pipeline
#2132
passed with stage
in 1 minute 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
admin.py
members/admin.py
+1
-1
urls.py
members/urls.py
+0
-1
models.py
shifts/models.py
+2
-1
No files found.
members/admin.py
View file @
24fc11d0
...
...
@@ -427,7 +427,7 @@ def delete_shift_registration(request):
# Note: 'upcoming_registration_count' in res.partner won't change because the _compute method
# in odoo counts canceled shift registrations.
m
=
CagetteShift
()
res
[
"cancel_shift"
]
=
m
.
cancel_shift
([
shift_registration_id
])
res
[
"cancel_shift"
]
=
m
.
cancel_shift
([
shift_registration_id
]
,
origin
=
'bdm'
)
if
shift_is_makeup
is
True
:
fields
=
{
...
...
members/urls.py
View file @
24fc11d0
...
...
@@ -69,7 +69,6 @@ urlpatterns = [
url
(
r'^admin/manage_attached/delete_pair$'
,
admin
.
delete_pair
),
url
(
r'^get_makeups_members$'
,
admin
.
get_makeups_members
),
url
(
r'^update_members_makeups$'
,
admin
.
update_members_makeups
),
url
(
r'^delete_shift_registration$'
,
admin
.
delete_shift_registration
),
url
(
r'^get_member_info/(\d+)$'
,
admin
.
get_member_info
),
url
(
r'^get_attached_members$'
,
admin
.
get_attached_members
),
]
shifts/models.py
View file @
24fc11d0
...
...
@@ -210,9 +210,10 @@ class CagetteShift(models.Model):
coop_logger
.
error
(
"Model affect shift nobody found :
%
s"
,
str
(
cond
))
return
response
def
cancel_shift
(
self
,
idsRegisteur
):
def
cancel_shift
(
self
,
idsRegisteur
,
origin
=
'memberspace'
):
"""Annule un shift"""
fieldsDatas
=
{
"related_shift_state"
:
'cancel'
,
"origin"
:
origin
,
"state"
:
'cancel'
}
return
self
.
o_api
.
update
(
'shift.registration'
,
idsRegisteur
,
fieldsDatas
)
...
...
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