Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
446d59fd
Commit
446d59fd
authored
9 years ago
by
Raphael Collet
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] api: improve documentation of `api.onchange`
This fixes #3968.
parent
66ce0ac9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openerp/api.py
+9
-0
9 additions, 0 deletions
openerp/api.py
with
9 additions
and
0 deletions
openerp/api.py
+
9
−
0
View file @
446d59fd
...
...
@@ -171,6 +171,15 @@ def onchange(*args):
when one of the given fields is modified. The method is invoked on a
pseudo-record that contains the values present in the form. Field
assignments on that record are automatically sent back to the client.
The method may return a dictionary for changing field domains and pop up
a warning message, like in the old API::
return {
'
domain
'
: {
'
other_id
'
: [(
'
partner_id
'
,
'
=
'
, partner_id)]},
'
warning
'
: {
'
title
'
:
"
Warning
"
,
'
message
'
:
"
What is this?
"
},
}
"""
return
lambda
method
:
decorate
(
method
,
'
_onchange
'
,
args
)
...
...
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