Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_riga_import
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Confédération Générale des SCOP
cgscop_riga_import
Commits
c47bfdef
Commit
c47bfdef
authored
5 years ago
by
Juliana
Browse files
Options
Downloads
Patches
Plain Diff
change compute to onchange function
parent
43848cb2
Branches
14.0
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/scop_questionnaire.py
+6
-7
6 additions, 7 deletions
models/scop_questionnaire.py
with
6 additions
and
7 deletions
models/scop_questionnaire.py
+
6
−
7
View file @
c47bfdef
...
...
@@ -11,16 +11,15 @@ class ScopQuestionnaireImport(models.Model):
year_riga
=
fields
.
Char
(
"
Année Riga
"
)
type_id
=
fields
.
Many2one
(
compute
=
"
_compute_fields
"
,
store
=
True
)
year
=
fields
.
Char
(
compute
=
"
_compute_fields
"
,
store
=
True
)
effective_date
=
fields
.
Date
(
compute
=
"
_compute_fields
"
,
store
=
True
)
type_id
=
fields
.
Many2one
()
year
=
fields
.
Char
()
effective_date
=
fields
.
Date
()
# ------------------------------------------------------
#
Fonctions compute
#
Onchange Fields
# ------------------------------------------------------
@api.depends
(
'
year_riga
'
)
@api.multi
def
_compute_fields
(
self
):
@api.onchange
(
'
year_riga
'
)
def
onchange_year_riga
(
self
):
for
questionnaire
in
self
:
if
questionnaire
.
year_riga
!=
'
14862
'
and
questionnaire
.
year_riga
!=
'
14443
'
:
year
=
questionnaire
.
env
[
'
riga.lookup.table
'
].
search
([
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment