Merge lp:~toolpart/openerp-client-lib/default_context into lp:openerp-client-lib
Proposed by
ViktorNagy
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Nicolas Vanhoren (OpenERP) | ||||
Proposed branch: | lp:~toolpart/openerp-client-lib/default_context | ||||
Merge into: | lp:openerp-client-lib | ||||
Diff against target: |
159 lines (+37/-17) 1 file modified
openerplib/main.py (+37/-17) |
||||
To merge this branch: | bzr merge lp:~toolpart/openerp-client-lib/default_context | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nicolas Vanhoren (OpenERP) | Disapprove | ||
Review via email:
|
Description of the change
Backward compatible addition of context support.
To post a comment you must log in.
Unmerged revisions
- 31. By ViktorNagy
-
Added default_context argument to Connection.
Added set_context method to connection
Added set_user_lang method to connection. This sets the default_context to include the user's language settings.Added add_context argument to Model.__init__ (by default equals True). If True, then the Connection's default context is added to every request of the proxy.
Modified the proxy method to check for self.add_context, and add the connection's context if necessary.
Hello,
You can't implicitly add a context to each method call, for these reasons:
- A lot of methods have optional arguments before the context, if those arguments are not provided the context will be inserted at the wrong place.
- There are some methods in the openerp server and addons where the context is not the last argument (this should be changed in openerp 6.2).
So, I agree this functionality would be a good thing, but it's not technically possible right now.