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
63dd09c6
Commit
63dd09c6
authored
Oct 08, 2024
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout surcharge shift.extension pour déclencher changement statut vers délai
parent
850f73f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletions
+35
-1
__init__.py
lacagette_addons/lacagette_membership/models/__init__.py
+1
-1
shift_extension.py
...tte_addons/lacagette_membership/models/shift_extension.py
+34
-0
No files found.
lacagette_addons/lacagette_membership/models/__init__.py
View file @
63dd09c6
...
@@ -7,4 +7,4 @@ from . import shift_shift
...
@@ -7,4 +7,4 @@ from . import shift_shift
from
.
import
member_state_change
from
.
import
member_state_change
from
.
import
shift_template
from
.
import
shift_template
from
.
import
shift_template_registration_line
from
.
import
shift_template_registration_line
from
.
import
shift_extension
lacagette_addons/lacagette_membership/models/shift_extension.py
0 → 100644
View file @
63dd09c6
# -*- coding: utf-8 -*-
from
openerp
import
_
,
api
,
models
,
fields
import
logging
import
datetime
_logger
=
logging
.
getLogger
(
__name__
)
class
ShiftExtension
(
models
.
Model
):
_inherit
=
'shift.extension'
@api.model
def
_update_member_status
(
self
,
vals
):
res_partner
=
self
.
env
[
'res.partner'
]
.
search
([(
'id'
,
'='
,
vals
[
'partner_id'
])])
if
res_partner
:
res_partner
[
0
]
.
recompute_member_states
()
@api.model
def
write
(
self
,
vals
):
_logger
.
debug
(
"Shift extension Vals recues =
%
s"
,
str
(
vals
))
res
=
super
(
ShiftExtension
,
self
)
.
write
(
vals
)
self
.
_update_member_status
(
vals
)
return
res
@api.model
def
create
(
self
,
vals
):
_logger
.
debug
(
"Shift extension Vals recues creation =
%
s"
,
str
(
vals
))
res
=
super
(
ShiftExtension
,
self
)
.
create
(
vals
)
self
.
_update_member_status
(
vals
)
return
res
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