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
c845bef2
Commit
c845bef2
authored
13 years ago
by
Antony Lesuisse
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] web.common.sesion local backend part2
bzr revid: al@openerp.com-20110924165705-c0wd7hcup9ib74ry
parent
0a02a387
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
addons/web/__init__.py
+4
-2
4 additions, 2 deletions
addons/web/__init__.py
addons/web/common/openerplib/main.py
+2
-2
2 additions, 2 deletions
addons/web/common/openerplib/main.py
addons/web/common/session.py
+9
-4
9 additions, 4 deletions
addons/web/common/session.py
with
15 additions
and
8 deletions
addons/web/__init__.py
+
4
−
2
View file @
c845bef2
...
...
@@ -2,16 +2,18 @@ import common
import
controllers
import
common.dispatch
import
logging
import
optparse
_logger
=
logging
.
getLogger
(
__name__
)
class
Options
(
object
):
pass
def
wsgi_postload
():
import
openerp.wsgi
import
os
import
tempfile
_logger
.
info
(
"
embedded mode
"
)
class
Options
(
object
):
pass
o
=
Options
()
o
.
dbfilter
=
'
.*
'
o
.
session_storage
=
os
.
path
.
join
(
tempfile
.
gettempdir
(),
"
oe-sessions
"
)
...
...
This diff is collapsed.
Click to expand it.
addons/web/common/openerplib/main.py
+
2
−
2
View file @
c845bef2
...
...
@@ -379,7 +379,7 @@ class Model(object):
records
=
self
.
read
(
record_ids
,
fields
or
[],
context
or
{})
return
records
def
get_connector
(
hostname
,
protocol
=
"
xmlrpc
"
,
port
=
"
auto
"
):
def
get_connector
(
hostname
=
None
,
protocol
=
"
xmlrpc
"
,
port
=
"
auto
"
):
"""
A shortcut method to easily create a connector to a remote server using XMLRPC or NetRPC.
...
...
@@ -398,7 +398,7 @@ def get_connector(hostname, protocol="xmlrpc", port="auto"):
else
:
raise
ValueError
(
"
You must choose xmlrpc or netrpc or local
"
)
def
get_connection
(
hostname
,
protocol
=
"
xmlrpc
"
,
port
=
'
auto
'
,
database
=
None
,
def
get_connection
(
hostname
=
None
,
protocol
=
"
xmlrpc
"
,
port
=
'
auto
'
,
database
=
None
,
login
=
None
,
password
=
None
,
user_id
=
None
):
"""
A shortcut method to easily create a connection to a remote OpenERP server.
...
...
This diff is collapsed.
Click to expand it.
addons/web/common/session.py
+
9
−
4
View file @
c845bef2
...
...
@@ -39,11 +39,16 @@ class OpenERPSession(object):
self
.
_lang
=
{}
self
.
remote_timezone
=
'
utc
'
self
.
client_timezone
=
False
def
build_connection
(
self
):
return
openerplib
.
get_connection
(
hostname
=
self
.
config
.
server_host
,
port
=
self
.
config
.
server_port
,
database
=
self
.
_db
,
login
=
self
.
_login
,
user_id
=
self
.
_uid
,
password
=
self
.
_password
)
if
self
.
config
.
backend
==
'
local
'
:
conn
=
openerplib
.
get_connection
(
protocol
=
'
local
'
,
database
=
self
.
_db
,
login
=
self
.
_login
,
user_id
=
self
.
_uid
,
password
=
self
.
_password
)
else
:
conn
=
openerplib
.
get_connection
(
hostname
=
self
.
config
.
server_host
,
port
=
self
.
config
.
server_port
,
database
=
self
.
_db
,
login
=
self
.
_login
,
user_id
=
self
.
_uid
,
password
=
self
.
_password
)
return
conn
def
proxy
(
self
,
service
):
return
self
.
build_connection
().
get_service
(
service
)
...
...
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