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
88c283ad
Commit
88c283ad
authored
Nov 17, 2024
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout fichier shift_leave.py dans module lacagette_membership
parent
c1883bb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
shift_leave.py
lacagette_addons/lacagette_membership/models/shift_leave.py
+36
-0
No files found.
lacagette_addons/lacagette_membership/models/shift_leave.py
0 → 100644
View file @
88c283ad
# -*- coding: utf-8 -*-
from
openerp
import
_
,
api
,
models
,
fields
import
logging
import
datetime
_logger
=
logging
.
getLogger
(
__name__
)
class
ShiftLeave
(
models
.
Model
):
_inherit
=
'shift.leave'
@api.model
def
_update_member_status
(
self
,
vals
):
_logger
.
debug
(
"_update_member_status, reçu
%
s"
,
str
(
vals
))
res_partner
=
self
.
env
[
'res.partner'
]
.
search
([(
'id'
,
'='
,
vals
[
'partner_id'
])])
if
res_partner
:
res_partner
[
0
]
.
recompute_member_states
()
@api.multi
def
write
(
self
,
vals
):
_logger
.
debug
(
"Shift leave vals =
%
s, partner_id =
%
s"
,
str
(
vals
),
str
(
self
.
partner_id
.
id
))
res
=
super
(
ShiftLeave
,
self
)
.
write
(
vals
)
vals
[
'partner_id'
]
=
self
.
partner_id
.
id
self
.
_update_member_status
(
vals
)
return
res
@api.model
def
create
(
self
,
vals
):
_logger
.
debug
(
"Shift leave Vals recues creation =
%
s"
,
str
(
vals
))
res
=
super
(
ShiftLeave
,
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