[MERGE] trunk
bzr revid: fp@tinyerp.com-20120817070849-hii1q6yu8xpxz07o
This commit is contained in:
commit
d22b14809b
|
@ -330,16 +330,32 @@ def httprequest(f):
|
||||||
return http_handler
|
return http_handler
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# OpenERP Web werkzeug Session Managment wraped using with
|
# OpenERP Web Controller registration with a metaclass
|
||||||
|
#----------------------------------------------------------
|
||||||
|
addons_module = {}
|
||||||
|
addons_manifest = {}
|
||||||
|
controllers_class = []
|
||||||
|
controllers_object = {}
|
||||||
|
controllers_path = {}
|
||||||
|
|
||||||
|
class ControllerType(type):
|
||||||
|
def __init__(cls, name, bases, attrs):
|
||||||
|
super(ControllerType, cls).__init__(name, bases, attrs)
|
||||||
|
controllers_class.append(("%s.%s" % (cls.__module__, cls.__name__), cls))
|
||||||
|
|
||||||
|
class Controller(object):
|
||||||
|
__metaclass__ = ControllerType
|
||||||
|
|
||||||
|
#----------------------------------------------------------
|
||||||
|
# OpenERP Web Session context manager
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
STORES = {}
|
STORES = {}
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def session_context(request, storage_path, session_cookie='sessionid'):
|
def session_context(request, storage_path, session_cookie='httpsessionid'):
|
||||||
session_store, session_lock = STORES.get(storage_path, (None, None))
|
session_store, session_lock = STORES.get(storage_path, (None, None))
|
||||||
if not session_store:
|
if not session_store:
|
||||||
session_store = werkzeug.contrib.sessions.FilesystemSessionStore(
|
session_store = werkzeug.contrib.sessions.FilesystemSessionStore( storage_path)
|
||||||
storage_path)
|
|
||||||
session_lock = threading.Lock()
|
session_lock = threading.Lock()
|
||||||
STORES[storage_path] = session_store, session_lock
|
STORES[storage_path] = session_store, session_lock
|
||||||
|
|
||||||
|
@ -402,22 +418,8 @@ def session_context(request, storage_path, session_cookie='sessionid'):
|
||||||
session_store.save(request.session)
|
session_store.save(request.session)
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# OpenERP Web Module/Controller Loading and URL Routing
|
# OpenERP Web WSGI Application
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
addons_module = {}
|
|
||||||
addons_manifest = {}
|
|
||||||
controllers_class = []
|
|
||||||
controllers_object = {}
|
|
||||||
controllers_path = {}
|
|
||||||
|
|
||||||
class ControllerType(type):
|
|
||||||
def __init__(cls, name, bases, attrs):
|
|
||||||
super(ControllerType, cls).__init__(name, bases, attrs)
|
|
||||||
controllers_class.append(("%s.%s" % (cls.__module__, cls.__name__), cls))
|
|
||||||
|
|
||||||
class Controller(object):
|
|
||||||
__metaclass__ = ControllerType
|
|
||||||
|
|
||||||
class DisableCacheMiddleware(object):
|
class DisableCacheMiddleware(object):
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
self.app = app
|
self.app = app
|
||||||
|
@ -426,13 +428,18 @@ class DisableCacheMiddleware(object):
|
||||||
referer = environ.get('HTTP_REFERER', '')
|
referer = environ.get('HTTP_REFERER', '')
|
||||||
parsed = urlparse.urlparse(referer)
|
parsed = urlparse.urlparse(referer)
|
||||||
debug = parsed.query.count('debug') >= 1
|
debug = parsed.query.count('debug') >= 1
|
||||||
nh = dict(headers)
|
|
||||||
if 'Last-Modified' in nh: del nh['Last-Modified']
|
new_headers = []
|
||||||
|
unwanted_keys = ['Last-Modified']
|
||||||
if debug:
|
if debug:
|
||||||
if 'Expires' in nh: del nh['Expires']
|
new_headers = [('Cache-Control', 'no-cache')]
|
||||||
if 'Etag' in nh: del nh['Etag']
|
unwanted_keys += ['Expires', 'Etag', 'Cache-Control']
|
||||||
nh['Cache-Control'] = 'no-cache'
|
|
||||||
start_response(status, nh.items())
|
for k, v in headers:
|
||||||
|
if k not in unwanted_keys:
|
||||||
|
new_headers.append((k, v))
|
||||||
|
|
||||||
|
start_response(status, new_headers)
|
||||||
return self.app(environ, start_wrapped)
|
return self.app(environ, start_wrapped)
|
||||||
|
|
||||||
class Root(object):
|
class Root(object):
|
||||||
|
@ -459,12 +466,12 @@ class Root(object):
|
||||||
|
|
||||||
if not hasattr(self.config, 'connector'):
|
if not hasattr(self.config, 'connector'):
|
||||||
if self.config.backend == 'local':
|
if self.config.backend == 'local':
|
||||||
self.config.connector = LocalConnector()
|
self.config.connector = session.LocalConnector()
|
||||||
else:
|
else:
|
||||||
self.config.connector = openerplib.get_connector(
|
self.config.connector = openerplib.get_connector(
|
||||||
hostname=self.config.server_host, port=self.config.server_port)
|
hostname=self.config.server_host, port=self.config.server_port)
|
||||||
|
|
||||||
self.session_cookie = 'sessionid'
|
self.httpsession_cookie = 'httpsessionid'
|
||||||
self.addons = {}
|
self.addons = {}
|
||||||
|
|
||||||
static_dirs = self._load_addons(openerp_addons_namespace)
|
static_dirs = self._load_addons(openerp_addons_namespace)
|
||||||
|
@ -499,7 +506,7 @@ class Root(object):
|
||||||
if not handler:
|
if not handler:
|
||||||
response = werkzeug.exceptions.NotFound()
|
response = werkzeug.exceptions.NotFound()
|
||||||
else:
|
else:
|
||||||
with session_context(request, self.session_storage, self.session_cookie) as session:
|
with session_context(request, self.session_storage, self.httpsession_cookie) as session:
|
||||||
result = handler( request, self.config)
|
result = handler( request, self.config)
|
||||||
|
|
||||||
if isinstance(result, basestring):
|
if isinstance(result, basestring):
|
||||||
|
@ -509,7 +516,7 @@ class Root(object):
|
||||||
response = result
|
response = result
|
||||||
|
|
||||||
if hasattr(response, 'set_cookie'):
|
if hasattr(response, 'set_cookie'):
|
||||||
response.set_cookie(self.session_cookie, session.sid)
|
response.set_cookie(self.httpsession_cookie, session.sid)
|
||||||
|
|
||||||
return response(environ, start_response)
|
return response(environ, start_response)
|
||||||
|
|
||||||
|
@ -558,61 +565,13 @@ class Root(object):
|
||||||
while ps:
|
while ps:
|
||||||
c = controllers_path.get(ps)
|
c = controllers_path.get(ps)
|
||||||
if c:
|
if c:
|
||||||
m = getattr(c, meth)
|
m = getattr(c, meth, None)
|
||||||
if getattr(m, 'exposed', False):
|
if m and getattr(m, 'exposed', False):
|
||||||
_logger.debug("Dispatching to %s %s %s", ps, c, meth)
|
_logger.debug("Dispatching to %s %s %s", ps, c, meth)
|
||||||
return m
|
return m
|
||||||
ps, _slash, meth = ps.rpartition('/')
|
ps, _slash, meth = ps.rpartition('/')
|
||||||
|
if not ps and meth:
|
||||||
|
ps = '/'
|
||||||
return None
|
return None
|
||||||
|
|
||||||
class LibException(Exception):
|
# vim:et:ts=4:sw=4:
|
||||||
""" Base of all client lib exceptions """
|
|
||||||
def __init__(self,code=None,message=None):
|
|
||||||
self.code = code
|
|
||||||
self.message = message
|
|
||||||
|
|
||||||
class ApplicationError(LibException):
|
|
||||||
""" maps to code: 1, server side: Exception or openerp.exceptions.DeferredException"""
|
|
||||||
|
|
||||||
class Warning(LibException):
|
|
||||||
""" maps to code: 2, server side: openerp.exceptions.Warning"""
|
|
||||||
|
|
||||||
class AccessError(LibException):
|
|
||||||
""" maps to code: 3, server side: openerp.exceptions.AccessError"""
|
|
||||||
|
|
||||||
class AccessDenied(LibException):
|
|
||||||
""" maps to code: 4, server side: openerp.exceptions.AccessDenied"""
|
|
||||||
|
|
||||||
|
|
||||||
class LocalConnector(openerplib.Connector):
|
|
||||||
"""
|
|
||||||
A type of connector that uses the XMLRPC protocol.
|
|
||||||
"""
|
|
||||||
PROTOCOL = 'local'
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def send(self, service_name, method, *args):
|
|
||||||
import openerp
|
|
||||||
import traceback
|
|
||||||
import xmlrpclib
|
|
||||||
code_string = "warning -- %s\n\n%s"
|
|
||||||
try:
|
|
||||||
return openerp.netsvc.dispatch_rpc(service_name, method, args)
|
|
||||||
except openerp.osv.osv.except_osv, e:
|
|
||||||
# TODO change the except to raise LibException instead of their emulated xmlrpc fault
|
|
||||||
raise xmlrpclib.Fault(code_string % (e.name, e.value), '')
|
|
||||||
except openerp.exceptions.Warning, e:
|
|
||||||
raise xmlrpclib.Fault(code_string % ("Warning", e), '')
|
|
||||||
except openerp.exceptions.AccessError, e:
|
|
||||||
raise xmlrpclib.Fault(code_string % ("AccessError", e), '')
|
|
||||||
except openerp.exceptions.AccessDenied, e:
|
|
||||||
raise xmlrpclib.Fault('AccessDenied', str(e))
|
|
||||||
except openerp.exceptions.DeferredException, e:
|
|
||||||
formatted_info = "".join(traceback.format_exception(*e.traceback))
|
|
||||||
raise xmlrpclib.Fault(openerp.tools.ustr(e.message), formatted_info)
|
|
||||||
except Exception, e:
|
|
||||||
formatted_info = "".join(traceback.format_exception(*(sys.exc_info())))
|
|
||||||
raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)
|
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,67 @@ import babel
|
||||||
import dateutil.relativedelta
|
import dateutil.relativedelta
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
import openerplib
|
import openerplib
|
||||||
|
|
||||||
from . import nonliterals
|
from . import nonliterals
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
#----------------------------------------------------------
|
||||||
|
# openerplib local connector
|
||||||
|
#----------------------------------------------------------
|
||||||
|
class LibException(Exception):
|
||||||
|
""" Base of all client lib exceptions """
|
||||||
|
def __init__(self,code=None,message=None):
|
||||||
|
self.code = code
|
||||||
|
self.message = message
|
||||||
|
|
||||||
|
class ApplicationError(LibException):
|
||||||
|
""" maps to code: 1, server side: Exception or openerp.exceptions.DeferredException"""
|
||||||
|
|
||||||
|
class Warning(LibException):
|
||||||
|
""" maps to code: 2, server side: openerp.exceptions.Warning"""
|
||||||
|
|
||||||
|
class AccessError(LibException):
|
||||||
|
""" maps to code: 3, server side: openerp.exceptions.AccessError"""
|
||||||
|
|
||||||
|
class AccessDenied(LibException):
|
||||||
|
""" maps to code: 4, server side: openerp.exceptions.AccessDenied"""
|
||||||
|
|
||||||
|
class LocalConnector(openerplib.Connector):
|
||||||
|
"""
|
||||||
|
A type of connector that uses the XMLRPC protocol.
|
||||||
|
"""
|
||||||
|
PROTOCOL = 'local'
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def send(self, service_name, method, *args):
|
||||||
|
import openerp
|
||||||
|
import traceback
|
||||||
|
import xmlrpclib
|
||||||
|
code_string = "warning -- %s\n\n%s"
|
||||||
|
try:
|
||||||
|
return openerp.netsvc.dispatch_rpc(service_name, method, args)
|
||||||
|
except openerp.osv.osv.except_osv, e:
|
||||||
|
# TODO change the except to raise LibException instead of their emulated xmlrpc fault
|
||||||
|
raise xmlrpclib.Fault(code_string % (e.name, e.value), '')
|
||||||
|
except openerp.exceptions.Warning, e:
|
||||||
|
raise xmlrpclib.Fault(code_string % ("Warning", e), '')
|
||||||
|
except openerp.exceptions.AccessError, e:
|
||||||
|
raise xmlrpclib.Fault(code_string % ("AccessError", e), '')
|
||||||
|
except openerp.exceptions.AccessDenied, e:
|
||||||
|
raise xmlrpclib.Fault('AccessDenied', str(e))
|
||||||
|
except openerp.exceptions.DeferredException, e:
|
||||||
|
formatted_info = "".join(traceback.format_exception(*e.traceback))
|
||||||
|
raise xmlrpclib.Fault(openerp.tools.ustr(e.message), formatted_info)
|
||||||
|
except Exception, e:
|
||||||
|
formatted_info = "".join(traceback.format_exception(*(sys.exc_info())))
|
||||||
|
raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# OpenERPSession RPC openerp backend access
|
# OpenERPSession RPC openerp backend access
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
|
@ -68,7 +124,7 @@ class OpenERPSession(object):
|
||||||
self._login = login
|
self._login = login
|
||||||
self._password = password
|
self._password = password
|
||||||
|
|
||||||
def authenticate(self, db, login, password, env):
|
def authenticate(self, db, login, password, env=None):
|
||||||
# TODO use the openerplib API once it exposes authenticate()
|
# TODO use the openerplib API once it exposes authenticate()
|
||||||
uid = self.proxy('common').authenticate(db, login, password, env)
|
uid = self.proxy('common').authenticate(db, login, password, env)
|
||||||
self.bind(db, uid, login, password)
|
self.bind(db, uid, login, password)
|
||||||
|
@ -216,3 +272,5 @@ class OpenERPSession(object):
|
||||||
cdomain = nonliterals.CompoundDomain(domain)
|
cdomain = nonliterals.CompoundDomain(domain)
|
||||||
cdomain.session = self
|
cdomain.session = self
|
||||||
return cdomain.evaluate(context or {})
|
return cdomain.evaluate(context or {})
|
||||||
|
|
||||||
|
# vim:et:ts=4:sw=4:
|
||||||
|
|
|
@ -31,87 +31,9 @@ from .. import common
|
||||||
openerpweb = common.http
|
openerpweb = common.http
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# OpenERP Web web Controllers
|
# OpenERP Web helpers
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def concat_xml(file_list):
|
|
||||||
"""Concatenate xml files
|
|
||||||
|
|
||||||
:param list(str) file_list: list of files to check
|
|
||||||
:returns: (concatenation_result, checksum)
|
|
||||||
:rtype: (str, str)
|
|
||||||
"""
|
|
||||||
checksum = hashlib.new('sha1')
|
|
||||||
if not file_list:
|
|
||||||
return '', checksum.hexdigest()
|
|
||||||
|
|
||||||
root = None
|
|
||||||
for fname in file_list:
|
|
||||||
with open(fname, 'rb') as fp:
|
|
||||||
contents = fp.read()
|
|
||||||
checksum.update(contents)
|
|
||||||
fp.seek(0)
|
|
||||||
xml = ElementTree.parse(fp).getroot()
|
|
||||||
|
|
||||||
if root is None:
|
|
||||||
root = ElementTree.Element(xml.tag)
|
|
||||||
#elif root.tag != xml.tag:
|
|
||||||
# raise ValueError("Root tags missmatch: %r != %r" % (root.tag, xml.tag))
|
|
||||||
|
|
||||||
for child in xml.getchildren():
|
|
||||||
root.append(child)
|
|
||||||
return ElementTree.tostring(root, 'utf-8'), checksum.hexdigest()
|
|
||||||
|
|
||||||
|
|
||||||
def concat_files(file_list, reader=None, intersperse=""):
|
|
||||||
""" Concatenates contents of all provided files
|
|
||||||
|
|
||||||
:param list(str) file_list: list of files to check
|
|
||||||
:param function reader: reading procedure for each file
|
|
||||||
:param str intersperse: string to intersperse between file contents
|
|
||||||
:returns: (concatenation_result, checksum)
|
|
||||||
:rtype: (str, str)
|
|
||||||
"""
|
|
||||||
checksum = hashlib.new('sha1')
|
|
||||||
if not file_list:
|
|
||||||
return '', checksum.hexdigest()
|
|
||||||
|
|
||||||
if reader is None:
|
|
||||||
def reader(f):
|
|
||||||
with open(f, 'rb') as fp:
|
|
||||||
return fp.read()
|
|
||||||
|
|
||||||
files_content = []
|
|
||||||
for fname in file_list:
|
|
||||||
contents = reader(fname)
|
|
||||||
checksum.update(contents)
|
|
||||||
files_content.append(contents)
|
|
||||||
|
|
||||||
files_concat = intersperse.join(files_content)
|
|
||||||
return files_concat, checksum.hexdigest()
|
|
||||||
|
|
||||||
html_template = """<!DOCTYPE html>
|
|
||||||
<html style="height: 100%%">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
||||||
<title>OpenERP</title>
|
|
||||||
<link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
|
|
||||||
<link rel="stylesheet" href="/web/static/src/css/full.css" />
|
|
||||||
%(css)s
|
|
||||||
%(js)s
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function() {
|
|
||||||
var s = new openerp.init(%(modules)s);
|
|
||||||
%(init)s
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body></body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
def sass2scss(src):
|
def sass2scss(src):
|
||||||
# Validated by diff -u of sass2scss against:
|
# Validated by diff -u of sass2scss against:
|
||||||
# sass-convert -F sass -T scss openerp.sass openerp.scss
|
# sass-convert -F sass -T scss openerp.sass openerp.scss
|
||||||
|
@ -163,13 +85,180 @@ def sass2scss(src):
|
||||||
return out
|
return out
|
||||||
return write(sass)
|
return write(sass)
|
||||||
|
|
||||||
def server_wide_modules(req):
|
def db_list(req):
|
||||||
addons = [i for i in req.config.server_wide_modules if i in openerpweb.addons_manifest]
|
dbs = []
|
||||||
|
proxy = req.session.proxy("db")
|
||||||
|
dbs = proxy.list()
|
||||||
|
h = req.httprequest.environ['HTTP_HOST'].split(':')[0]
|
||||||
|
d = h.split('.')[0]
|
||||||
|
r = req.config.dbfilter.replace('%h', h).replace('%d', d)
|
||||||
|
dbs = [i for i in dbs if re.match(r, i)]
|
||||||
|
return dbs
|
||||||
|
|
||||||
|
def module_topological_sort(modules):
|
||||||
|
""" Return a list of module names sorted so that their dependencies of the
|
||||||
|
modules are listed before the module itself
|
||||||
|
|
||||||
|
modules is a dict of {module_name: dependencies}
|
||||||
|
|
||||||
|
:param modules: modules to sort
|
||||||
|
:type modules: dict
|
||||||
|
:returns: list(str)
|
||||||
|
"""
|
||||||
|
|
||||||
|
dependencies = set(itertools.chain.from_iterable(modules.itervalues()))
|
||||||
|
# incoming edge: dependency on other module (if a depends on b, a has an
|
||||||
|
# incoming edge from b, aka there's an edge from b to a)
|
||||||
|
# outgoing edge: other module depending on this one
|
||||||
|
|
||||||
|
# [Tarjan 1976], http://en.wikipedia.org/wiki/Topological_sorting#Algorithms
|
||||||
|
#L ← Empty list that will contain the sorted nodes
|
||||||
|
L = []
|
||||||
|
#S ← Set of all nodes with no outgoing edges (modules on which no other
|
||||||
|
# module depends)
|
||||||
|
S = set(module for module in modules if module not in dependencies)
|
||||||
|
|
||||||
|
visited = set()
|
||||||
|
#function visit(node n)
|
||||||
|
def visit(n):
|
||||||
|
#if n has not been visited yet then
|
||||||
|
if n not in visited:
|
||||||
|
#mark n as visited
|
||||||
|
visited.add(n)
|
||||||
|
#change: n not web module, can not be resolved, ignore
|
||||||
|
if n not in modules: return
|
||||||
|
#for each node m with an edge from m to n do (dependencies of n)
|
||||||
|
for m in modules[n]:
|
||||||
|
#visit(m)
|
||||||
|
visit(m)
|
||||||
|
#add n to L
|
||||||
|
L.append(n)
|
||||||
|
#for each node n in S do
|
||||||
|
for n in S:
|
||||||
|
#visit(n)
|
||||||
|
visit(n)
|
||||||
|
return L
|
||||||
|
|
||||||
|
def module_installed(req):
|
||||||
|
# Candidates module the current heuristic is the /static dir
|
||||||
|
loadable = openerpweb.addons_manifest.keys()
|
||||||
|
modules = {}
|
||||||
|
|
||||||
|
# Retrieve database installed modules
|
||||||
|
# TODO The following code should move to ir.module.module.list_installed_modules()
|
||||||
|
Modules = req.session.model('ir.module.module')
|
||||||
|
domain = [('state','=','installed'), ('name','in', loadable)]
|
||||||
|
for module in Modules.search_read(domain, ['name', 'dependencies_id']):
|
||||||
|
modules[module['name']] = []
|
||||||
|
deps = module.get('dependencies_id')
|
||||||
|
if deps:
|
||||||
|
deps_read = req.session.model('ir.module.module.dependency').read(deps, ['name'])
|
||||||
|
dependencies = [i['name'] for i in deps_read]
|
||||||
|
modules[module['name']] = dependencies
|
||||||
|
|
||||||
|
sorted_modules = module_topological_sort(modules)
|
||||||
|
return sorted_modules
|
||||||
|
|
||||||
|
def module_installed_bypass_session(dbname):
|
||||||
|
loadable = openerpweb.addons_manifest.keys()
|
||||||
|
modules = {}
|
||||||
|
try:
|
||||||
|
import openerp.modules.registry
|
||||||
|
registry = openerp.modules.registry.RegistryManager.get(dbname)
|
||||||
|
with registry.cursor() as cr:
|
||||||
|
m = registry.get('ir.module.module')
|
||||||
|
# TODO The following code should move to ir.module.module.list_installed_modules()
|
||||||
|
domain = [('state','=','installed'), ('name','in', loadable)]
|
||||||
|
ids = m.search(cr, 1, [('state','=','installed'), ('name','in', loadable)])
|
||||||
|
for module in m.read(cr, 1, ids, ['name', 'dependencies_id']):
|
||||||
|
modules[module['name']] = []
|
||||||
|
deps = module.get('dependencies_id')
|
||||||
|
if deps:
|
||||||
|
deps_read = registry.get('ir.module.module.dependency').read(cr, 1, deps, ['name'])
|
||||||
|
dependencies = [i['name'] for i in deps_read]
|
||||||
|
modules[module['name']] = dependencies
|
||||||
|
except Exception,e:
|
||||||
|
pass
|
||||||
|
sorted_modules = module_topological_sort(modules)
|
||||||
|
return sorted_modules
|
||||||
|
|
||||||
|
def module_boot(req):
|
||||||
|
serverside = []
|
||||||
|
dbside = []
|
||||||
|
for i in req.config.server_wide_modules:
|
||||||
|
if i in openerpweb.addons_manifest:
|
||||||
|
serverside.append(i)
|
||||||
|
# if only one db load every module at boot
|
||||||
|
dbs = []
|
||||||
|
try:
|
||||||
|
dbs = db_list(req)
|
||||||
|
except xmlrpclib.Fault:
|
||||||
|
# ignore access denied
|
||||||
|
pass
|
||||||
|
if len(dbs) == 1:
|
||||||
|
dbside = module_installed_bypass_session(dbs[0])
|
||||||
|
dbside = [i for i in dbside if i not in serverside]
|
||||||
|
addons = serverside + dbside
|
||||||
return addons
|
return addons
|
||||||
|
|
||||||
|
def concat_xml(file_list):
|
||||||
|
"""Concatenate xml files
|
||||||
|
|
||||||
|
:param list(str) file_list: list of files to check
|
||||||
|
:returns: (concatenation_result, checksum)
|
||||||
|
:rtype: (str, str)
|
||||||
|
"""
|
||||||
|
checksum = hashlib.new('sha1')
|
||||||
|
if not file_list:
|
||||||
|
return '', checksum.hexdigest()
|
||||||
|
|
||||||
|
root = None
|
||||||
|
for fname in file_list:
|
||||||
|
with open(fname, 'rb') as fp:
|
||||||
|
contents = fp.read()
|
||||||
|
checksum.update(contents)
|
||||||
|
fp.seek(0)
|
||||||
|
xml = ElementTree.parse(fp).getroot()
|
||||||
|
|
||||||
|
if root is None:
|
||||||
|
root = ElementTree.Element(xml.tag)
|
||||||
|
#elif root.tag != xml.tag:
|
||||||
|
# raise ValueError("Root tags missmatch: %r != %r" % (root.tag, xml.tag))
|
||||||
|
|
||||||
|
for child in xml.getchildren():
|
||||||
|
root.append(child)
|
||||||
|
return ElementTree.tostring(root, 'utf-8'), checksum.hexdigest()
|
||||||
|
|
||||||
|
def concat_files(file_list, reader=None, intersperse=""):
|
||||||
|
""" Concatenates contents of all provided files
|
||||||
|
|
||||||
|
:param list(str) file_list: list of files to check
|
||||||
|
:param function reader: reading procedure for each file
|
||||||
|
:param str intersperse: string to intersperse between file contents
|
||||||
|
:returns: (concatenation_result, checksum)
|
||||||
|
:rtype: (str, str)
|
||||||
|
"""
|
||||||
|
checksum = hashlib.new('sha1')
|
||||||
|
if not file_list:
|
||||||
|
return '', checksum.hexdigest()
|
||||||
|
|
||||||
|
if reader is None:
|
||||||
|
def reader(f):
|
||||||
|
with open(f, 'rb') as fp:
|
||||||
|
return fp.read()
|
||||||
|
|
||||||
|
files_content = []
|
||||||
|
for fname in file_list:
|
||||||
|
contents = reader(fname)
|
||||||
|
checksum.update(contents)
|
||||||
|
files_content.append(contents)
|
||||||
|
|
||||||
|
files_concat = intersperse.join(files_content)
|
||||||
|
return files_concat, checksum.hexdigest()
|
||||||
|
|
||||||
def manifest_glob(req, addons, key):
|
def manifest_glob(req, addons, key):
|
||||||
if addons is None:
|
if addons is None:
|
||||||
addons = server_wide_modules(req)
|
addons = module_boot(req)
|
||||||
else:
|
else:
|
||||||
addons = addons.split(',')
|
addons = addons.split(',')
|
||||||
r = []
|
r = []
|
||||||
|
@ -237,6 +326,189 @@ def make_conditional(req, response, last_modified=None, etag=None):
|
||||||
response.set_etag(etag)
|
response.set_etag(etag)
|
||||||
return response.make_conditional(req.httprequest)
|
return response.make_conditional(req.httprequest)
|
||||||
|
|
||||||
|
def login_and_redirect(req, db, login, key, redirect_url='/'):
|
||||||
|
req.session.authenticate(db, login, key, {})
|
||||||
|
return set_cookie_and_redirect(req, redirect_url)
|
||||||
|
|
||||||
|
def set_cookie_and_redirect(req, redirect_url):
|
||||||
|
redirect = werkzeug.utils.redirect(redirect_url, 303)
|
||||||
|
redirect.autocorrect_location_header = False
|
||||||
|
cookie_val = urllib2.quote(simplejson.dumps(req.session_id))
|
||||||
|
redirect.set_cookie('instance0|session_id', cookie_val)
|
||||||
|
return redirect
|
||||||
|
|
||||||
|
def eval_context_and_domain(session, context, domain=None):
|
||||||
|
e_context = session.eval_context(context)
|
||||||
|
# should we give the evaluated context as an evaluation context to the domain?
|
||||||
|
e_domain = session.eval_domain(domain or [])
|
||||||
|
|
||||||
|
return e_context, e_domain
|
||||||
|
|
||||||
|
def load_actions_from_ir_values(req, key, key2, models, meta):
|
||||||
|
context = req.session.eval_context(req.context)
|
||||||
|
Values = req.session.model('ir.values')
|
||||||
|
actions = Values.get(key, key2, models, meta, context)
|
||||||
|
|
||||||
|
return [(id, name, clean_action(req, action))
|
||||||
|
for id, name, action in actions]
|
||||||
|
|
||||||
|
def clean_action(req, action, do_not_eval=False):
|
||||||
|
action.setdefault('flags', {})
|
||||||
|
|
||||||
|
context = req.session.eval_context(req.context)
|
||||||
|
eval_ctx = req.session.evaluation_context(context)
|
||||||
|
|
||||||
|
if not do_not_eval:
|
||||||
|
# values come from the server, we can just eval them
|
||||||
|
if action.get('context') and isinstance(action.get('context'), basestring):
|
||||||
|
action['context'] = eval( action['context'], eval_ctx ) or {}
|
||||||
|
|
||||||
|
if action.get('domain') and isinstance(action.get('domain'), basestring):
|
||||||
|
action['domain'] = eval( action['domain'], eval_ctx ) or []
|
||||||
|
else:
|
||||||
|
if 'context' in action:
|
||||||
|
action['context'] = parse_context(action['context'], req.session)
|
||||||
|
if 'domain' in action:
|
||||||
|
action['domain'] = parse_domain(action['domain'], req.session)
|
||||||
|
|
||||||
|
action_type = action.setdefault('type', 'ir.actions.act_window_close')
|
||||||
|
if action_type == 'ir.actions.act_window':
|
||||||
|
return fix_view_modes(action)
|
||||||
|
return action
|
||||||
|
|
||||||
|
# I think generate_views,fix_view_modes should go into js ActionManager
|
||||||
|
def generate_views(action):
|
||||||
|
"""
|
||||||
|
While the server generates a sequence called "views" computing dependencies
|
||||||
|
between a bunch of stuff for views coming directly from the database
|
||||||
|
(the ``ir.actions.act_window model``), it's also possible for e.g. buttons
|
||||||
|
to return custom view dictionaries generated on the fly.
|
||||||
|
|
||||||
|
In that case, there is no ``views`` key available on the action.
|
||||||
|
|
||||||
|
Since the web client relies on ``action['views']``, generate it here from
|
||||||
|
``view_mode`` and ``view_id``.
|
||||||
|
|
||||||
|
Currently handles two different cases:
|
||||||
|
|
||||||
|
* no view_id, multiple view_mode
|
||||||
|
* single view_id, single view_mode
|
||||||
|
|
||||||
|
:param dict action: action descriptor dictionary to generate a views key for
|
||||||
|
"""
|
||||||
|
view_id = action.get('view_id') or False
|
||||||
|
if isinstance(view_id, (list, tuple)):
|
||||||
|
view_id = view_id[0]
|
||||||
|
|
||||||
|
# providing at least one view mode is a requirement, not an option
|
||||||
|
view_modes = action['view_mode'].split(',')
|
||||||
|
|
||||||
|
if len(view_modes) > 1:
|
||||||
|
if view_id:
|
||||||
|
raise ValueError('Non-db action dictionaries should provide '
|
||||||
|
'either multiple view modes or a single view '
|
||||||
|
'mode and an optional view id.\n\n Got view '
|
||||||
|
'modes %r and view id %r for action %r' % (
|
||||||
|
view_modes, view_id, action))
|
||||||
|
action['views'] = [(False, mode) for mode in view_modes]
|
||||||
|
return
|
||||||
|
action['views'] = [(view_id, view_modes[0])]
|
||||||
|
|
||||||
|
def fix_view_modes(action):
|
||||||
|
""" For historical reasons, OpenERP has weird dealings in relation to
|
||||||
|
view_mode and the view_type attribute (on window actions):
|
||||||
|
|
||||||
|
* one of the view modes is ``tree``, which stands for both list views
|
||||||
|
and tree views
|
||||||
|
* the choice is made by checking ``view_type``, which is either
|
||||||
|
``form`` for a list view or ``tree`` for an actual tree view
|
||||||
|
|
||||||
|
This methods simply folds the view_type into view_mode by adding a
|
||||||
|
new view mode ``list`` which is the result of the ``tree`` view_mode
|
||||||
|
in conjunction with the ``form`` view_type.
|
||||||
|
|
||||||
|
TODO: this should go into the doc, some kind of "peculiarities" section
|
||||||
|
|
||||||
|
:param dict action: an action descriptor
|
||||||
|
:returns: nothing, the action is modified in place
|
||||||
|
"""
|
||||||
|
if not action.get('views'):
|
||||||
|
generate_views(action)
|
||||||
|
|
||||||
|
id_form = None
|
||||||
|
for index, (id, mode) in enumerate(action['views']):
|
||||||
|
if mode == 'form':
|
||||||
|
id_form = id
|
||||||
|
break
|
||||||
|
|
||||||
|
if action.pop('view_type', 'form') != 'form':
|
||||||
|
return action
|
||||||
|
|
||||||
|
action['views'] = [
|
||||||
|
[id, mode if mode != 'tree' else 'list']
|
||||||
|
for id, mode in action['views']
|
||||||
|
]
|
||||||
|
|
||||||
|
return action
|
||||||
|
|
||||||
|
def parse_domain(domain, session):
|
||||||
|
""" Parses an arbitrary string containing a domain, transforms it
|
||||||
|
to either a literal domain or a :class:`common.nonliterals.Domain`
|
||||||
|
|
||||||
|
:param domain: the domain to parse, if the domain is not a string it
|
||||||
|
is assumed to be a literal domain and is returned as-is
|
||||||
|
:param session: Current OpenERP session
|
||||||
|
:type session: openerpweb.openerpweb.OpenERPSession
|
||||||
|
"""
|
||||||
|
if not isinstance(domain, basestring):
|
||||||
|
return domain
|
||||||
|
try:
|
||||||
|
return ast.literal_eval(domain)
|
||||||
|
except ValueError:
|
||||||
|
# not a literal
|
||||||
|
return common.nonliterals.Domain(session, domain)
|
||||||
|
|
||||||
|
def parse_context(context, session):
|
||||||
|
""" Parses an arbitrary string containing a context, transforms it
|
||||||
|
to either a literal context or a :class:`common.nonliterals.Context`
|
||||||
|
|
||||||
|
:param context: the context to parse, if the context is not a string it
|
||||||
|
is assumed to be a literal domain and is returned as-is
|
||||||
|
:param session: Current OpenERP session
|
||||||
|
:type session: openerpweb.openerpweb.OpenERPSession
|
||||||
|
"""
|
||||||
|
if not isinstance(context, basestring):
|
||||||
|
return context
|
||||||
|
try:
|
||||||
|
return ast.literal_eval(context)
|
||||||
|
except ValueError:
|
||||||
|
return common.nonliterals.Context(session, context)
|
||||||
|
|
||||||
|
#----------------------------------------------------------
|
||||||
|
# OpenERP Web web Controllers
|
||||||
|
#----------------------------------------------------------
|
||||||
|
|
||||||
|
html_template = """<!DOCTYPE html>
|
||||||
|
<html style="height: 100%%">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<title>OpenERP</title>
|
||||||
|
<link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
|
||||||
|
<link rel="stylesheet" href="/web/static/src/css/full.css" />
|
||||||
|
%(css)s
|
||||||
|
%(js)s
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
var s = new openerp.init(%(modules)s);
|
||||||
|
%(init)s
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body></body>
|
||||||
|
</html>
|
||||||
|
"""
|
||||||
|
|
||||||
class Home(openerpweb.Controller):
|
class Home(openerpweb.Controller):
|
||||||
_cp_path = '/'
|
_cp_path = '/'
|
||||||
|
|
||||||
|
@ -248,21 +520,14 @@ class Home(openerpweb.Controller):
|
||||||
r = html_template % {
|
r = html_template % {
|
||||||
'js': js,
|
'js': js,
|
||||||
'css': css,
|
'css': css,
|
||||||
'modules': simplejson.dumps(server_wide_modules(req)),
|
'modules': simplejson.dumps(module_boot(req)),
|
||||||
'init': 'var wc = new s.web.WebClient();wc.appendTo($(document.body));'
|
'init': 'var wc = new s.web.WebClient();wc.appendTo($(document.body));'
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
|
|
||||||
@openerpweb.httprequest
|
@openerpweb.httprequest
|
||||||
def login(self, req, db, login, key):
|
def login(self, req, db, login, key):
|
||||||
return self._login(req, db, login, key)
|
return login_and_redirect(req, db, login, key)
|
||||||
|
|
||||||
def _login(self, req, db, login, key, redirect_url='/'):
|
|
||||||
req.session.authenticate(db, login, key, {})
|
|
||||||
redirect = werkzeug.utils.redirect(redirect_url, 303)
|
|
||||||
cookie_val = urllib2.quote(simplejson.dumps(req.session_id))
|
|
||||||
redirect.set_cookie('instance0|session_id', cookie_val)
|
|
||||||
return redirect
|
|
||||||
|
|
||||||
class WebClient(openerpweb.Controller):
|
class WebClient(openerpweb.Controller):
|
||||||
_cp_path = "/web/webclient"
|
_cp_path = "/web/webclient"
|
||||||
|
@ -412,12 +677,7 @@ class Database(openerpweb.Controller):
|
||||||
|
|
||||||
@openerpweb.jsonrequest
|
@openerpweb.jsonrequest
|
||||||
def get_list(self, req):
|
def get_list(self, req):
|
||||||
proxy = req.session.proxy("db")
|
dbs = db_list(req)
|
||||||
dbs = proxy.list()
|
|
||||||
h = req.httprequest.environ['HTTP_HOST'].split(':')[0]
|
|
||||||
d = h.split('.')[0]
|
|
||||||
r = req.config.dbfilter.replace('%h', h).replace('%d', d)
|
|
||||||
dbs = [i for i in dbs if re.match(r, i)]
|
|
||||||
return {"db_list": dbs}
|
return {"db_list": dbs}
|
||||||
|
|
||||||
@openerpweb.jsonrequest
|
@openerpweb.jsonrequest
|
||||||
|
@ -486,50 +746,6 @@ class Database(openerpweb.Controller):
|
||||||
return {'error': e.faultCode, 'title': 'Change Password'}
|
return {'error': e.faultCode, 'title': 'Change Password'}
|
||||||
return {'error': 'Error, password not changed !', 'title': 'Change Password'}
|
return {'error': 'Error, password not changed !', 'title': 'Change Password'}
|
||||||
|
|
||||||
def topological_sort(modules):
|
|
||||||
""" Return a list of module names sorted so that their dependencies of the
|
|
||||||
modules are listed before the module itself
|
|
||||||
|
|
||||||
modules is a dict of {module_name: dependencies}
|
|
||||||
|
|
||||||
:param modules: modules to sort
|
|
||||||
:type modules: dict
|
|
||||||
:returns: list(str)
|
|
||||||
"""
|
|
||||||
|
|
||||||
dependencies = set(itertools.chain.from_iterable(modules.itervalues()))
|
|
||||||
# incoming edge: dependency on other module (if a depends on b, a has an
|
|
||||||
# incoming edge from b, aka there's an edge from b to a)
|
|
||||||
# outgoing edge: other module depending on this one
|
|
||||||
|
|
||||||
# [Tarjan 1976], http://en.wikipedia.org/wiki/Topological_sorting#Algorithms
|
|
||||||
#L ← Empty list that will contain the sorted nodes
|
|
||||||
L = []
|
|
||||||
#S ← Set of all nodes with no outgoing edges (modules on which no other
|
|
||||||
# module depends)
|
|
||||||
S = set(module for module in modules if module not in dependencies)
|
|
||||||
|
|
||||||
visited = set()
|
|
||||||
#function visit(node n)
|
|
||||||
def visit(n):
|
|
||||||
#if n has not been visited yet then
|
|
||||||
if n not in visited:
|
|
||||||
#mark n as visited
|
|
||||||
visited.add(n)
|
|
||||||
#change: n not web module, can not be resolved, ignore
|
|
||||||
if n not in modules: return
|
|
||||||
#for each node m with an edge from m to n do (dependencies of n)
|
|
||||||
for m in modules[n]:
|
|
||||||
#visit(m)
|
|
||||||
visit(m)
|
|
||||||
#add n to L
|
|
||||||
L.append(n)
|
|
||||||
#for each node n in S do
|
|
||||||
for n in S:
|
|
||||||
#visit(n)
|
|
||||||
visit(n)
|
|
||||||
return L
|
|
||||||
|
|
||||||
class Session(openerpweb.Controller):
|
class Session(openerpweb.Controller):
|
||||||
_cp_path = "/web/session"
|
_cp_path = "/web/session"
|
||||||
|
|
||||||
|
@ -595,34 +811,8 @@ class Session(openerpweb.Controller):
|
||||||
|
|
||||||
@openerpweb.jsonrequest
|
@openerpweb.jsonrequest
|
||||||
def modules(self, req):
|
def modules(self, req):
|
||||||
# Compute available candidates module
|
# return all installed modules. Web client is smart enough to not load a module twice
|
||||||
loadable = openerpweb.addons_manifest
|
return module_installed(req)
|
||||||
loaded = set(req.config.server_wide_modules)
|
|
||||||
candidates = [mod for mod in loadable if mod not in loaded]
|
|
||||||
|
|
||||||
# already installed modules have no dependencies
|
|
||||||
modules = dict.fromkeys(loaded, [])
|
|
||||||
|
|
||||||
# Compute auto_install modules that might be on the web side only
|
|
||||||
modules.update((name, openerpweb.addons_manifest[name].get('depends', []))
|
|
||||||
for name in candidates
|
|
||||||
if openerpweb.addons_manifest[name].get('auto_install'))
|
|
||||||
|
|
||||||
# Retrieve database installed modules
|
|
||||||
Modules = req.session.model('ir.module.module')
|
|
||||||
for module in Modules.search_read(
|
|
||||||
[('state','=','installed'), ('name','in', candidates)],
|
|
||||||
['name', 'dependencies_id']):
|
|
||||||
deps = module.get('dependencies_id')
|
|
||||||
if deps:
|
|
||||||
dependencies = map(
|
|
||||||
operator.itemgetter('name'),
|
|
||||||
req.session.model('ir.module.module.dependency').read(deps, ['name']))
|
|
||||||
modules[module['name']] = list(
|
|
||||||
set(modules.get(module['name'], []) + dependencies))
|
|
||||||
|
|
||||||
sorted_modules = topological_sort(modules)
|
|
||||||
return [module for module in sorted_modules if module not in loaded]
|
|
||||||
|
|
||||||
@openerpweb.jsonrequest
|
@openerpweb.jsonrequest
|
||||||
def eval_domain_and_context(self, req, contexts, domains,
|
def eval_domain_and_context(self, req, contexts, domains,
|
||||||
|
@ -726,120 +916,6 @@ class Session(openerpweb.Controller):
|
||||||
def destroy(self, req):
|
def destroy(self, req):
|
||||||
req.session._suicide = True
|
req.session._suicide = True
|
||||||
|
|
||||||
def eval_context_and_domain(session, context, domain=None):
|
|
||||||
e_context = session.eval_context(context)
|
|
||||||
# should we give the evaluated context as an evaluation context to the domain?
|
|
||||||
e_domain = session.eval_domain(domain or [])
|
|
||||||
|
|
||||||
return e_context, e_domain
|
|
||||||
|
|
||||||
def load_actions_from_ir_values(req, key, key2, models, meta):
|
|
||||||
context = req.session.eval_context(req.context)
|
|
||||||
Values = req.session.model('ir.values')
|
|
||||||
actions = Values.get(key, key2, models, meta, context)
|
|
||||||
|
|
||||||
return [(id, name, clean_action(req, action))
|
|
||||||
for id, name, action in actions]
|
|
||||||
|
|
||||||
def clean_action(req, action, do_not_eval=False):
|
|
||||||
action.setdefault('flags', {})
|
|
||||||
|
|
||||||
context = req.session.eval_context(req.context)
|
|
||||||
eval_ctx = req.session.evaluation_context(context)
|
|
||||||
|
|
||||||
if not do_not_eval:
|
|
||||||
# values come from the server, we can just eval them
|
|
||||||
if action.get('context') and isinstance(action.get('context'), basestring):
|
|
||||||
action['context'] = eval( action['context'], eval_ctx ) or {}
|
|
||||||
|
|
||||||
if action.get('domain') and isinstance(action.get('domain'), basestring):
|
|
||||||
action['domain'] = eval( action['domain'], eval_ctx ) or []
|
|
||||||
else:
|
|
||||||
if 'context' in action:
|
|
||||||
action['context'] = parse_context(action['context'], req.session)
|
|
||||||
if 'domain' in action:
|
|
||||||
action['domain'] = parse_domain(action['domain'], req.session)
|
|
||||||
|
|
||||||
action_type = action.setdefault('type', 'ir.actions.act_window_close')
|
|
||||||
if action_type == 'ir.actions.act_window':
|
|
||||||
return fix_view_modes(action)
|
|
||||||
return action
|
|
||||||
|
|
||||||
# I think generate_views,fix_view_modes should go into js ActionManager
|
|
||||||
def generate_views(action):
|
|
||||||
"""
|
|
||||||
While the server generates a sequence called "views" computing dependencies
|
|
||||||
between a bunch of stuff for views coming directly from the database
|
|
||||||
(the ``ir.actions.act_window model``), it's also possible for e.g. buttons
|
|
||||||
to return custom view dictionaries generated on the fly.
|
|
||||||
|
|
||||||
In that case, there is no ``views`` key available on the action.
|
|
||||||
|
|
||||||
Since the web client relies on ``action['views']``, generate it here from
|
|
||||||
``view_mode`` and ``view_id``.
|
|
||||||
|
|
||||||
Currently handles two different cases:
|
|
||||||
|
|
||||||
* no view_id, multiple view_mode
|
|
||||||
* single view_id, single view_mode
|
|
||||||
|
|
||||||
:param dict action: action descriptor dictionary to generate a views key for
|
|
||||||
"""
|
|
||||||
view_id = action.get('view_id') or False
|
|
||||||
if isinstance(view_id, (list, tuple)):
|
|
||||||
view_id = view_id[0]
|
|
||||||
|
|
||||||
# providing at least one view mode is a requirement, not an option
|
|
||||||
view_modes = action['view_mode'].split(',')
|
|
||||||
|
|
||||||
if len(view_modes) > 1:
|
|
||||||
if view_id:
|
|
||||||
raise ValueError('Non-db action dictionaries should provide '
|
|
||||||
'either multiple view modes or a single view '
|
|
||||||
'mode and an optional view id.\n\n Got view '
|
|
||||||
'modes %r and view id %r for action %r' % (
|
|
||||||
view_modes, view_id, action))
|
|
||||||
action['views'] = [(False, mode) for mode in view_modes]
|
|
||||||
return
|
|
||||||
action['views'] = [(view_id, view_modes[0])]
|
|
||||||
|
|
||||||
def fix_view_modes(action):
|
|
||||||
""" For historical reasons, OpenERP has weird dealings in relation to
|
|
||||||
view_mode and the view_type attribute (on window actions):
|
|
||||||
|
|
||||||
* one of the view modes is ``tree``, which stands for both list views
|
|
||||||
and tree views
|
|
||||||
* the choice is made by checking ``view_type``, which is either
|
|
||||||
``form`` for a list view or ``tree`` for an actual tree view
|
|
||||||
|
|
||||||
This methods simply folds the view_type into view_mode by adding a
|
|
||||||
new view mode ``list`` which is the result of the ``tree`` view_mode
|
|
||||||
in conjunction with the ``form`` view_type.
|
|
||||||
|
|
||||||
TODO: this should go into the doc, some kind of "peculiarities" section
|
|
||||||
|
|
||||||
:param dict action: an action descriptor
|
|
||||||
:returns: nothing, the action is modified in place
|
|
||||||
"""
|
|
||||||
if not action.get('views'):
|
|
||||||
generate_views(action)
|
|
||||||
|
|
||||||
id_form = None
|
|
||||||
for index, (id, mode) in enumerate(action['views']):
|
|
||||||
if mode == 'form':
|
|
||||||
id_form = id
|
|
||||||
break
|
|
||||||
|
|
||||||
if action.pop('view_type', 'form') != 'form':
|
|
||||||
return action
|
|
||||||
|
|
||||||
action['views'] = [
|
|
||||||
[id, mode if mode != 'tree' else 'list']
|
|
||||||
for id, mode in action['views']
|
|
||||||
]
|
|
||||||
|
|
||||||
return action
|
|
||||||
|
|
||||||
class Menu(openerpweb.Controller):
|
class Menu(openerpweb.Controller):
|
||||||
_cp_path = "/web/menu"
|
_cp_path = "/web/menu"
|
||||||
|
|
||||||
|
@ -1065,6 +1141,15 @@ class DataSet(openerpweb.Controller):
|
||||||
def exec_workflow(self, req, model, id, signal):
|
def exec_workflow(self, req, model, id, signal):
|
||||||
return req.session.exec_workflow(model, id, signal)
|
return req.session.exec_workflow(model, id, signal)
|
||||||
|
|
||||||
|
@openerpweb.jsonrequest
|
||||||
|
def resequence(self, req, model, ids):
|
||||||
|
m = req.session.model(model)
|
||||||
|
if not len(m.fields_get(['sequence'])):
|
||||||
|
return False
|
||||||
|
for i in range(len(ids)):
|
||||||
|
m.write([ids[i]], { 'sequence': i })
|
||||||
|
return True
|
||||||
|
|
||||||
class DataGroup(openerpweb.Controller):
|
class DataGroup(openerpweb.Controller):
|
||||||
_cp_path = "/web/group"
|
_cp_path = "/web/group"
|
||||||
@openerpweb.jsonrequest
|
@openerpweb.jsonrequest
|
||||||
|
@ -1204,39 +1289,6 @@ class View(openerpweb.Controller):
|
||||||
def load(self, req, model, view_id, view_type, toolbar=False):
|
def load(self, req, model, view_id, view_type, toolbar=False):
|
||||||
return self.fields_view_get(req, model, view_id, view_type, toolbar=toolbar)
|
return self.fields_view_get(req, model, view_id, view_type, toolbar=toolbar)
|
||||||
|
|
||||||
def parse_domain(domain, session):
|
|
||||||
""" Parses an arbitrary string containing a domain, transforms it
|
|
||||||
to either a literal domain or a :class:`common.nonliterals.Domain`
|
|
||||||
|
|
||||||
:param domain: the domain to parse, if the domain is not a string it
|
|
||||||
is assumed to be a literal domain and is returned as-is
|
|
||||||
:param session: Current OpenERP session
|
|
||||||
:type session: openerpweb.openerpweb.OpenERPSession
|
|
||||||
"""
|
|
||||||
if not isinstance(domain, basestring):
|
|
||||||
return domain
|
|
||||||
try:
|
|
||||||
return ast.literal_eval(domain)
|
|
||||||
except ValueError:
|
|
||||||
# not a literal
|
|
||||||
return common.nonliterals.Domain(session, domain)
|
|
||||||
|
|
||||||
def parse_context(context, session):
|
|
||||||
""" Parses an arbitrary string containing a context, transforms it
|
|
||||||
to either a literal context or a :class:`common.nonliterals.Context`
|
|
||||||
|
|
||||||
:param context: the context to parse, if the context is not a string it
|
|
||||||
is assumed to be a literal domain and is returned as-is
|
|
||||||
:param session: Current OpenERP session
|
|
||||||
:type session: openerpweb.openerpweb.OpenERPSession
|
|
||||||
"""
|
|
||||||
if not isinstance(context, basestring):
|
|
||||||
return context
|
|
||||||
try:
|
|
||||||
return ast.literal_eval(context)
|
|
||||||
except ValueError:
|
|
||||||
return common.nonliterals.Context(session, context)
|
|
||||||
|
|
||||||
class ListView(View):
|
class ListView(View):
|
||||||
_cp_path = "/web/listview"
|
_cp_path = "/web/listview"
|
||||||
|
|
||||||
|
@ -1311,47 +1363,6 @@ class SearchView(View):
|
||||||
del filter['domain']
|
del filter['domain']
|
||||||
return filters
|
return filters
|
||||||
|
|
||||||
|
|
||||||
@openerpweb.jsonrequest
|
|
||||||
def add_to_dashboard(self, req, menu_id, action_id, context_to_save, domain, view_mode, name=''):
|
|
||||||
to_eval = common.nonliterals.CompoundContext(context_to_save)
|
|
||||||
to_eval.session = req.session
|
|
||||||
ctx = dict((k, v) for k, v in to_eval.evaluate().iteritems()
|
|
||||||
if not k.startswith('search_default_'))
|
|
||||||
ctx['dashboard_merge_domains_contexts'] = False # TODO: replace this 6.1 workaround by attribute on <action/>
|
|
||||||
domain = common.nonliterals.CompoundDomain(domain)
|
|
||||||
domain.session = req.session
|
|
||||||
domain = domain.evaluate()
|
|
||||||
|
|
||||||
dashboard_action = load_actions_from_ir_values(req, 'action', 'tree_but_open',
|
|
||||||
[('ir.ui.menu', menu_id)], False)
|
|
||||||
if dashboard_action:
|
|
||||||
action = dashboard_action[0][2]
|
|
||||||
if action['res_model'] == 'board.board' and action['views'][0][1] == 'form':
|
|
||||||
# Maybe should check the content instead of model board.board ?
|
|
||||||
view_id = action['views'][0][0]
|
|
||||||
board = req.session.model(action['res_model']).fields_view_get(view_id, 'form')
|
|
||||||
if board and 'arch' in board:
|
|
||||||
xml = ElementTree.fromstring(board['arch'])
|
|
||||||
column = xml.find('./board/column')
|
|
||||||
if column is not None:
|
|
||||||
new_action = ElementTree.Element('action', {
|
|
||||||
'name' : str(action_id),
|
|
||||||
'string' : name,
|
|
||||||
'view_mode' : view_mode,
|
|
||||||
'context' : str(ctx),
|
|
||||||
'domain' : str(domain)
|
|
||||||
})
|
|
||||||
column.insert(0, new_action)
|
|
||||||
arch = ElementTree.tostring(xml, 'utf-8')
|
|
||||||
return req.session.model('ir.ui.view.custom').create({
|
|
||||||
'user_id': req.session._uid,
|
|
||||||
'ref_id': view_id,
|
|
||||||
'arch': arch
|
|
||||||
}, req.session.eval_context(req.context))
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
class Binary(openerpweb.Controller):
|
class Binary(openerpweb.Controller):
|
||||||
_cp_path = "/web/binary"
|
_cp_path = "/web/binary"
|
||||||
|
|
||||||
|
@ -1363,11 +1374,14 @@ class Binary(openerpweb.Controller):
|
||||||
headers = [('Content-Type', 'image/png')]
|
headers = [('Content-Type', 'image/png')]
|
||||||
etag = req.httprequest.headers.get('If-None-Match')
|
etag = req.httprequest.headers.get('If-None-Match')
|
||||||
hashed_session = hashlib.md5(req.session_id).hexdigest()
|
hashed_session = hashlib.md5(req.session_id).hexdigest()
|
||||||
|
id = None if not id else simplejson.loads(id)
|
||||||
|
if type(id) is list:
|
||||||
|
id = id[0] # m2o
|
||||||
if etag:
|
if etag:
|
||||||
if not id and hashed_session == etag:
|
if not id and hashed_session == etag:
|
||||||
return werkzeug.wrappers.Response(status=304)
|
return werkzeug.wrappers.Response(status=304)
|
||||||
else:
|
else:
|
||||||
date = Model.read([int(id)], [last_update], context)[0].get(last_update)
|
date = Model.read([id], [last_update], context)[0].get(last_update)
|
||||||
if hashlib.md5(date).hexdigest() == etag:
|
if hashlib.md5(date).hexdigest() == etag:
|
||||||
return werkzeug.wrappers.Response(status=304)
|
return werkzeug.wrappers.Response(status=304)
|
||||||
|
|
||||||
|
@ -1377,11 +1391,6 @@ class Binary(openerpweb.Controller):
|
||||||
res = Model.default_get([field], context).get(field)
|
res = Model.default_get([field], context).get(field)
|
||||||
image_data = base64.b64decode(res)
|
image_data = base64.b64decode(res)
|
||||||
else:
|
else:
|
||||||
try:
|
|
||||||
id = int(id)
|
|
||||||
except (ValueError):
|
|
||||||
# objects might use virtual ids as string
|
|
||||||
pass
|
|
||||||
res = Model.read([id], [last_update, field], context)[0]
|
res = Model.read([id], [last_update, field], context)[0]
|
||||||
retag = hashlib.md5(res.get(last_update)).hexdigest()
|
retag = hashlib.md5(res.get(last_update)).hexdigest()
|
||||||
image_data = base64.b64decode(res.get(field))
|
image_data = base64.b64decode(res.get(field))
|
||||||
|
@ -1999,3 +2008,5 @@ class Import(View):
|
||||||
message, record)
|
message, record)
|
||||||
return '<script>window.top.%s(%s);</script>' % (
|
return '<script>window.top.%s(%s);</script>' % (
|
||||||
jsonp, simplejson.dumps({'error': {'message':msg}}))
|
jsonp, simplejson.dumps({'error': {'message':msg}}))
|
||||||
|
|
||||||
|
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:44+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:44+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:44+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:44+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
"X-Poedit-Language: Czech\n"
|
"X-Poedit-Language: Czech\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:44+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -9,13 +9,14 @@ msgstr ""
|
||||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"POT-Creation-Date: 2012-07-02 09:06+0200\n"
|
"POT-Creation-Date: 2012-07-02 09:06+0200\n"
|
||||||
"PO-Revision-Date: 2012-07-30 00:28+0000\n"
|
"PO-Revision-Date: 2012-07-30 00:28+0000\n"
|
||||||
"Last-Translator: Fábio Martinelli <webmaster@guaru.net>\n"
|
"Last-Translator: Fábio Martinelli - http://zupy.com.br "
|
||||||
|
"<webmaster@guaru.net>\n"
|
||||||
"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
|
"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:44+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:49+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web/static/src/js/chrome.js:176
|
#: addons/web/static/src/js/chrome.js:176
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Backbone.js 0.9.1
|
// Backbone.js 0.9.2
|
||||||
|
|
||||||
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||||
// Backbone may be freely distributed under the MIT license.
|
// Backbone may be freely distributed under the MIT license.
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current version of the library. Keep in sync with `package.json`.
|
// Current version of the library. Keep in sync with `package.json`.
|
||||||
Backbone.VERSION = '0.9.1';
|
Backbone.VERSION = '0.9.2';
|
||||||
|
|
||||||
// Require Underscore, if we're on the server, and it's not already present.
|
// Require Underscore, if we're on the server, and it's not already present.
|
||||||
var _ = root._;
|
var _ = root._;
|
||||||
|
@ -71,6 +71,9 @@
|
||||||
// Backbone.Events
|
// Backbone.Events
|
||||||
// -----------------
|
// -----------------
|
||||||
|
|
||||||
|
// Regular expression used to split event strings
|
||||||
|
var eventSplitter = /\s+/;
|
||||||
|
|
||||||
// A module that can be mixed in to *any object* in order to provide it with
|
// A module that can be mixed in to *any object* in order to provide it with
|
||||||
// custom events. You may bind with `on` or remove with `off` callback functions
|
// custom events. You may bind with `on` or remove with `off` callback functions
|
||||||
// to an event; trigger`-ing an event fires all callbacks in succession.
|
// to an event; trigger`-ing an event fires all callbacks in succession.
|
||||||
|
@ -80,89 +83,110 @@
|
||||||
// object.on('expand', function(){ alert('expanded'); });
|
// object.on('expand', function(){ alert('expanded'); });
|
||||||
// object.trigger('expand');
|
// object.trigger('expand');
|
||||||
//
|
//
|
||||||
Backbone.Events = {
|
var Events = Backbone.Events = {
|
||||||
|
|
||||||
// Bind an event, specified by a string name, `ev`, to a `callback`
|
// Bind one or more space separated events, `events`, to a `callback`
|
||||||
// function. Passing `"all"` will bind the callback to all events fired.
|
// function. Passing `"all"` will bind the callback to all events fired.
|
||||||
on: function(events, callback, context) {
|
on: function(events, callback, context) {
|
||||||
var ev;
|
|
||||||
events = events.split(/\s+/);
|
var calls, event, node, tail, list;
|
||||||
var calls = this._callbacks || (this._callbacks = {});
|
if (!callback) return this;
|
||||||
while (ev = events.shift()) {
|
events = events.split(eventSplitter);
|
||||||
|
calls = this._callbacks || (this._callbacks = {});
|
||||||
|
|
||||||
// Create an immutable callback list, allowing traversal during
|
// Create an immutable callback list, allowing traversal during
|
||||||
// modification. The tail is an empty object that will always be used
|
// modification. The tail is an empty object that will always be used
|
||||||
// as the next node.
|
// as the next node.
|
||||||
var list = calls[ev] || (calls[ev] = {});
|
while (event = events.shift()) {
|
||||||
var tail = list.tail || (list.tail = list.next = {});
|
list = calls[event];
|
||||||
tail.callback = callback;
|
node = list ? list.tail : {};
|
||||||
tail.context = context;
|
node.next = tail = {};
|
||||||
list.tail = tail.next = {};
|
node.context = context;
|
||||||
|
node.callback = callback;
|
||||||
|
calls[event] = {tail: tail, next: list ? list.next : node};
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Remove one or many callbacks. If `context` is null, removes all callbacks
|
// Remove one or many callbacks. If `context` is null, removes all callbacks
|
||||||
// with that function. If `callback` is null, removes all callbacks for the
|
// with that function. If `callback` is null, removes all callbacks for the
|
||||||
// event. If `ev` is null, removes all bound callbacks for all events.
|
// event. If `events` is null, removes all bound callbacks for all events.
|
||||||
off: function(events, callback, context) {
|
off: function(events, callback, context) {
|
||||||
var ev, calls, node;
|
var event, calls, node, tail, cb, ctx;
|
||||||
if (!events) {
|
|
||||||
|
// No events, or removing *all* events.
|
||||||
|
if (!(calls = this._callbacks)) return;
|
||||||
|
if (!(events || callback || context)) {
|
||||||
delete this._callbacks;
|
delete this._callbacks;
|
||||||
} else if (calls = this._callbacks) {
|
return this;
|
||||||
events = events.split(/\s+/);
|
}
|
||||||
while (ev = events.shift()) {
|
|
||||||
node = calls[ev];
|
// Loop through the listed events and contexts, splicing them out of the
|
||||||
delete calls[ev];
|
// linked list of callbacks if appropriate.
|
||||||
if (!callback || !node) continue;
|
events = events ? events.split(eventSplitter) : _.keys(calls);
|
||||||
// Create a new list, omitting the indicated event/context pairs.
|
while (event = events.shift()) {
|
||||||
while ((node = node.next) && node.next) {
|
node = calls[event];
|
||||||
if (node.callback === callback &&
|
delete calls[event];
|
||||||
(!context || node.context === context)) continue;
|
if (!node || !(callback || context)) continue;
|
||||||
this.on(ev, node.callback, node.context);
|
// Create a new list, omitting the indicated callbacks.
|
||||||
|
tail = node.tail;
|
||||||
|
while ((node = node.next) !== tail) {
|
||||||
|
cb = node.callback;
|
||||||
|
ctx = node.context;
|
||||||
|
if ((callback && cb !== callback) || (context && ctx !== context)) {
|
||||||
|
this.on(event, cb, ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Trigger an event, firing all bound callbacks. Callbacks are passed the
|
// Trigger one or many events, firing all bound callbacks. Callbacks are
|
||||||
// same arguments as `trigger` is, apart from the event name.
|
// passed the same arguments as `trigger` is, apart from the event name
|
||||||
// Listening for `"all"` passes the true event name as the first argument.
|
// (unless you're listening on `"all"`, which will cause your callback to
|
||||||
|
// receive the true name of the event as the first argument).
|
||||||
trigger: function(events) {
|
trigger: function(events) {
|
||||||
var event, node, calls, tail, args, all, rest;
|
var event, node, calls, tail, args, all, rest;
|
||||||
if (!(calls = this._callbacks)) return this;
|
if (!(calls = this._callbacks)) return this;
|
||||||
all = calls['all'];
|
all = calls.all;
|
||||||
(events = events.split(/\s+/)).push(null);
|
events = events.split(eventSplitter);
|
||||||
// Save references to the current heads & tails.
|
|
||||||
while (event = events.shift()) {
|
|
||||||
if (all) events.push({next: all.next, tail: all.tail, event: event});
|
|
||||||
if (!(node = calls[event])) continue;
|
|
||||||
events.push({next: node.next, tail: node.tail});
|
|
||||||
}
|
|
||||||
// Traverse each list, stopping when the saved tail is reached.
|
|
||||||
rest = slice.call(arguments, 1);
|
rest = slice.call(arguments, 1);
|
||||||
while (node = events.pop()) {
|
|
||||||
|
// For each event, walk through the linked list of callbacks twice,
|
||||||
|
// first to trigger the event, then to trigger any `"all"` callbacks.
|
||||||
|
while (event = events.shift()) {
|
||||||
|
if (node = calls[event]) {
|
||||||
tail = node.tail;
|
tail = node.tail;
|
||||||
args = node.event ? [node.event].concat(rest) : rest;
|
while ((node = node.next) !== tail) {
|
||||||
|
node.callback.apply(node.context || this, rest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (node = all) {
|
||||||
|
tail = node.tail;
|
||||||
|
args = [event].concat(rest);
|
||||||
while ((node = node.next) !== tail) {
|
while ((node = node.next) !== tail) {
|
||||||
node.callback.apply(node.context || this, args);
|
node.callback.apply(node.context || this, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Aliases for backwards compatibility.
|
// Aliases for backwards compatibility.
|
||||||
Backbone.Events.bind = Backbone.Events.on;
|
Events.bind = Events.on;
|
||||||
Backbone.Events.unbind = Backbone.Events.off;
|
Events.unbind = Events.off;
|
||||||
|
|
||||||
// Backbone.Model
|
// Backbone.Model
|
||||||
// --------------
|
// --------------
|
||||||
|
|
||||||
// Create a new model, with defined attributes. A client id (`cid`)
|
// Create a new model, with defined attributes. A client id (`cid`)
|
||||||
// is automatically generated and assigned for you.
|
// is automatically generated and assigned for you.
|
||||||
Backbone.Model = function(attributes, options) {
|
var Model = Backbone.Model = function(attributes, options) {
|
||||||
var defaults;
|
var defaults;
|
||||||
attributes || (attributes = {});
|
attributes || (attributes = {});
|
||||||
if (options && options.parse) attributes = this.parse(attributes);
|
if (options && options.parse) attributes = this.parse(attributes);
|
||||||
|
@ -173,16 +197,31 @@
|
||||||
this.attributes = {};
|
this.attributes = {};
|
||||||
this._escapedAttributes = {};
|
this._escapedAttributes = {};
|
||||||
this.cid = _.uniqueId('c');
|
this.cid = _.uniqueId('c');
|
||||||
if (!this.set(attributes, {silent: true})) {
|
this.changed = {};
|
||||||
throw new Error("Can't create an invalid model");
|
this._silent = {};
|
||||||
}
|
this._pending = {};
|
||||||
delete this._changed;
|
this.set(attributes, {silent: true});
|
||||||
|
// Reset change tracking.
|
||||||
|
this.changed = {};
|
||||||
|
this._silent = {};
|
||||||
|
this._pending = {};
|
||||||
this._previousAttributes = _.clone(this.attributes);
|
this._previousAttributes = _.clone(this.attributes);
|
||||||
this.initialize.apply(this, arguments);
|
this.initialize.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Attach all inheritable methods to the Model prototype.
|
// Attach all inheritable methods to the Model prototype.
|
||||||
_.extend(Backbone.Model.prototype, Backbone.Events, {
|
_.extend(Model.prototype, Events, {
|
||||||
|
|
||||||
|
// A hash of attributes whose current and previous value differ.
|
||||||
|
changed: null,
|
||||||
|
|
||||||
|
// A hash of attributes that have silently changed since the last time
|
||||||
|
// `change` was called. Will become pending attributes on the next call.
|
||||||
|
_silent: null,
|
||||||
|
|
||||||
|
// A hash of attributes that have changed since the last `'change'` event
|
||||||
|
// began.
|
||||||
|
_pending: null,
|
||||||
|
|
||||||
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
|
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
|
||||||
// CouchDB users may want to set this to `"_id"`.
|
// CouchDB users may want to set this to `"_id"`.
|
||||||
|
@ -193,7 +232,7 @@
|
||||||
initialize: function(){},
|
initialize: function(){},
|
||||||
|
|
||||||
// Return a copy of the model's `attributes` object.
|
// Return a copy of the model's `attributes` object.
|
||||||
toJSON: function() {
|
toJSON: function(options) {
|
||||||
return _.clone(this.attributes);
|
return _.clone(this.attributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -206,20 +245,22 @@
|
||||||
escape: function(attr) {
|
escape: function(attr) {
|
||||||
var html;
|
var html;
|
||||||
if (html = this._escapedAttributes[attr]) return html;
|
if (html = this._escapedAttributes[attr]) return html;
|
||||||
var val = this.attributes[attr];
|
var val = this.get(attr);
|
||||||
return this._escapedAttributes[attr] = _.escape(val == null ? '' : '' + val);
|
return this._escapedAttributes[attr] = _.escape(val == null ? '' : '' + val);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Returns `true` if the attribute contains a value that is not null
|
// Returns `true` if the attribute contains a value that is not null
|
||||||
// or undefined.
|
// or undefined.
|
||||||
has: function(attr) {
|
has: function(attr) {
|
||||||
return this.attributes[attr] != null;
|
return this.get(attr) != null;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set a hash of model attributes on the object, firing `"change"` unless
|
// Set a hash of model attributes on the object, firing `"change"` unless
|
||||||
// you choose to silence it.
|
// you choose to silence it.
|
||||||
set: function(key, value, options) {
|
set: function(key, value, options) {
|
||||||
var attrs, attr, val;
|
var attrs, attr, val;
|
||||||
|
|
||||||
|
// Handle both `"key", value` and `{key: value}` -style arguments.
|
||||||
if (_.isObject(key) || key == null) {
|
if (_.isObject(key) || key == null) {
|
||||||
attrs = key;
|
attrs = key;
|
||||||
options = value;
|
options = value;
|
||||||
|
@ -231,7 +272,7 @@
|
||||||
// Extract attributes and options.
|
// Extract attributes and options.
|
||||||
options || (options = {});
|
options || (options = {});
|
||||||
if (!attrs) return this;
|
if (!attrs) return this;
|
||||||
if (attrs instanceof Backbone.Model) attrs = attrs.attributes;
|
if (attrs instanceof Model) attrs = attrs.attributes;
|
||||||
if (options.unset) for (attr in attrs) attrs[attr] = void 0;
|
if (options.unset) for (attr in attrs) attrs[attr] = void 0;
|
||||||
|
|
||||||
// Run validation.
|
// Run validation.
|
||||||
|
@ -240,33 +281,37 @@
|
||||||
// Check for changes of `id`.
|
// Check for changes of `id`.
|
||||||
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
|
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
|
||||||
|
|
||||||
|
var changes = options.changes = {};
|
||||||
var now = this.attributes;
|
var now = this.attributes;
|
||||||
var escaped = this._escapedAttributes;
|
var escaped = this._escapedAttributes;
|
||||||
var prev = this._previousAttributes || {};
|
var prev = this._previousAttributes || {};
|
||||||
var alreadySetting = this._setting;
|
|
||||||
this._changed || (this._changed = {});
|
|
||||||
this._setting = true;
|
|
||||||
|
|
||||||
// Update attributes.
|
// For each `set` attribute...
|
||||||
for (attr in attrs) {
|
for (attr in attrs) {
|
||||||
val = attrs[attr];
|
val = attrs[attr];
|
||||||
if (!_.isEqual(now[attr], val)) delete escaped[attr];
|
|
||||||
options.unset ? delete now[attr] : now[attr] = val;
|
// If the new and current value differ, record the change.
|
||||||
if (this._changing && !_.isEqual(this._changed[attr], val)) {
|
if (!_.isEqual(now[attr], val) || (options.unset && _.has(now, attr))) {
|
||||||
this.trigger('change:' + attr, this, val, options);
|
delete escaped[attr];
|
||||||
this._moreChanges = true;
|
(options.silent ? this._silent : changes)[attr] = true;
|
||||||
}
|
}
|
||||||
delete this._changed[attr];
|
|
||||||
|
// Update or delete the current value.
|
||||||
|
options.unset ? delete now[attr] : now[attr] = val;
|
||||||
|
|
||||||
|
// If the new and previous value differ, record the change. If not,
|
||||||
|
// then remove changes for this attribute.
|
||||||
if (!_.isEqual(prev[attr], val) || (_.has(now, attr) != _.has(prev, attr))) {
|
if (!_.isEqual(prev[attr], val) || (_.has(now, attr) != _.has(prev, attr))) {
|
||||||
this._changed[attr] = val;
|
this.changed[attr] = val;
|
||||||
|
if (!options.silent) this._pending[attr] = true;
|
||||||
|
} else {
|
||||||
|
delete this.changed[attr];
|
||||||
|
delete this._pending[attr];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fire the `"change"` events, if the model has been changed.
|
// Fire the `"change"` events.
|
||||||
if (!alreadySetting) {
|
if (!options.silent) this.change(options);
|
||||||
if (!options.silent && this.hasChanged()) this.change(options);
|
|
||||||
this._setting = false;
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -304,6 +349,8 @@
|
||||||
// state will be `set` again.
|
// state will be `set` again.
|
||||||
save: function(key, value, options) {
|
save: function(key, value, options) {
|
||||||
var attrs, current;
|
var attrs, current;
|
||||||
|
|
||||||
|
// Handle both `("key", value)` and `({key: value})` -style calls.
|
||||||
if (_.isObject(key) || key == null) {
|
if (_.isObject(key) || key == null) {
|
||||||
attrs = key;
|
attrs = key;
|
||||||
options = value;
|
options = value;
|
||||||
|
@ -311,18 +358,30 @@
|
||||||
attrs = {};
|
attrs = {};
|
||||||
attrs[key] = value;
|
attrs[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
options = options ? _.clone(options) : {};
|
options = options ? _.clone(options) : {};
|
||||||
if (options.wait) current = _.clone(this.attributes);
|
|
||||||
|
// If we're "wait"-ing to set changed attributes, validate early.
|
||||||
|
if (options.wait) {
|
||||||
|
if (!this._validate(attrs, options)) return false;
|
||||||
|
current = _.clone(this.attributes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Regular saves `set` attributes before persisting to the server.
|
||||||
var silentOptions = _.extend({}, options, {silent: true});
|
var silentOptions = _.extend({}, options, {silent: true});
|
||||||
if (attrs && !this.set(attrs, options.wait ? silentOptions : options)) {
|
if (attrs && !this.set(attrs, options.wait ? silentOptions : options)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// After a successful server-side save, the client is (optionally)
|
||||||
|
// updated with the server-side state.
|
||||||
var model = this;
|
var model = this;
|
||||||
var success = options.success;
|
var success = options.success;
|
||||||
options.success = function(resp, status, xhr) {
|
options.success = function(resp, status, xhr) {
|
||||||
var serverAttrs = model.parse(resp, xhr);
|
var serverAttrs = model.parse(resp, xhr);
|
||||||
if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
|
if (options.wait) {
|
||||||
|
delete options.wait;
|
||||||
|
serverAttrs = _.extend(attrs || {}, serverAttrs);
|
||||||
|
}
|
||||||
if (!model.set(serverAttrs, options)) return false;
|
if (!model.set(serverAttrs, options)) return false;
|
||||||
if (success) {
|
if (success) {
|
||||||
success(model, resp);
|
success(model, resp);
|
||||||
|
@ -330,6 +389,8 @@
|
||||||
model.trigger('sync', model, resp, options);
|
model.trigger('sync', model, resp, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Finish configuring and sending the Ajax request.
|
||||||
options.error = Backbone.wrapError(options.error, model, options);
|
options.error = Backbone.wrapError(options.error, model, options);
|
||||||
var method = this.isNew() ? 'create' : 'update';
|
var method = this.isNew() ? 'create' : 'update';
|
||||||
var xhr = (this.sync || Backbone.sync).call(this, method, this, options);
|
var xhr = (this.sync || Backbone.sync).call(this, method, this, options);
|
||||||
|
@ -349,7 +410,11 @@
|
||||||
model.trigger('destroy', model, model.collection, options);
|
model.trigger('destroy', model, model.collection, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.isNew()) return triggerDestroy();
|
if (this.isNew()) {
|
||||||
|
triggerDestroy();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
options.success = function(resp) {
|
options.success = function(resp) {
|
||||||
if (options.wait) triggerDestroy();
|
if (options.wait) triggerDestroy();
|
||||||
if (success) {
|
if (success) {
|
||||||
|
@ -358,6 +423,7 @@
|
||||||
model.trigger('sync', model, resp, options);
|
model.trigger('sync', model, resp, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
options.error = Backbone.wrapError(options.error, model, options);
|
options.error = Backbone.wrapError(options.error, model, options);
|
||||||
var xhr = (this.sync || Backbone.sync).call(this, 'delete', this, options);
|
var xhr = (this.sync || Backbone.sync).call(this, 'delete', this, options);
|
||||||
if (!options.wait) triggerDestroy();
|
if (!options.wait) triggerDestroy();
|
||||||
|
@ -368,7 +434,7 @@
|
||||||
// using Backbone's restful methods, override this to change the endpoint
|
// using Backbone's restful methods, override this to change the endpoint
|
||||||
// that will be called.
|
// that will be called.
|
||||||
url: function() {
|
url: function() {
|
||||||
var base = getValue(this.collection, 'url') || getValue(this, 'urlRoot') || urlError();
|
var base = getValue(this, 'urlRoot') || getValue(this.collection, 'url') || urlError();
|
||||||
if (this.isNew()) return base;
|
if (this.isNew()) return base;
|
||||||
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
|
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
|
||||||
},
|
},
|
||||||
|
@ -393,18 +459,33 @@
|
||||||
// a `"change:attribute"` event for each changed attribute.
|
// a `"change:attribute"` event for each changed attribute.
|
||||||
// Calling this will cause all objects observing the model to update.
|
// Calling this will cause all objects observing the model to update.
|
||||||
change: function(options) {
|
change: function(options) {
|
||||||
if (this._changing || !this.hasChanged()) return this;
|
options || (options = {});
|
||||||
|
var changing = this._changing;
|
||||||
this._changing = true;
|
this._changing = true;
|
||||||
this._moreChanges = true;
|
|
||||||
for (var attr in this._changed) {
|
// Silent changes become pending changes.
|
||||||
this.trigger('change:' + attr, this, this._changed[attr], options);
|
for (var attr in this._silent) this._pending[attr] = true;
|
||||||
|
|
||||||
|
// Silent changes are triggered.
|
||||||
|
var changes = _.extend({}, options.changes, this._silent);
|
||||||
|
this._silent = {};
|
||||||
|
for (var attr in changes) {
|
||||||
|
this.trigger('change:' + attr, this, this.get(attr), options);
|
||||||
}
|
}
|
||||||
while (this._moreChanges) {
|
if (changing) return this;
|
||||||
this._moreChanges = false;
|
|
||||||
|
// Continue firing `"change"` events while there are pending changes.
|
||||||
|
while (!_.isEmpty(this._pending)) {
|
||||||
|
this._pending = {};
|
||||||
this.trigger('change', this, options);
|
this.trigger('change', this, options);
|
||||||
|
// Pending and silent changes still remain.
|
||||||
|
for (var attr in this.changed) {
|
||||||
|
if (this._pending[attr] || this._silent[attr]) continue;
|
||||||
|
delete this.changed[attr];
|
||||||
}
|
}
|
||||||
this._previousAttributes = _.clone(this.attributes);
|
this._previousAttributes = _.clone(this.attributes);
|
||||||
delete this._changed;
|
}
|
||||||
|
|
||||||
this._changing = false;
|
this._changing = false;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -412,8 +493,8 @@
|
||||||
// Determine if the model has changed since the last `"change"` event.
|
// Determine if the model has changed since the last `"change"` event.
|
||||||
// If you specify an attribute name, determine if that attribute has changed.
|
// If you specify an attribute name, determine if that attribute has changed.
|
||||||
hasChanged: function(attr) {
|
hasChanged: function(attr) {
|
||||||
if (!arguments.length) return !_.isEmpty(this._changed);
|
if (!arguments.length) return !_.isEmpty(this.changed);
|
||||||
return this._changed && _.has(this._changed, attr);
|
return _.has(this.changed, attr);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Return an object containing all the attributes that have changed, or
|
// Return an object containing all the attributes that have changed, or
|
||||||
|
@ -423,7 +504,7 @@
|
||||||
// You can also pass an attributes object to diff against the model,
|
// You can also pass an attributes object to diff against the model,
|
||||||
// determining if there *would be* a change.
|
// determining if there *would be* a change.
|
||||||
changedAttributes: function(diff) {
|
changedAttributes: function(diff) {
|
||||||
if (!diff) return this.hasChanged() ? _.clone(this._changed) : false;
|
if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
|
||||||
var val, changed = false, old = this._previousAttributes;
|
var val, changed = false, old = this._previousAttributes;
|
||||||
for (var attr in diff) {
|
for (var attr in diff) {
|
||||||
if (_.isEqual(old[attr], (val = diff[attr]))) continue;
|
if (_.isEqual(old[attr], (val = diff[attr]))) continue;
|
||||||
|
@ -451,9 +532,9 @@
|
||||||
return !this.validate(this.attributes);
|
return !this.validate(this.attributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Run validation against a set of incoming attributes, returning `true`
|
// Run validation against the next complete set of model attributes,
|
||||||
// if all is well. If a specific `error` callback has been passed,
|
// returning `true` if all is well. If a specific `error` callback has
|
||||||
// call that instead of firing the general `"error"` event.
|
// been passed, call that instead of firing the general `"error"` event.
|
||||||
_validate: function(attrs, options) {
|
_validate: function(attrs, options) {
|
||||||
if (options.silent || !this.validate) return true;
|
if (options.silent || !this.validate) return true;
|
||||||
attrs = _.extend({}, this.attributes, attrs);
|
attrs = _.extend({}, this.attributes, attrs);
|
||||||
|
@ -475,8 +556,9 @@
|
||||||
// Provides a standard collection class for our sets of models, ordered
|
// Provides a standard collection class for our sets of models, ordered
|
||||||
// or unordered. If a `comparator` is specified, the Collection will maintain
|
// or unordered. If a `comparator` is specified, the Collection will maintain
|
||||||
// its models in sort order, as they're added and removed.
|
// its models in sort order, as they're added and removed.
|
||||||
Backbone.Collection = function(models, options) {
|
var Collection = Backbone.Collection = function(models, options) {
|
||||||
options || (options = {});
|
options || (options = {});
|
||||||
|
if (options.model) this.model = options.model;
|
||||||
if (options.comparator) this.comparator = options.comparator;
|
if (options.comparator) this.comparator = options.comparator;
|
||||||
this._reset();
|
this._reset();
|
||||||
this.initialize.apply(this, arguments);
|
this.initialize.apply(this, arguments);
|
||||||
|
@ -484,11 +566,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
// Define the Collection's inheritable methods.
|
// Define the Collection's inheritable methods.
|
||||||
_.extend(Backbone.Collection.prototype, Backbone.Events, {
|
_.extend(Collection.prototype, Events, {
|
||||||
|
|
||||||
// The default model for a collection is just a **Backbone.Model**.
|
// The default model for a collection is just a **Backbone.Model**.
|
||||||
// This should be overridden in most cases.
|
// This should be overridden in most cases.
|
||||||
model: Backbone.Model,
|
model: Model,
|
||||||
|
|
||||||
// Initialize is an empty function by default. Override it with your own
|
// Initialize is an empty function by default. Override it with your own
|
||||||
// initialization logic.
|
// initialization logic.
|
||||||
|
@ -496,14 +578,14 @@
|
||||||
|
|
||||||
// The JSON representation of a Collection is an array of the
|
// The JSON representation of a Collection is an array of the
|
||||||
// models' attributes.
|
// models' attributes.
|
||||||
toJSON: function() {
|
toJSON: function(options) {
|
||||||
return this.map(function(model){ return model.toJSON(); });
|
return this.map(function(model){ return model.toJSON(options); });
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add a model, or list of models to the set. Pass **silent** to avoid
|
// Add a model, or list of models to the set. Pass **silent** to avoid
|
||||||
// firing the `add` event for every new model.
|
// firing the `add` event for every new model.
|
||||||
add: function(models, options) {
|
add: function(models, options) {
|
||||||
var i, index, length, model, cid, id, cids = {}, ids = {};
|
var i, index, length, model, cid, id, cids = {}, ids = {}, dups = [];
|
||||||
options || (options = {});
|
options || (options = {});
|
||||||
models = _.isArray(models) ? models.slice() : [models];
|
models = _.isArray(models) ? models.slice() : [models];
|
||||||
|
|
||||||
|
@ -513,16 +595,24 @@
|
||||||
if (!(model = models[i] = this._prepareModel(models[i], options))) {
|
if (!(model = models[i] = this._prepareModel(models[i], options))) {
|
||||||
throw new Error("Can't add an invalid model to a collection");
|
throw new Error("Can't add an invalid model to a collection");
|
||||||
}
|
}
|
||||||
if (cids[cid = model.cid] || this._byCid[cid] ||
|
cid = model.cid;
|
||||||
(((id = model.id) != null) && (ids[id] || this._byId[id]))) {
|
id = model.id;
|
||||||
throw new Error("Can't add the same model to a collection twice");
|
if (cids[cid] || this._byCid[cid] || ((id != null) && (ids[id] || this._byId[id]))) {
|
||||||
|
dups.push(i);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
cids[cid] = ids[id] = model;
|
cids[cid] = ids[id] = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove duplicates.
|
||||||
|
i = dups.length;
|
||||||
|
while (i--) {
|
||||||
|
models.splice(dups[i], 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Listen to added models' events, and index models for lookup by
|
// Listen to added models' events, and index models for lookup by
|
||||||
// `id` and by `cid`.
|
// `id` and by `cid`.
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0, length = models.length; i < length; i++) {
|
||||||
(model = models[i]).on('all', this._onModelEvent, this);
|
(model = models[i]).on('all', this._onModelEvent, this);
|
||||||
this._byCid[model.cid] = model;
|
this._byCid[model.cid] = model;
|
||||||
if (model.id != null) this._byId[model.id] = model;
|
if (model.id != null) this._byId[model.id] = model;
|
||||||
|
@ -566,9 +656,37 @@
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Add a model to the end of the collection.
|
||||||
|
push: function(model, options) {
|
||||||
|
model = this._prepareModel(model, options);
|
||||||
|
this.add(model, options);
|
||||||
|
return model;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Remove a model from the end of the collection.
|
||||||
|
pop: function(options) {
|
||||||
|
var model = this.at(this.length - 1);
|
||||||
|
this.remove(model, options);
|
||||||
|
return model;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add a model to the beginning of the collection.
|
||||||
|
unshift: function(model, options) {
|
||||||
|
model = this._prepareModel(model, options);
|
||||||
|
this.add(model, _.extend({at: 0}, options));
|
||||||
|
return model;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Remove a model from the beginning of the collection.
|
||||||
|
shift: function(options) {
|
||||||
|
var model = this.at(0);
|
||||||
|
this.remove(model, options);
|
||||||
|
return model;
|
||||||
|
},
|
||||||
|
|
||||||
// Get a model from the set by id.
|
// Get a model from the set by id.
|
||||||
get: function(id) {
|
get: function(id) {
|
||||||
if (id == null) return null;
|
if (id == null) return void 0;
|
||||||
return this._byId[id.id != null ? id.id : id];
|
return this._byId[id.id != null ? id.id : id];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -582,6 +700,17 @@
|
||||||
return this.models[index];
|
return this.models[index];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Return models with matching attributes. Useful for simple cases of `filter`.
|
||||||
|
where: function(attrs) {
|
||||||
|
if (_.isEmpty(attrs)) return [];
|
||||||
|
return this.filter(function(model) {
|
||||||
|
for (var key in attrs) {
|
||||||
|
if (attrs[key] !== model.get(key)) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// Force the collection to re-sort itself. You don't need to call this under
|
// Force the collection to re-sort itself. You don't need to call this under
|
||||||
// normal circumstances, as the set will maintain sort order as each item
|
// normal circumstances, as the set will maintain sort order as each item
|
||||||
// is added.
|
// is added.
|
||||||
|
@ -613,7 +742,7 @@
|
||||||
this._removeReference(this.models[i]);
|
this._removeReference(this.models[i]);
|
||||||
}
|
}
|
||||||
this._reset();
|
this._reset();
|
||||||
this.add(models, {silent: true, parse: options.parse});
|
this.add(models, _.extend({silent: true}, options));
|
||||||
if (!options.silent) this.trigger('reset', this, options);
|
if (!options.silent) this.trigger('reset', this, options);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -679,7 +808,8 @@
|
||||||
|
|
||||||
// Prepare a model or hash of attributes to be added to this collection.
|
// Prepare a model or hash of attributes to be added to this collection.
|
||||||
_prepareModel: function(model, options) {
|
_prepareModel: function(model, options) {
|
||||||
if (!(model instanceof Backbone.Model)) {
|
options || (options = {});
|
||||||
|
if (!(model instanceof Model)) {
|
||||||
var attrs = model;
|
var attrs = model;
|
||||||
options.collection = this;
|
options.collection = this;
|
||||||
model = new this.model(attrs, options);
|
model = new this.model(attrs, options);
|
||||||
|
@ -702,12 +832,12 @@
|
||||||
// Sets need to update their indexes when models change ids. All other
|
// Sets need to update their indexes when models change ids. All other
|
||||||
// events simply proxy through. "add" and "remove" events that originate
|
// events simply proxy through. "add" and "remove" events that originate
|
||||||
// in other collections are ignored.
|
// in other collections are ignored.
|
||||||
_onModelEvent: function(ev, model, collection, options) {
|
_onModelEvent: function(event, model, collection, options) {
|
||||||
if ((ev == 'add' || ev == 'remove') && collection != this) return;
|
if ((event == 'add' || event == 'remove') && collection != this) return;
|
||||||
if (ev == 'destroy') {
|
if (event == 'destroy') {
|
||||||
this.remove(model, options);
|
this.remove(model, options);
|
||||||
}
|
}
|
||||||
if (model && ev === 'change:' + model.idAttribute) {
|
if (model && event === 'change:' + model.idAttribute) {
|
||||||
delete this._byId[model.previous(model.idAttribute)];
|
delete this._byId[model.previous(model.idAttribute)];
|
||||||
this._byId[model.id] = model;
|
this._byId[model.id] = model;
|
||||||
}
|
}
|
||||||
|
@ -725,7 +855,7 @@
|
||||||
|
|
||||||
// Mix in each Underscore method as a proxy to `Collection#models`.
|
// Mix in each Underscore method as a proxy to `Collection#models`.
|
||||||
_.each(methods, function(method) {
|
_.each(methods, function(method) {
|
||||||
Backbone.Collection.prototype[method] = function() {
|
Collection.prototype[method] = function() {
|
||||||
return _[method].apply(_, [this.models].concat(_.toArray(arguments)));
|
return _[method].apply(_, [this.models].concat(_.toArray(arguments)));
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -735,7 +865,7 @@
|
||||||
|
|
||||||
// Routers map faux-URLs to actions, and fire events when routes are
|
// Routers map faux-URLs to actions, and fire events when routes are
|
||||||
// matched. Creating a new one sets its `routes` hash, if not set statically.
|
// matched. Creating a new one sets its `routes` hash, if not set statically.
|
||||||
Backbone.Router = function(options) {
|
var Router = Backbone.Router = function(options) {
|
||||||
options || (options = {});
|
options || (options = {});
|
||||||
if (options.routes) this.routes = options.routes;
|
if (options.routes) this.routes = options.routes;
|
||||||
this._bindRoutes();
|
this._bindRoutes();
|
||||||
|
@ -749,7 +879,7 @@
|
||||||
var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g;
|
var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g;
|
||||||
|
|
||||||
// Set up all inheritable **Backbone.Router** properties and methods.
|
// Set up all inheritable **Backbone.Router** properties and methods.
|
||||||
_.extend(Backbone.Router.prototype, Backbone.Events, {
|
_.extend(Router.prototype, Events, {
|
||||||
|
|
||||||
// Initialize is an empty function by default. Override it with your own
|
// Initialize is an empty function by default. Override it with your own
|
||||||
// initialization logic.
|
// initialization logic.
|
||||||
|
@ -762,7 +892,7 @@
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
route: function(route, name, callback) {
|
route: function(route, name, callback) {
|
||||||
Backbone.history || (Backbone.history = new Backbone.History);
|
Backbone.history || (Backbone.history = new History);
|
||||||
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
|
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
|
||||||
if (!callback) callback = this[name];
|
if (!callback) callback = this[name];
|
||||||
Backbone.history.route(route, _.bind(function(fragment) {
|
Backbone.history.route(route, _.bind(function(fragment) {
|
||||||
|
@ -815,7 +945,7 @@
|
||||||
|
|
||||||
// Handles cross-browser history management, based on URL fragments. If the
|
// Handles cross-browser history management, based on URL fragments. If the
|
||||||
// browser does not support `onhashchange`, falls back to polling.
|
// browser does not support `onhashchange`, falls back to polling.
|
||||||
Backbone.History = function() {
|
var History = Backbone.History = function() {
|
||||||
this.handlers = [];
|
this.handlers = [];
|
||||||
_.bindAll(this, 'checkUrl');
|
_.bindAll(this, 'checkUrl');
|
||||||
};
|
};
|
||||||
|
@ -827,15 +957,23 @@
|
||||||
var isExplorer = /msie [\w.]+/;
|
var isExplorer = /msie [\w.]+/;
|
||||||
|
|
||||||
// Has the history handling already been started?
|
// Has the history handling already been started?
|
||||||
var historyStarted = false;
|
History.started = false;
|
||||||
|
|
||||||
// Set up all inheritable **Backbone.History** properties and methods.
|
// Set up all inheritable **Backbone.History** properties and methods.
|
||||||
_.extend(Backbone.History.prototype, Backbone.Events, {
|
_.extend(History.prototype, Events, {
|
||||||
|
|
||||||
// The default interval to poll for hash changes, if necessary, is
|
// The default interval to poll for hash changes, if necessary, is
|
||||||
// twenty times a second.
|
// twenty times a second.
|
||||||
interval: 50,
|
interval: 50,
|
||||||
|
|
||||||
|
// Gets the true hash value. Cannot use location.hash directly due to bug
|
||||||
|
// in Firefox where location.hash will always be decoded.
|
||||||
|
getHash: function(windowOverride) {
|
||||||
|
var loc = windowOverride ? windowOverride.location : window.location;
|
||||||
|
var match = loc.href.match(/#(.*)$/);
|
||||||
|
return match ? match[1] : '';
|
||||||
|
},
|
||||||
|
|
||||||
// Get the cross-browser normalized URL fragment, either from the URL,
|
// Get the cross-browser normalized URL fragment, either from the URL,
|
||||||
// the hash, or the override.
|
// the hash, or the override.
|
||||||
getFragment: function(fragment, forcePushState) {
|
getFragment: function(fragment, forcePushState) {
|
||||||
|
@ -845,10 +983,9 @@
|
||||||
var search = window.location.search;
|
var search = window.location.search;
|
||||||
if (search) fragment += search;
|
if (search) fragment += search;
|
||||||
} else {
|
} else {
|
||||||
fragment = window.location.hash;
|
fragment = this.getHash();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fragment = decodeURIComponent(fragment);
|
|
||||||
if (!fragment.indexOf(this.options.root)) fragment = fragment.substr(this.options.root.length);
|
if (!fragment.indexOf(this.options.root)) fragment = fragment.substr(this.options.root.length);
|
||||||
return fragment.replace(routeStripper, '');
|
return fragment.replace(routeStripper, '');
|
||||||
},
|
},
|
||||||
|
@ -856,10 +993,11 @@
|
||||||
// Start the hash change handling, returning `true` if the current URL matches
|
// Start the hash change handling, returning `true` if the current URL matches
|
||||||
// an existing route, and `false` otherwise.
|
// an existing route, and `false` otherwise.
|
||||||
start: function(options) {
|
start: function(options) {
|
||||||
|
if (History.started) throw new Error("Backbone.history has already been started");
|
||||||
|
History.started = true;
|
||||||
|
|
||||||
// Figure out the initial configuration. Do we need an iframe?
|
// Figure out the initial configuration. Do we need an iframe?
|
||||||
// Is pushState desired ... is it available?
|
// Is pushState desired ... is it available?
|
||||||
if (historyStarted) throw new Error("Backbone.history has already been started");
|
|
||||||
this.options = _.extend({}, {root: '/'}, this.options, options);
|
this.options = _.extend({}, {root: '/'}, this.options, options);
|
||||||
this._wantsHashChange = this.options.hashChange !== false;
|
this._wantsHashChange = this.options.hashChange !== false;
|
||||||
this._wantsPushState = !!this.options.pushState;
|
this._wantsPushState = !!this.options.pushState;
|
||||||
|
@ -867,6 +1005,7 @@
|
||||||
var fragment = this.getFragment();
|
var fragment = this.getFragment();
|
||||||
var docMode = document.documentMode;
|
var docMode = document.documentMode;
|
||||||
var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
|
var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
|
||||||
|
|
||||||
if (oldIE) {
|
if (oldIE) {
|
||||||
this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
|
this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
|
||||||
this.navigate(fragment);
|
this.navigate(fragment);
|
||||||
|
@ -885,7 +1024,6 @@
|
||||||
// Determine if we need to change the base url, for a pushState link
|
// Determine if we need to change the base url, for a pushState link
|
||||||
// opened by a non-pushState browser.
|
// opened by a non-pushState browser.
|
||||||
this.fragment = fragment;
|
this.fragment = fragment;
|
||||||
historyStarted = true;
|
|
||||||
var loc = window.location;
|
var loc = window.location;
|
||||||
var atRoot = loc.pathname == this.options.root;
|
var atRoot = loc.pathname == this.options.root;
|
||||||
|
|
||||||
|
@ -900,7 +1038,7 @@
|
||||||
// Or if we've started out with a hash-based route, but we're currently
|
// Or if we've started out with a hash-based route, but we're currently
|
||||||
// in a browser where it could be `pushState`-based instead...
|
// in a browser where it could be `pushState`-based instead...
|
||||||
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
|
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
|
||||||
this.fragment = loc.hash.replace(routeStripper, '');
|
this.fragment = this.getHash().replace(routeStripper, '');
|
||||||
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);
|
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -914,7 +1052,7 @@
|
||||||
stop: function() {
|
stop: function() {
|
||||||
$(window).unbind('popstate', this.checkUrl).unbind('hashchange', this.checkUrl);
|
$(window).unbind('popstate', this.checkUrl).unbind('hashchange', this.checkUrl);
|
||||||
clearInterval(this._checkUrlInterval);
|
clearInterval(this._checkUrlInterval);
|
||||||
historyStarted = false;
|
History.started = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add a route to be tested when the fragment changes. Routes added later
|
// Add a route to be tested when the fragment changes. Routes added later
|
||||||
|
@ -927,10 +1065,10 @@
|
||||||
// calls `loadUrl`, normalizing across the hidden iframe.
|
// calls `loadUrl`, normalizing across the hidden iframe.
|
||||||
checkUrl: function(e) {
|
checkUrl: function(e) {
|
||||||
var current = this.getFragment();
|
var current = this.getFragment();
|
||||||
if (current == this.fragment && this.iframe) current = this.getFragment(this.iframe.location.hash);
|
if (current == this.fragment && this.iframe) current = this.getFragment(this.getHash(this.iframe));
|
||||||
if (current == this.fragment || current == decodeURIComponent(this.fragment)) return false;
|
if (current == this.fragment) return false;
|
||||||
if (this.iframe) this.navigate(current);
|
if (this.iframe) this.navigate(current);
|
||||||
this.loadUrl() || this.loadUrl(window.location.hash);
|
this.loadUrl() || this.loadUrl(this.getHash());
|
||||||
},
|
},
|
||||||
|
|
||||||
// Attempt to load the current URL fragment. If a route succeeds with a
|
// Attempt to load the current URL fragment. If a route succeeds with a
|
||||||
|
@ -953,12 +1091,12 @@
|
||||||
//
|
//
|
||||||
// The options object can contain `trigger: true` if you wish to have the
|
// The options object can contain `trigger: true` if you wish to have the
|
||||||
// route callback be fired (not usually desirable), or `replace: true`, if
|
// route callback be fired (not usually desirable), or `replace: true`, if
|
||||||
// you which to modify the current URL without adding an entry to the history.
|
// you wish to modify the current URL without adding an entry to the history.
|
||||||
navigate: function(fragment, options) {
|
navigate: function(fragment, options) {
|
||||||
if (!historyStarted) return false;
|
if (!History.started) return false;
|
||||||
if (!options || options === true) options = {trigger: options};
|
if (!options || options === true) options = {trigger: options};
|
||||||
var frag = (fragment || '').replace(routeStripper, '');
|
var frag = (fragment || '').replace(routeStripper, '');
|
||||||
if (this.fragment == frag || this.fragment == decodeURIComponent(frag)) return;
|
if (this.fragment == frag) return;
|
||||||
|
|
||||||
// If pushState is available, we use it to set the fragment as a real URL.
|
// If pushState is available, we use it to set the fragment as a real URL.
|
||||||
if (this._hasPushState) {
|
if (this._hasPushState) {
|
||||||
|
@ -971,7 +1109,7 @@
|
||||||
} else if (this._wantsHashChange) {
|
} else if (this._wantsHashChange) {
|
||||||
this.fragment = frag;
|
this.fragment = frag;
|
||||||
this._updateHash(window.location, frag, options.replace);
|
this._updateHash(window.location, frag, options.replace);
|
||||||
if (this.iframe && (frag != this.getFragment(this.iframe.location.hash))) {
|
if (this.iframe && (frag != this.getFragment(this.getHash(this.iframe)))) {
|
||||||
// Opening and closing the iframe tricks IE7 and earlier to push a history entry on hash-tag change.
|
// Opening and closing the iframe tricks IE7 and earlier to push a history entry on hash-tag change.
|
||||||
// When replace is true, we don't want this.
|
// When replace is true, we don't want this.
|
||||||
if(!options.replace) this.iframe.document.open().close();
|
if(!options.replace) this.iframe.document.open().close();
|
||||||
|
@ -1002,7 +1140,7 @@
|
||||||
|
|
||||||
// Creating a Backbone.View creates its initial element outside of the DOM,
|
// Creating a Backbone.View creates its initial element outside of the DOM,
|
||||||
// if an existing element is not provided...
|
// if an existing element is not provided...
|
||||||
Backbone.View = function(options) {
|
var View = Backbone.View = function(options) {
|
||||||
this.cid = _.uniqueId('view');
|
this.cid = _.uniqueId('view');
|
||||||
this._configure(options || {});
|
this._configure(options || {});
|
||||||
this._ensureElement();
|
this._ensureElement();
|
||||||
|
@ -1011,13 +1149,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
// Cached regex to split keys for `delegate`.
|
// Cached regex to split keys for `delegate`.
|
||||||
var eventSplitter = /^(\S+)\s*(.*)$/;
|
var delegateEventSplitter = /^(\S+)\s*(.*)$/;
|
||||||
|
|
||||||
// List of view options to be merged as properties.
|
// List of view options to be merged as properties.
|
||||||
var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName'];
|
var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName'];
|
||||||
|
|
||||||
// Set up all inheritable **Backbone.View** properties and methods.
|
// Set up all inheritable **Backbone.View** properties and methods.
|
||||||
_.extend(Backbone.View.prototype, Backbone.Events, {
|
_.extend(View.prototype, Events, {
|
||||||
|
|
||||||
// The default `tagName` of a View's element is `"div"`.
|
// The default `tagName` of a View's element is `"div"`.
|
||||||
tagName: 'div',
|
tagName: 'div',
|
||||||
|
@ -1061,7 +1199,8 @@
|
||||||
// Change the view's element (`this.el` property), including event
|
// Change the view's element (`this.el` property), including event
|
||||||
// re-delegation.
|
// re-delegation.
|
||||||
setElement: function(element, delegate) {
|
setElement: function(element, delegate) {
|
||||||
this.$el = $(element);
|
if (this.$el) this.undelegateEvents();
|
||||||
|
this.$el = (element instanceof $) ? element : $(element);
|
||||||
this.el = this.$el[0];
|
this.el = this.$el[0];
|
||||||
if (delegate !== false) this.delegateEvents();
|
if (delegate !== false) this.delegateEvents();
|
||||||
return this;
|
return this;
|
||||||
|
@ -1088,8 +1227,8 @@
|
||||||
for (var key in events) {
|
for (var key in events) {
|
||||||
var method = events[key];
|
var method = events[key];
|
||||||
if (!_.isFunction(method)) method = this[events[key]];
|
if (!_.isFunction(method)) method = this[events[key]];
|
||||||
if (!method) throw new Error('Event "' + events[key] + '" does not exist');
|
if (!method) throw new Error('Method "' + events[key] + '" does not exist');
|
||||||
var match = key.match(eventSplitter);
|
var match = key.match(delegateEventSplitter);
|
||||||
var eventName = match[1], selector = match[2];
|
var eventName = match[1], selector = match[2];
|
||||||
method = _.bind(method, this);
|
method = _.bind(method, this);
|
||||||
eventName += '.delegateEvents' + this.cid;
|
eventName += '.delegateEvents' + this.cid;
|
||||||
|
@ -1145,8 +1284,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set up inheritance for the model, collection, and view.
|
// Set up inheritance for the model, collection, and view.
|
||||||
Backbone.Model.extend = Backbone.Collection.extend =
|
Model.extend = Collection.extend = Router.extend = View.extend = extend;
|
||||||
Backbone.Router.extend = Backbone.View.extend = extend;
|
|
||||||
|
|
||||||
// Backbone.sync
|
// Backbone.sync
|
||||||
// -------------
|
// -------------
|
||||||
|
@ -1177,6 +1315,9 @@
|
||||||
Backbone.sync = function(method, model, options) {
|
Backbone.sync = function(method, model, options) {
|
||||||
var type = methodMap[method];
|
var type = methodMap[method];
|
||||||
|
|
||||||
|
// Default options, unless specified.
|
||||||
|
options || (options = {});
|
||||||
|
|
||||||
// Default JSON-request options.
|
// Default JSON-request options.
|
||||||
var params = {type: type, dataType: 'json'};
|
var params = {type: type, dataType: 'json'};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@charset "UTF-8";
|
@charset "utf-8";
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "mnmliconsRegular";
|
font-family: "mnmliconsRegular";
|
||||||
src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot");
|
src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot");
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
|
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
|
||||||
/* http://www.quirksmode.org/dom/inputfile.html
|
/* http://www.quirksmode.org/dom/inputfile.html
|
||||||
* http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
|
* http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
|
||||||
*/
|
*/ */
|
||||||
}
|
}
|
||||||
.openerp :-moz-placeholder {
|
.openerp :-moz-placeholder {
|
||||||
color: #afafb6 !important;
|
color: #afafb6 !important;
|
||||||
|
@ -581,6 +581,9 @@
|
||||||
background: #8786b7;
|
background: #8786b7;
|
||||||
color: #eeeeee;
|
color: #eeeeee;
|
||||||
}
|
}
|
||||||
|
.openerp .oe_tags.oe_inline {
|
||||||
|
min-width: 250px;
|
||||||
|
}
|
||||||
.openerp .oe_tags .text-wrap {
|
.openerp .oe_tags .text-wrap {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
@charset "utf-8"
|
@charset "utf-8"
|
||||||
|
|
||||||
// Variables {{{
|
// Variables {{{
|
||||||
|
$facets-border: #afafb6
|
||||||
$section-title-color: #8786b7
|
$section-title-color: #8786b7
|
||||||
$tag-bg-light: #f0f0fa
|
$tag-bg-light: #f0f0fa
|
||||||
$tag-bg-dark: #8786b7
|
$tag-bg-dark: #8786b7
|
||||||
|
@ -470,6 +471,8 @@ $sheet-max-width: 860px
|
||||||
color: #eee
|
color: #eee
|
||||||
|
|
||||||
.oe_tags
|
.oe_tags
|
||||||
|
&.oe_inline
|
||||||
|
min-width: 250px
|
||||||
.text-wrap
|
.text-wrap
|
||||||
width: 100% !important
|
width: 100% !important
|
||||||
textarea
|
textarea
|
||||||
|
|
|
@ -37,8 +37,11 @@
|
||||||
};
|
};
|
||||||
openerp.instances[new_instance._session_id] = new_instance;
|
openerp.instances[new_instance._session_id] = new_instance;
|
||||||
for(var i=0; i < modules.length; i++) {
|
for(var i=0; i < modules.length; i++) {
|
||||||
|
new_instance[modules[i]] = {};
|
||||||
|
if (openerp[modules[i]]) {
|
||||||
openerp[modules[i]](new_instance,new_instance[modules[i]]);
|
openerp[modules[i]](new_instance,new_instance[modules[i]]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return new_instance;
|
return new_instance;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -66,9 +66,9 @@ instance.web.Dialog = instance.web.Widget.extend({
|
||||||
max_width: '95%',
|
max_width: '95%',
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
min_height: 0,
|
min_height: 0,
|
||||||
max_height: this.get_height('100%') - 140,
|
max_height: this.get_height('100%') - 200,
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
position: [false, 50],
|
position: [false, 40],
|
||||||
buttons: {},
|
buttons: {},
|
||||||
beforeClose: function () { self.on_close(); },
|
beforeClose: function () { self.on_close(); },
|
||||||
resizeStop: this.on_resized
|
resizeStop: this.on_resized
|
||||||
|
@ -193,7 +193,7 @@ instance.web.CrashManager = instance.web.CallbackEnabled.extend({
|
||||||
on_traceback: function(error) {
|
on_traceback: function(error) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var buttons = {};
|
var buttons = {};
|
||||||
if (instance.connection.openerp_entreprise) {
|
if (instance.session.openerp_entreprise) {
|
||||||
buttons[_t("Send OpenERP Enterprise Report")] = function() {
|
buttons[_t("Send OpenERP Enterprise Report")] = function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var issuename = $('#issuename').val();
|
var issuename = $('#issuename').val();
|
||||||
|
@ -224,7 +224,7 @@ instance.web.CrashManager = instance.web.CallbackEnabled.extend({
|
||||||
min_height: '600px',
|
min_height: '600px',
|
||||||
buttons: buttons
|
buttons: buttons
|
||||||
}).open();
|
}).open();
|
||||||
dialog.$element.html(QWeb.render('CrashManager.error', {session: instance.connection, error: error}));
|
dialog.$element.html(QWeb.render('CrashManager.error', {session: instance.session, error: error}));
|
||||||
},
|
},
|
||||||
on_javascript_exception: function(exception) {
|
on_javascript_exception: function(exception) {
|
||||||
this.on_traceback({
|
this.on_traceback({
|
||||||
|
@ -269,7 +269,7 @@ instance.web.Loading = instance.web.Widget.extend({
|
||||||
|
|
||||||
this.count += increment;
|
this.count += increment;
|
||||||
if (this.count > 0) {
|
if (this.count > 0) {
|
||||||
if (instance.connection.debug) {
|
if (instance.session.debug) {
|
||||||
this.$element.text(_.str.sprintf( _t("Loading (%d)"), this.count));
|
this.$element.text(_.str.sprintf( _t("Loading (%d)"), this.count));
|
||||||
} else {
|
} else {
|
||||||
this.$element.text(_t("Loading"));
|
this.$element.text(_t("Loading"));
|
||||||
|
@ -300,6 +300,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
$('.oe_secondary_menus_container,.oe_user_menu_placeholder').empty();
|
||||||
var fetch_db = this.rpc("/web/database/get_list", {}).pipe(
|
var fetch_db = this.rpc("/web/database/get_list", {}).pipe(
|
||||||
function(result) {
|
function(result) {
|
||||||
self.db_list = result.db_list;
|
self.db_list = result.db_list;
|
||||||
|
@ -315,12 +316,22 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
||||||
},
|
},
|
||||||
do_render: function() {
|
do_render: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
instance.webclient.toggle_bars(true);
|
||||||
self.$element.html(QWeb.render("DatabaseManager", { widget : self }));
|
self.$element.html(QWeb.render("DatabaseManager", { widget : self }));
|
||||||
self.$element.find(".oe_database_manager_menu").tabs({
|
$('.oe_user_menu_placeholder').append(QWeb.render("DatabaseManager.user_menu",{ widget : self }));
|
||||||
show: function(event, ui) {
|
$('.oe_secondary_menus_container').append(QWeb.render("DatabaseManager.menu",{ widget : self }));
|
||||||
$('*[autofocus]:first', ui.panel).focus();
|
$('ul.oe_secondary_submenu > li:first').addClass('oe_active')
|
||||||
}
|
$('ul.oe_secondary_submenu > li').bind('click', function (event) {
|
||||||
|
var menuitem = $(this);
|
||||||
|
menuitem.addClass('oe_active').siblings().removeClass('oe_active');
|
||||||
|
var form_id =menuitem.find('a').attr('href');
|
||||||
|
$(form_id).show().siblings().hide();
|
||||||
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
$('#back-to-login').click(self.do_exit);
|
||||||
|
self.$element.find("td").addClass("oe_form_group_cell");
|
||||||
|
self.$element.find("tr td:first-child").addClass("oe_form_group_cell_label");
|
||||||
|
self.$element.find("label").addClass("oe_form_label");
|
||||||
self.$element.find("form[name=create_db_form]").validate({ submitHandler: self.do_create });
|
self.$element.find("form[name=create_db_form]").validate({ submitHandler: self.do_create });
|
||||||
self.$element.find("form[name=drop_db_form]").validate({ submitHandler: self.do_drop });
|
self.$element.find("form[name=drop_db_form]").validate({ submitHandler: self.do_drop });
|
||||||
self.$element.find("form[name=backup_db_form]").validate({ submitHandler: self.do_backup });
|
self.$element.find("form[name=backup_db_form]").validate({ submitHandler: self.do_backup });
|
||||||
|
@ -336,7 +347,6 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
||||||
},
|
},
|
||||||
submitHandler: self.do_change_password
|
submitHandler: self.do_change_password
|
||||||
});
|
});
|
||||||
self.$element.find("#back_to_login").click(self.do_exit);
|
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
this.$element.find('#db-create, #db-drop, #db-backup, #db-restore, #db-change-password, #back-to-login').unbind('click').end().empty();
|
this.$element.find('#db-create, #db-drop, #db-backup, #db-restore, #db-change-password, #back-to-login').unbind('click').end().empty();
|
||||||
|
@ -407,7 +417,6 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
||||||
};
|
};
|
||||||
self.do_action(client_action);
|
self.do_action(client_action);
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
do_drop: function(form) {
|
do_drop: function(form) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -486,11 +495,14 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
||||||
self.display_error(result);
|
self.display_error(result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
self.unblockUI();
|
||||||
self.do_notify("Changed Password", "Password has been changed successfully");
|
self.do_notify("Changed Password", "Password has been changed successfully");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
do_exit: function () {
|
do_exit: function () {
|
||||||
this.do_action("login");
|
this.$element.remove();
|
||||||
|
instance.webclient.toggle_bars(false);
|
||||||
|
this.do_action('login');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
instance.web.client_actions.add("database_manager", "instance.web.DatabaseManager");
|
instance.web.client_actions.add("database_manager", "instance.web.DatabaseManager");
|
||||||
|
@ -498,11 +510,11 @@ instance.web.client_actions.add("database_manager", "instance.web.DatabaseManage
|
||||||
instance.web.Login = instance.web.Widget.extend({
|
instance.web.Login = instance.web.Widget.extend({
|
||||||
template: "Login",
|
template: "Login",
|
||||||
remember_credentials: true,
|
remember_credentials: true,
|
||||||
_db_list: null,
|
|
||||||
|
|
||||||
init: function(parent, params) {
|
init: function(parent, params) {
|
||||||
this._super(parent);
|
this._super(parent);
|
||||||
this.has_local_storage = typeof(localStorage) != 'undefined';
|
this.has_local_storage = typeof(localStorage) != 'undefined';
|
||||||
|
this.db_list = null;
|
||||||
this.selected_db = null;
|
this.selected_db = null;
|
||||||
this.selected_login = null;
|
this.selected_login = null;
|
||||||
this.params = params || {};
|
this.params = params || {};
|
||||||
|
@ -525,50 +537,41 @@ instance.web.Login = instance.web.Widget.extend({
|
||||||
self.$element.find('.oe_login_manage_db').click(function() {
|
self.$element.find('.oe_login_manage_db').click(function() {
|
||||||
self.do_action("database_manager");
|
self.do_action("database_manager");
|
||||||
});
|
});
|
||||||
return self.load_db_list().then(self.on_db_list_loaded).then(function() {
|
var d;
|
||||||
if (self.params.db) {
|
if (self.params.db) {
|
||||||
self.do_login(self.params.db, self.params.login, self.params.password);
|
d = self.do_login(self.params.db, self.params.login, self.params.password);
|
||||||
}
|
} else {
|
||||||
});
|
d = self.rpc("/web/database/get_list", {}).done(self.on_db_loaded).fail(self.on_db_failed);
|
||||||
},
|
|
||||||
load_db_list: function (force) {
|
|
||||||
var d = $.when(), self = this;
|
|
||||||
if (_.isNull(this._db_list) || force) {
|
|
||||||
d = self.rpc("/web/database/get_list", {}, function(result) {
|
|
||||||
self._db_list = _.clone(result.db_list);
|
|
||||||
}, function(error, event) {
|
|
||||||
if (error.data.fault_code === 'AccessDenied') {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return d;
|
return d;
|
||||||
},
|
},
|
||||||
on_db_list_loaded: function () {
|
on_db_loaded: function (result) {
|
||||||
var self = this;
|
this.db_list = result.db_list;
|
||||||
var list = this._db_list;
|
this.$("[name=db]").replaceWith(QWeb.render('Login.dblist', { db_list: this.db_list, selected_db: this.selected_db}));
|
||||||
var dbdiv = this.$element.find('div.oe_login_dbpane');
|
if(this.db_list.length === 0) {
|
||||||
this.$element.find("[name=db]").replaceWith(instance.web.qweb.render('Login.dblist', { db_list: list, selected_db: this.selected_db}));
|
|
||||||
if(list.length === 0) {
|
|
||||||
this.do_action("database_manager");
|
this.do_action("database_manager");
|
||||||
} else if(list && list.length === 1) {
|
} else if(this.db_list.length === 1) {
|
||||||
dbdiv.hide();
|
this.$('div.oe_login_dbpane').hide();
|
||||||
} else {
|
} else {
|
||||||
dbdiv.show();
|
this.$('div.oe_login_dbpane').show();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
on_db_failed: function (error, event) {
|
||||||
|
if (error.data.fault_code === 'AccessDenied') {
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
on_submit: function(ev) {
|
on_submit: function(ev) {
|
||||||
if(ev) {
|
if(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
}
|
}
|
||||||
var $e = this.$element;
|
var db = this.$("form [name=db]").val();
|
||||||
var db = $e.find("form [name=db]").val();
|
|
||||||
if (!db) {
|
if (!db) {
|
||||||
this.do_warn("Login", "No database selected !");
|
this.do_warn("Login", "No database selected !");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var login = $e.find("form input[name=login]").val();
|
var login = this.$("form input[name=login]").val();
|
||||||
var password = $e.find("form input[name=password]").val();
|
var password = this.$("form input[name=password]").val();
|
||||||
|
|
||||||
this.do_login(db, login, password);
|
this.do_login(db, login, password);
|
||||||
},
|
},
|
||||||
|
@ -599,16 +602,11 @@ instance.web.Login = instance.web.Widget.extend({
|
||||||
}
|
}
|
||||||
self.trigger('login_successful');
|
self.trigger('login_successful');
|
||||||
},function () {
|
},function () {
|
||||||
self.$(".oe_login_pane").fadeIn("fast");
|
self.$(".oe_login_pane").fadeIn("fast", function() {
|
||||||
self.$element.addClass("oe_login_invalid");
|
self.$element.addClass("oe_login_invalid");
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
show: function () {
|
|
||||||
this.$element.show();
|
|
||||||
},
|
|
||||||
hide: function () {
|
|
||||||
this.$element.hide();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
instance.web.client_actions.add("login", "instance.web.Login");
|
instance.web.client_actions.add("login", "instance.web.Login");
|
||||||
|
|
||||||
|
@ -623,11 +621,11 @@ instance.web.Reload = instance.web.Widget.extend({
|
||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
var l = window.location;
|
var l = window.location;
|
||||||
var timestamp = new Date().getTime();
|
|
||||||
var search = "?ts=" + timestamp;
|
var sobj = $.deparam(l.search.substr(1));
|
||||||
if (l.search) {
|
sobj.ts = new Date().getTime();
|
||||||
search = l.search + "&ts=" + timestamp;
|
var search = '?' + $.param(sobj);
|
||||||
}
|
|
||||||
var hash = l.hash;
|
var hash = l.hash;
|
||||||
if (this.menu_id) {
|
if (this.menu_id) {
|
||||||
hash = "#menu_id=" + this.menu_id;
|
hash = "#menu_id=" + this.menu_id;
|
||||||
|
@ -665,7 +663,7 @@ instance.web.ChangePassword = instance.web.Widget.extend({
|
||||||
template: "ChangePassword",
|
template: "ChangePassword",
|
||||||
start: function() {
|
start: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.$element.find("form[name=change_password_form]").validate({
|
self.$element.validate({
|
||||||
submitHandler: function (form) {
|
submitHandler: function (form) {
|
||||||
self.rpc("/web/session/change_password",{
|
self.rpc("/web/session/change_password",{
|
||||||
'fields': $(form).serializeArray()
|
'fields': $(form).serializeArray()
|
||||||
|
@ -685,7 +683,7 @@ instance.web.ChangePassword = instance.web.Widget.extend({
|
||||||
modal: true,
|
modal: true,
|
||||||
title: error.title,
|
title: error.title,
|
||||||
buttons: [
|
buttons: [
|
||||||
{text: _("Ok"), click: function() { $(this).dialog("close"); }}
|
{text: _t("Ok"), click: function() { $(this).dialog("close"); }}
|
||||||
]
|
]
|
||||||
}).html(error.error);
|
}).html(error.error);
|
||||||
},
|
},
|
||||||
|
@ -869,8 +867,8 @@ instance.web.UserMenu = instance.web.Widget.extend({
|
||||||
var func = new instance.web.Model("res.users").get_func("read");
|
var func = new instance.web.Model("res.users").get_func("read");
|
||||||
return func(self.session.uid, ["name", "company_id"]).pipe(function(res) {
|
return func(self.session.uid, ["name", "company_id"]).pipe(function(res) {
|
||||||
var topbar_name = res.name;
|
var topbar_name = res.name;
|
||||||
if(instance.connection.debug)
|
if(instance.session.debug)
|
||||||
topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.connection.db);
|
topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.session.db);
|
||||||
if(res.company_id[0] > 1)
|
if(res.company_id[0] > 1)
|
||||||
topbar_name = _.str.sprintf("%s (%s)", topbar_name, res.company_id[1]);
|
topbar_name = _.str.sprintf("%s (%s)", topbar_name, res.company_id[1]);
|
||||||
self.$element.find('.oe_topbar_name').text(topbar_name);
|
self.$element.find('.oe_topbar_name').text(topbar_name);
|
||||||
|
@ -887,7 +885,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
|
||||||
on_menu_settings: function() {
|
on_menu_settings: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.rpc("/web/action/load", { action_id: "base.action_res_users_my" }, function(result) {
|
self.rpc("/web/action/load", { action_id: "base.action_res_users_my" }, function(result) {
|
||||||
result.result.res_id = instance.connection.uid;
|
result.result.res_id = instance.session.uid;
|
||||||
self.getParent().action_manager.do_action(result.result);
|
self.getParent().action_manager.do_action(result.result);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -914,7 +912,7 @@ instance.web.Client = instance.web.Widget.extend({
|
||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
return instance.connection.session_bind(this.origin).pipe(function() {
|
return instance.session.session_bind(this.origin).pipe(function() {
|
||||||
var $e = $(QWeb.render(self._template, {}));
|
var $e = $(QWeb.render(self._template, {}));
|
||||||
self.replaceElement($e);
|
self.replaceElement($e);
|
||||||
self.bind_events();
|
self.bind_events();
|
||||||
|
@ -950,14 +948,14 @@ instance.web.Client = instance.web.Widget.extend({
|
||||||
instance.web.bus.on('click', this, function(ev) {
|
instance.web.bus.on('click', this, function(ev) {
|
||||||
$.fn.tipsy.clear();
|
$.fn.tipsy.clear();
|
||||||
if (!$(ev.target).is('input[type=file]')) {
|
if (!$(ev.target).is('input[type=file]')) {
|
||||||
self.$element.find('.oe_dropdown_menu.oe_opened').removeClass('oe_opened');
|
self.$element.find('.oe_dropdown_menu.oe_opened, .oe_dropdown_toggle.oe_opened').removeClass('oe_opened');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
show_common: function() {
|
show_common: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.crashmanager = new instance.web.CrashManager();
|
this.crashmanager = new instance.web.CrashManager();
|
||||||
instance.connection.on_rpc_error.add(this.crashmanager.on_rpc_error);
|
instance.session.on_rpc_error.add(this.crashmanager.on_rpc_error);
|
||||||
self.notification = new instance.web.Notification(this);
|
self.notification = new instance.web.Notification(this);
|
||||||
self.notification.appendTo(self.$element);
|
self.notification.appendTo(self.$element);
|
||||||
self.loading = new instance.web.Loading(self);
|
self.loading = new instance.web.Loading(self);
|
||||||
|
@ -965,6 +963,9 @@ instance.web.Client = instance.web.Widget.extend({
|
||||||
self.action_manager = new instance.web.ActionManager(self);
|
self.action_manager = new instance.web.ActionManager(self);
|
||||||
self.action_manager.appendTo(self.$('.oe_application'));
|
self.action_manager.appendTo(self.$('.oe_application'));
|
||||||
},
|
},
|
||||||
|
toggle_bars: function(value) {
|
||||||
|
this.$('tr:has(td.oe_topbar),.oe_leftbar').toggle(value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web.WebClient = instance.web.Client.extend({
|
instance.web.WebClient = instance.web.Client.extend({
|
||||||
|
@ -1006,13 +1007,27 @@ instance.web.WebClient = instance.web.Client.extend({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
show_login: function() {
|
show_login: function() {
|
||||||
this.$('.oe_topbar').hide();
|
this.toggle_bars(false);
|
||||||
this.action_manager.do_action("login");
|
|
||||||
this.action_manager.inner_widget.on('login_successful', this, this.show_application);
|
var action = {
|
||||||
|
'type': 'ir.actions.client',
|
||||||
|
'tag': 'login'
|
||||||
|
};
|
||||||
|
var state = $.bbq.getState(true);
|
||||||
|
if (state.action === "login") {
|
||||||
|
action.params = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.action_manager.do_action(action);
|
||||||
|
this.action_manager.inner_widget.on('login_successful', this, function() {
|
||||||
|
this.do_push_state(state);
|
||||||
|
this._current_state = null; // ensure the state will be loaded
|
||||||
|
this.show_application(); // will load the state we just pushed
|
||||||
|
});
|
||||||
},
|
},
|
||||||
show_application: function() {
|
show_application: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.$('.oe_topbar').show();
|
self.toggle_bars(true);
|
||||||
self.menu = new instance.web.Menu(self);
|
self.menu = new instance.web.Menu(self);
|
||||||
self.menu.replace(this.$element.find('.oe_menu_placeholder'));
|
self.menu.replace(this.$element.find('.oe_menu_placeholder'));
|
||||||
self.menu.on('menu_click', this, this.on_menu_action);
|
self.menu.on('menu_click', this, this.on_menu_action);
|
||||||
|
@ -1037,7 +1052,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
||||||
do_reload: function() {
|
do_reload: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
return this.session.session_reload().pipe(function () {
|
return this.session.session_reload().pipe(function () {
|
||||||
instance.connection.load_modules(true).pipe(
|
instance.session.load_modules(true).pipe(
|
||||||
self.menu.proxy('do_reload')); });
|
self.menu.proxy('do_reload')); });
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -1054,8 +1069,6 @@ instance.web.WebClient = instance.web.Client.extend({
|
||||||
this.session.session_logout().then(function () {
|
this.session.session_logout().then(function () {
|
||||||
$(window).unbind('hashchange', self.on_hashchange);
|
$(window).unbind('hashchange', self.on_hashchange);
|
||||||
self.do_push_state({});
|
self.do_push_state({});
|
||||||
//would be cool to be able to do this, but I think it will make addons do strange things
|
|
||||||
//this.show_login();
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1144,7 +1157,7 @@ instance.web.EmbeddedClient = instance.web.Client.extend({
|
||||||
start: function() {
|
start: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
return $.when(this._super()).pipe(function() {
|
return $.when(this._super()).pipe(function() {
|
||||||
return instance.connection.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() {
|
return instance.session.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() {
|
||||||
return self.rpc("/web/action/load", { action_id: self.action_id }, function(result) {
|
return self.rpc("/web/action/load", { action_id: self.action_id }, function(result) {
|
||||||
var action = result.result;
|
var action = result.result;
|
||||||
action.flags = _.extend({
|
action.flags = _.extend({
|
||||||
|
|
|
@ -692,7 +692,7 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, {
|
||||||
instance.web.WidgetMixin.init.call(this,parent);
|
instance.web.WidgetMixin.init.call(this,parent);
|
||||||
// FIXME: this should not be
|
// FIXME: this should not be
|
||||||
this.setElement(this._make_descriptive());
|
this.setElement(this._make_descriptive());
|
||||||
this.session = instance.connection;
|
this.session = instance.session;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Renders the element. The default implementation renders the widget using QWeb,
|
* Renders the element. The default implementation renders the widget using QWeb,
|
||||||
|
@ -841,7 +841,7 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, {
|
||||||
rpc: function(url, data, success, error) {
|
rpc: function(url, data, success, error) {
|
||||||
var def = $.Deferred().then(success, error);
|
var def = $.Deferred().then(success, error);
|
||||||
var self = this;
|
var self = this;
|
||||||
instance.connection.rpc(url, data). then(function() {
|
instance.session.rpc(url, data). then(function() {
|
||||||
if (!self.isDestroyed())
|
if (!self.isDestroyed())
|
||||||
def.resolve.apply(def, arguments);
|
def.resolve.apply(def, arguments);
|
||||||
}, function() {
|
}, function() {
|
||||||
|
@ -863,7 +863,7 @@ instance.web.Registry = instance.web.Class.extend({
|
||||||
*
|
*
|
||||||
* An object path is simply a dotted name from the instance root to the
|
* An object path is simply a dotted name from the instance root to the
|
||||||
* object pointed to (e.g. ``"instance.web.Session"`` for an OpenERP
|
* object pointed to (e.g. ``"instance.web.Session"`` for an OpenERP
|
||||||
* connection object).
|
* session object).
|
||||||
*
|
*
|
||||||
* @constructs instance.web.Registry
|
* @constructs instance.web.Registry
|
||||||
* @param {Object} mapping a mapping of keys to object-paths
|
* @param {Object} mapping a mapping of keys to object-paths
|
||||||
|
|
|
@ -11,32 +11,6 @@ if (!console.debug) {
|
||||||
|
|
||||||
openerp.web.coresetup = function(instance) {
|
openerp.web.coresetup = function(instance) {
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use :class:`instance.web.Widget`
|
|
||||||
*/
|
|
||||||
instance.web.OldWidget = instance.web.Widget.extend({
|
|
||||||
init: function(parent, element_id) {
|
|
||||||
this._super(parent);
|
|
||||||
this.element_id = element_id;
|
|
||||||
this.element_id = this.element_id || _.uniqueId('widget-');
|
|
||||||
|
|
||||||
var tmp = document.getElementById(this.element_id);
|
|
||||||
this.setElement(tmp || this._make_descriptive());
|
|
||||||
},
|
|
||||||
renderElement: function() {
|
|
||||||
var rendered = this.render();
|
|
||||||
if (rendered) {
|
|
||||||
this.replaceElement($(rendered));
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
render: function (additional) {
|
|
||||||
if (this.template)
|
|
||||||
return instance.web.qweb.render(this.template, _.extend({widget: this}, additional || {}));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/** Session openerp specific RPC class */
|
/** Session openerp specific RPC class */
|
||||||
instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Session# */{
|
instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Session# */{
|
||||||
init: function() {
|
init: function() {
|
||||||
|
@ -540,7 +514,7 @@ $.async_when = function() {
|
||||||
// special tweak for the web client
|
// special tweak for the web client
|
||||||
var old_async_when = $.async_when;
|
var old_async_when = $.async_when;
|
||||||
$.async_when = function() {
|
$.async_when = function() {
|
||||||
if (instance.connection.synch)
|
if (instance.session.synch)
|
||||||
return $.when.apply(this, arguments);
|
return $.when.apply(this, arguments);
|
||||||
else
|
else
|
||||||
return old_async_when.apply(this, arguments);
|
return old_async_when.apply(this, arguments);
|
||||||
|
@ -549,14 +523,14 @@ $.async_when = function() {
|
||||||
/** Setup blockui */
|
/** Setup blockui */
|
||||||
if ($.blockUI) {
|
if ($.blockUI) {
|
||||||
$.blockUI.defaults.baseZ = 1100;
|
$.blockUI.defaults.baseZ = 1100;
|
||||||
$.blockUI.defaults.message = '<div class="oe_blockui_spin" style="height: 50px">';
|
$.blockUI.defaults.message = '<div class="oe_blockui_spin_container">';
|
||||||
$.blockUI.defaults.css.border = '0';
|
$.blockUI.defaults.css.border = '0';
|
||||||
$.blockUI.defaults.css["background-color"] = '';
|
$.blockUI.defaults.css["background-color"] = '';
|
||||||
$.blockUI.spinners = [];
|
|
||||||
}
|
}
|
||||||
instance.web.blockUI = function() {
|
|
||||||
var tmp = $.blockUI.apply($, arguments);
|
instance.web.Throbber = instance.web.Widget.extend({
|
||||||
var target = $(".oe_blockui_spin")[0];
|
template: "Throbber",
|
||||||
|
start: function() {
|
||||||
var opts = {
|
var opts = {
|
||||||
lines: 13, // The number of lines to draw
|
lines: 13, // The number of lines to draw
|
||||||
length: 7, // The length of each line
|
length: 7, // The length of each line
|
||||||
|
@ -573,19 +547,32 @@ instance.web.blockUI = function() {
|
||||||
top: 'auto', // Top position relative to parent in px
|
top: 'auto', // Top position relative to parent in px
|
||||||
left: 'auto' // Left position relative to parent in px
|
left: 'auto' // Left position relative to parent in px
|
||||||
};
|
};
|
||||||
var spinner = new Spinner(opts).spin(target);
|
this.spin = new Spinner(opts).spin(this.$element[0]);
|
||||||
$.blockUI.spinners.push(spinner);
|
},
|
||||||
|
destroy: function() {
|
||||||
|
if (this.spin)
|
||||||
|
this.spin.stop();
|
||||||
|
this._super();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
instance.web.Throbber.throbbers = [];
|
||||||
|
|
||||||
|
instance.web.blockUI = function() {
|
||||||
|
var tmp = $.blockUI.apply($, arguments);
|
||||||
|
var throbber = new instance.web.Throbber();
|
||||||
|
instance.web.Throbber.throbbers.push(throbber);
|
||||||
|
throbber.appendTo($(".oe_blockui_spin_container"));
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
instance.web.unblockUI = function() {
|
instance.web.unblockUI = function() {
|
||||||
_.each($.blockUI.spinners, function(el) {
|
_.each(instance.web.Throbber.throbbers, function(el) {
|
||||||
el.stop();
|
el.destroy();
|
||||||
});
|
});
|
||||||
return $.unblockUI.apply($, arguments);
|
return $.unblockUI.apply($, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Setup default session */
|
/** Setup default session */
|
||||||
instance.connection = new instance.web.Session();
|
instance.session = new instance.web.Session();
|
||||||
|
|
||||||
/** Configure default qweb */
|
/** Configure default qweb */
|
||||||
instance.web._t = new instance.web.TranslationDataBase().build_translation_function();
|
instance.web._t = new instance.web.TranslationDataBase().build_translation_function();
|
||||||
|
@ -604,8 +591,8 @@ instance.web._lt = function (s) {
|
||||||
return {toString: function () { return instance.web._t(s); }}
|
return {toString: function () { return instance.web._t(s); }}
|
||||||
};
|
};
|
||||||
instance.web.qweb = new QWeb2.Engine();
|
instance.web.qweb = new QWeb2.Engine();
|
||||||
instance.web.qweb.default_dict['__debug__'] = instance.connection.debug; // Which one ?
|
instance.web.qweb.default_dict['__debug__'] = instance.session.debug; // Which one ?
|
||||||
instance.web.qweb.debug = instance.connection.debug;
|
instance.web.qweb.debug = instance.session.debug;
|
||||||
instance.web.qweb.default_dict = {
|
instance.web.qweb.default_dict = {
|
||||||
'_' : _,
|
'_' : _,
|
||||||
'_t' : instance.web._t
|
'_t' : instance.web._t
|
||||||
|
@ -662,7 +649,7 @@ var _t = instance.web._t;
|
||||||
_t('%d years ago');
|
_t('%d years ago');
|
||||||
}
|
}
|
||||||
|
|
||||||
instance.connection.on('module_loaded', this, function () {
|
instance.session.on('module_loaded', this, function () {
|
||||||
// provide timeago.js with our own translator method
|
// provide timeago.js with our own translator method
|
||||||
$.timeago.settings.translator = instance.web._t;
|
$.timeago.settings.translator = instance.web._t;
|
||||||
});
|
});
|
||||||
|
|
|
@ -58,7 +58,7 @@ instance.web.Query = instance.web.Class.extend({
|
||||||
},
|
},
|
||||||
_execute: function () {
|
_execute: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
return instance.connection.rpc('/web/dataset/search_read', {
|
return instance.session.rpc('/web/dataset/search_read', {
|
||||||
model: this._model.name,
|
model: this._model.name,
|
||||||
fields: this._fields || false,
|
fields: this._fields || false,
|
||||||
domain: this._model.domain(this._filter),
|
domain: this._model.domain(this._filter),
|
||||||
|
@ -233,7 +233,7 @@ instance.web.Model = instance.web.Class.extend(/** @lends openerp.web.Model# */{
|
||||||
kwargs = args;
|
kwargs = args;
|
||||||
args = [];
|
args = [];
|
||||||
}
|
}
|
||||||
return instance.connection.rpc('/web/dataset/call_kw', {
|
return instance.session.rpc('/web/dataset/call_kw', {
|
||||||
model: this.name,
|
model: this.name,
|
||||||
method: method,
|
method: method,
|
||||||
args: args,
|
args: args,
|
||||||
|
@ -256,7 +256,7 @@ instance.web.Model = instance.web.Class.extend(/** @lends openerp.web.Model# */{
|
||||||
* @param {String} signal signal to trigger on the workflow
|
* @param {String} signal signal to trigger on the workflow
|
||||||
*/
|
*/
|
||||||
exec_workflow: function (id, signal) {
|
exec_workflow: function (id, signal) {
|
||||||
return instance.connection.rpc('/web/dataset/exec_workflow', {
|
return instance.session.rpc('/web/dataset/exec_workflow', {
|
||||||
model: this.name,
|
model: this.name,
|
||||||
id: id,
|
id: id,
|
||||||
signal: signal
|
signal: signal
|
||||||
|
@ -282,7 +282,7 @@ instance.web.Model = instance.web.Class.extend(/** @lends openerp.web.Model# */{
|
||||||
*/
|
*/
|
||||||
context: function (context) {
|
context: function (context) {
|
||||||
return new instance.web.CompoundContext(
|
return new instance.web.CompoundContext(
|
||||||
instance.connection.user_context, this._context, context || {});
|
instance.session.user_context, this._context, context || {});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Button action caller, needs to perform cleanup if an action is returned
|
* Button action caller, needs to perform cleanup if an action is returned
|
||||||
|
@ -292,7 +292,7 @@ instance.web.Model = instance.web.Class.extend(/** @lends openerp.web.Model# */{
|
||||||
* FIXME: remove when evaluator integrated
|
* FIXME: remove when evaluator integrated
|
||||||
*/
|
*/
|
||||||
call_button: function (method, args) {
|
call_button: function (method, args) {
|
||||||
return instance.connection.rpc('/web/dataset/call_button', {
|
return instance.session.rpc('/web/dataset/call_button', {
|
||||||
model: this.name,
|
model: this.name,
|
||||||
method: method,
|
method: method,
|
||||||
domain_id: null,
|
domain_id: null,
|
||||||
|
@ -439,7 +439,7 @@ instance.web.data = {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
instance.web.DataGroup = instance.web.OldWidget.extend( /** @lends openerp.web.DataGroup# */{
|
instance.web.DataGroup = instance.web.CallbackEnabled.extend( /** @lends openerp.web.DataGroup# */{
|
||||||
/**
|
/**
|
||||||
* Management interface between views and grouped collections of OpenERP
|
* Management interface between views and grouped collections of OpenERP
|
||||||
* records.
|
* records.
|
||||||
|
@ -451,9 +451,9 @@ instance.web.DataGroup = instance.web.OldWidget.extend( /** @lends openerp.web.
|
||||||
* content of the current grouping level.
|
* content of the current grouping level.
|
||||||
*
|
*
|
||||||
* @constructs instance.web.DataGroup
|
* @constructs instance.web.DataGroup
|
||||||
* @extends instance.web.OldWidget
|
* @extends instance.web.CallbackEnabled
|
||||||
*
|
*
|
||||||
* @param {instance.web.OldWidget} parent widget
|
* @param {instance.web.CallbackEnabled} parent widget
|
||||||
* @param {String} model name of the model managed by this DataGroup
|
* @param {String} model name of the model managed by this DataGroup
|
||||||
* @param {Array} domain search domain for this DataGroup
|
* @param {Array} domain search domain for this DataGroup
|
||||||
* @param {Object} context context of the DataGroup's searches
|
* @param {Object} context context of the DataGroup's searches
|
||||||
|
@ -524,13 +524,13 @@ instance.web.StaticDataGroup = instance.web.GrouplessDataGroup.extend( /** @lend
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web.DataSet = instance.web.OldWidget.extend( /** @lends openerp.web.DataSet# */{
|
instance.web.DataSet = instance.web.CallbackEnabled.extend( /** @lends openerp.web.DataSet# */{
|
||||||
/**
|
/**
|
||||||
* DateaManagement interface between views and the collection of selected
|
* DateaManagement interface between views and the collection of selected
|
||||||
* OpenERP records (represents the view's state?)
|
* OpenERP records (represents the view's state?)
|
||||||
*
|
*
|
||||||
* @constructs instance.web.DataSet
|
* @constructs instance.web.DataSet
|
||||||
* @extends instance.web.OldWidget
|
* @extends instance.web.CallbackEnabled
|
||||||
*
|
*
|
||||||
* @param {String} model the OpenERP model this dataset will manage
|
* @param {String} model the OpenERP model this dataset will manage
|
||||||
*/
|
*/
|
||||||
|
@ -706,7 +706,7 @@ instance.web.DataSet = instance.web.OldWidget.extend( /** @lends openerp.web.Da
|
||||||
* @returns {$.Deferred}
|
* @returns {$.Deferred}
|
||||||
*/
|
*/
|
||||||
call_and_eval: function (method, args, domain_index, context_index, callback, error_callback) {
|
call_and_eval: function (method, args, domain_index, context_index, callback, error_callback) {
|
||||||
return this.rpc('/web/dataset/call', {
|
return instance.session.rpc('/web/dataset/call', {
|
||||||
model: this.model,
|
model: this.model,
|
||||||
method: method,
|
method: method,
|
||||||
domain_id: domain_index == undefined ? null : domain_index,
|
domain_id: domain_index == undefined ? null : domain_index,
|
||||||
|
@ -805,6 +805,22 @@ instance.web.DataSet = instance.web.OldWidget.extend( /** @lends openerp.web.Da
|
||||||
alter_ids: function(n_ids) {
|
alter_ids: function(n_ids) {
|
||||||
this.ids = n_ids;
|
this.ids = n_ids;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Resequence records.
|
||||||
|
*
|
||||||
|
* @param {Array} ids identifiers of the records to resequence
|
||||||
|
* @returns {$.Deferred}
|
||||||
|
*/
|
||||||
|
resequence: function (ids, options) {
|
||||||
|
options = options || {};
|
||||||
|
return instance.session.rpc('/web/dataset/resequence', {
|
||||||
|
model: this.model,
|
||||||
|
ids: ids,
|
||||||
|
context: this._model.context(options.context),
|
||||||
|
}).pipe(function (results) {
|
||||||
|
return results;
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
instance.web.DataSetStatic = instance.web.DataSet.extend({
|
instance.web.DataSetStatic = instance.web.DataSet.extend({
|
||||||
init: function(parent, model, context, ids) {
|
init: function(parent, model, context, ids) {
|
||||||
|
|
|
@ -635,6 +635,16 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
add_common_inputs: function() {
|
||||||
|
// add Filters to this.inputs, need view.controls filled
|
||||||
|
(new instance.web.search.Filters(this));
|
||||||
|
// add custom filters to this.inputs
|
||||||
|
(new instance.web.search.CustomFilters(this));
|
||||||
|
// add Advanced to this.inputs
|
||||||
|
(new instance.web.search.Advanced(this));
|
||||||
|
},
|
||||||
|
|
||||||
on_loaded: function(data) {
|
on_loaded: function(data) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.fields_view = data.fields_view;
|
this.fields_view = data.fields_view;
|
||||||
|
@ -649,20 +659,13 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
||||||
data.fields_view['arch'].children,
|
data.fields_view['arch'].children,
|
||||||
data.fields_view.fields);
|
data.fields_view.fields);
|
||||||
|
|
||||||
// add Filters to this.inputs, need view.controls filled
|
this.add_common_inputs();
|
||||||
(new instance.web.search.Filters(this));
|
|
||||||
// add custom filters to this.inputs
|
|
||||||
(new instance.web.search.CustomFilters(this));
|
|
||||||
// add Advanced to this.inputs
|
|
||||||
(new instance.web.search.Advanced(this));
|
|
||||||
|
|
||||||
// build drawer
|
// build drawer
|
||||||
var drawer_started = $.when.apply(
|
var drawer_started = $.when.apply(
|
||||||
null, _(this.select_for_drawer()).invoke(
|
null, _(this.select_for_drawer()).invoke(
|
||||||
'appendTo', this.$element.find('.oe_searchview_drawer')));
|
'appendTo', this.$element.find('.oe_searchview_drawer')));
|
||||||
|
|
||||||
new instance.web.search.AddToReporting(this).appendTo($('.oe_searchview_drawer', this.$element));
|
|
||||||
|
|
||||||
// load defaults
|
// load defaults
|
||||||
var defaults_fetched = $.when.apply(null, _(this.inputs).invoke(
|
var defaults_fetched = $.when.apply(null, _(this.inputs).invoke(
|
||||||
'facet_for_defaults', this.defaults)).then(function () {
|
'facet_for_defaults', this.defaults)).then(function () {
|
||||||
|
@ -683,9 +686,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
||||||
case 'advanced_filter':
|
case 'advanced_filter':
|
||||||
this.extended_search.on_activate();
|
this.extended_search.on_activate();
|
||||||
break;
|
break;
|
||||||
case 'add_to_dashboard':
|
|
||||||
this.on_add_to_dashboard();
|
|
||||||
break;
|
|
||||||
case '':
|
case '':
|
||||||
this.do_clear();
|
this.do_clear();
|
||||||
}
|
}
|
||||||
|
@ -1613,7 +1613,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
|
||||||
}
|
}
|
||||||
var filter = {
|
var filter = {
|
||||||
name: $name.val(),
|
name: $name.val(),
|
||||||
user_id: private_filter ? instance.connection.uid : false,
|
user_id: private_filter ? instance.session.uid : false,
|
||||||
model_id: self.view.model,
|
model_id: self.view.model,
|
||||||
context: results.context,
|
context: results.context,
|
||||||
domain: results.domain
|
domain: results.domain
|
||||||
|
@ -1678,74 +1678,6 @@ instance.web.search.Filters = instance.web.search.Input.extend({
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
instance.web.search.AddToReporting = instance.web.Widget.extend({
|
|
||||||
template: 'SearchView.addtoreporting',
|
|
||||||
_in_drawer: true,
|
|
||||||
start: function () {
|
|
||||||
var self = this;
|
|
||||||
this.$element
|
|
||||||
.on('click', 'h4', this.proxy('show_option'))
|
|
||||||
.on('submit', 'form', function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
self.add_dashboard();
|
|
||||||
});
|
|
||||||
return this.load_data().then(this.proxy("render_data"));
|
|
||||||
},
|
|
||||||
load_data:function(){
|
|
||||||
if (!instance.webclient) { return $.Deferred().reject(); }
|
|
||||||
var dashboard_menu = instance.webclient.menu.data.data.children;
|
|
||||||
return new instance.web.Model('ir.model.data')
|
|
||||||
.query(['res_id'])
|
|
||||||
.filter([['name','=','menu_reporting_dashboard']])
|
|
||||||
.first().pipe(function (result) {
|
|
||||||
var menu = _(dashboard_menu).chain()
|
|
||||||
.pluck('children')
|
|
||||||
.flatten(true)
|
|
||||||
.find(function (child) { return child.id === result.res_id; })
|
|
||||||
.value();
|
|
||||||
return menu ? menu.children : [];
|
|
||||||
});
|
|
||||||
},
|
|
||||||
render_data: function(dashboard_choices){
|
|
||||||
var selection = instance.web.qweb.render(
|
|
||||||
"SearchView.addtoreporting.selection", {
|
|
||||||
selections: dashboard_choices});
|
|
||||||
this.$("input").before(selection)
|
|
||||||
},
|
|
||||||
add_dashboard:function(){
|
|
||||||
var self = this;
|
|
||||||
var getParent = this.getParent();
|
|
||||||
var view_parent = this.getParent().getParent();
|
|
||||||
if (! view_parent.action || ! this.$element.find("select").val())
|
|
||||||
return this.do_warn("Can't find dashboard action");
|
|
||||||
var data = getParent.build_search_data();
|
|
||||||
var context = new instance.web.CompoundContext(getParent.dataset.get_context() || []);
|
|
||||||
var domain = new instance.web.CompoundDomain(getParent.dataset.get_domain() || []);
|
|
||||||
_.each(data.contexts, context.add, context);
|
|
||||||
_.each(data.domains, domain.add, domain);
|
|
||||||
this.rpc('/web/searchview/add_to_dashboard', {
|
|
||||||
menu_id: this.$element.find("select").val(),
|
|
||||||
action_id: view_parent.action.id,
|
|
||||||
context_to_save: context,
|
|
||||||
domain: domain,
|
|
||||||
view_mode: view_parent.active_view,
|
|
||||||
name: this.$element.find("input").val()
|
|
||||||
}, function(r) {
|
|
||||||
if (r === false) {
|
|
||||||
self.do_warn("Could not add filter to dashboard");
|
|
||||||
} else {
|
|
||||||
self.$element.toggleClass('oe_opened');
|
|
||||||
self.do_notify("Filter added to dashboard", '');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
show_option:function(){
|
|
||||||
this.$element.toggleClass('oe_opened');
|
|
||||||
if (! this.$element.hasClass('oe_opened'))
|
|
||||||
return;
|
|
||||||
this.$("input").val(this.getParent().fields_view.name || "" );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
instance.web.search.Advanced = instance.web.search.Input.extend({
|
instance.web.search.Advanced = instance.web.search.Input.extend({
|
||||||
template: 'SearchView.advanced',
|
template: 'SearchView.advanced',
|
||||||
|
@ -1805,11 +1737,11 @@ instance.web.search.Advanced = instance.web.search.Input.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web.search.ExtendedSearchProposition = instance.web.OldWidget.extend(/** @lends instance.web.search.ExtendedSearchProposition# */{
|
instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @lends instance.web.search.ExtendedSearchProposition# */{
|
||||||
template: 'SearchView.extended_search.proposition',
|
template: 'SearchView.extended_search.proposition',
|
||||||
/**
|
/**
|
||||||
* @constructs instance.web.search.ExtendedSearchProposition
|
* @constructs instance.web.search.ExtendedSearchProposition
|
||||||
* @extends instance.web.OldWidget
|
* @extends instance.web.Widget
|
||||||
*
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
* @param fields
|
* @param fields
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
openerp.test_support = {
|
openerp.test_support = {
|
||||||
setup_connection: function (connection) {
|
setup_session: function (session) {
|
||||||
var origin = location.protocol+"//"+location.host;
|
var origin = location.protocol+"//"+location.host;
|
||||||
_.extend(connection, {
|
_.extend(session, {
|
||||||
origin: origin,
|
origin: origin,
|
||||||
prefix: origin,
|
prefix: origin,
|
||||||
server: origin, // keep chs happy
|
server: origin, // keep chs happy
|
||||||
//openerp.web.qweb.default_dict['_s'] = this.origin;
|
//openerp.web.qweb.default_dict['_s'] = this.origin;
|
||||||
rpc_function: connection.rpc_json,
|
rpc_function: session.rpc_json,
|
||||||
session_id: false,
|
session_id: false,
|
||||||
uid: false,
|
uid: false,
|
||||||
username: false,
|
username: false,
|
||||||
|
@ -22,7 +22,7 @@ openerp.test_support = {
|
||||||
shortcuts: [],
|
shortcuts: [],
|
||||||
active_id: null
|
active_id: null
|
||||||
});
|
});
|
||||||
return connection.session_reload();
|
return session.session_reload();
|
||||||
},
|
},
|
||||||
module: function (title, tested_core, nonliterals) {
|
module: function (title, tested_core, nonliterals) {
|
||||||
var conf = QUnit.config.openerp = {};
|
var conf = QUnit.config.openerp = {};
|
||||||
|
@ -31,10 +31,10 @@ openerp.test_support = {
|
||||||
QUnit.stop();
|
QUnit.stop();
|
||||||
var oe = conf.openerp = window.openerp.init();
|
var oe = conf.openerp = window.openerp.init();
|
||||||
window.openerp.web[tested_core](oe);
|
window.openerp.web[tested_core](oe);
|
||||||
var done = openerp.test_support.setup_connection(oe.connection);
|
var done = openerp.test_support.setup_session(oe.session);
|
||||||
if (nonliterals) {
|
if (nonliterals) {
|
||||||
done = done.pipe(function () {
|
done = done.pipe(function () {
|
||||||
return oe.connection.rpc('/tests/add_nonliterals', {
|
return oe.session.rpc('/tests/add_nonliterals', {
|
||||||
domains: nonliterals.domains || [],
|
domains: nonliterals.domains || [],
|
||||||
contexts: nonliterals.contexts || []
|
contexts: nonliterals.contexts || []
|
||||||
}).then(function (r) {
|
}).then(function (r) {
|
||||||
|
|
|
@ -255,7 +255,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {Object} [options]
|
* @param {Object} [options]
|
||||||
* @param {Boolean} [editable=false] whether the form should be switched to edition mode. A value of ``false`` will keep the current mode.
|
* @param {Boolean} [mode=undefined] If specified, switch the form to specified mode. Can be "edit" or "view".
|
||||||
* @param {Boolean} [reload=true] whether the form should reload its content on show, or use the currently loaded record
|
* @param {Boolean} [reload=true] whether the form should reload its content on show, or use the currently loaded record
|
||||||
* @return {$.Deferred}
|
* @return {$.Deferred}
|
||||||
*/
|
*/
|
||||||
|
@ -292,9 +292,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return shown.pipe(function() {
|
return shown.pipe(function() {
|
||||||
if (options.editable) {
|
self._actualize_mode(options.mode || self.options.initial_mode);
|
||||||
self.to_edit_mode();
|
|
||||||
}
|
|
||||||
self.$element.css({
|
self.$element.css({
|
||||||
opacity: '1',
|
opacity: '1',
|
||||||
filter: 'alpha(opacity = 100)'
|
filter: 'alpha(opacity = 100)'
|
||||||
|
@ -634,12 +632,21 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
||||||
this._actualize_mode("edit");
|
this._actualize_mode("edit");
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Reactualize actual_mode.
|
* Ask the view to switch to a precise mode if possible. The view is free to
|
||||||
|
* not respect this command if the state of the dataset is not compatible with
|
||||||
|
* the new mode. For example, it is not possible to switch to edit mode if
|
||||||
|
* the current record is not yet saved in database.
|
||||||
|
*
|
||||||
|
* @param {string} [new_mode] Can be "edit", "view", "create" or undefined. If
|
||||||
|
* undefined the view will test the actual mode to check if it is still consistent
|
||||||
|
* with the dataset state.
|
||||||
*/
|
*/
|
||||||
_actualize_mode: function(switch_to) {
|
_actualize_mode: function(switch_to) {
|
||||||
var mode = switch_to || this.get("actual_mode");
|
var mode = switch_to || this.get("actual_mode");
|
||||||
if (! this.datarecord.id) {
|
if (! this.datarecord.id) {
|
||||||
mode = "create";
|
mode = "create";
|
||||||
|
} else if (mode === "create") {
|
||||||
|
mode = "edit";
|
||||||
}
|
}
|
||||||
this.set({actual_mode: mode});
|
this.set({actual_mode: mode});
|
||||||
},
|
},
|
||||||
|
@ -1656,7 +1663,7 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi
|
||||||
template = 'WidgetLabel.tooltip';
|
template = 'WidgetLabel.tooltip';
|
||||||
}
|
}
|
||||||
return QWeb.render(template, {
|
return QWeb.render(template, {
|
||||||
debug: instance.connection.debug,
|
debug: instance.session.debug,
|
||||||
widget: widget
|
widget: widget
|
||||||
})},
|
})},
|
||||||
gravity: $.fn.tipsy.autoBounds(50, 'nw'),
|
gravity: $.fn.tipsy.autoBounds(50, 'nw'),
|
||||||
|
@ -1733,7 +1740,7 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({
|
||||||
start: function() {
|
start: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
this.$element.click(this.on_click);
|
this.$element.click(this.on_click);
|
||||||
if (this.node.attrs.help || instance.connection.debug) {
|
if (this.node.attrs.help || instance.session.debug) {
|
||||||
this.do_attach_tooltip();
|
this.do_attach_tooltip();
|
||||||
}
|
}
|
||||||
this.setupFocus(this.$element);
|
this.setupFocus(this.$element);
|
||||||
|
@ -1930,7 +1937,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w
|
||||||
}, this));
|
}, this));
|
||||||
}
|
}
|
||||||
this.$label = this.view.$element.find('label[for=' + this.id_for_label + ']');
|
this.$label = this.view.$element.find('label[for=' + this.id_for_label + ']');
|
||||||
if (instance.connection.debug) {
|
if (instance.session.debug) {
|
||||||
this.do_attach_tooltip(this, this.$label[0] || this.$element);
|
this.do_attach_tooltip(this, this.$label[0] || this.$element);
|
||||||
this.$label.off('dblclick').on('dblclick', function() {
|
this.$label.off('dblclick').on('dblclick', function() {
|
||||||
console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view);
|
console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view);
|
||||||
|
@ -2173,7 +2180,7 @@ instance.web.form.FieldFloat = instance.web.form.FieldChar.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web.DateTimeWidget = instance.web.OldWidget.extend({
|
instance.web.DateTimeWidget = instance.web.Widget.extend({
|
||||||
template: "web.datepicker",
|
template: "web.datepicker",
|
||||||
jqueryui_object: 'datetimepicker',
|
jqueryui_object: 'datetimepicker',
|
||||||
type_of_date: "datetime",
|
type_of_date: "datetime",
|
||||||
|
@ -2394,9 +2401,19 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we
|
||||||
* To find more information about CLEditor configutation: go to
|
* To find more information about CLEditor configutation: go to
|
||||||
* http://premiumsoftware.net/cleditor/docs/GettingStarted.html
|
* http://premiumsoftware.net/cleditor/docs/GettingStarted.html
|
||||||
*/
|
*/
|
||||||
instance.web.form.FieldTextHtml = instance.web.form.FieldText.extend({
|
instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, {
|
||||||
|
template: 'FieldTextHtml',
|
||||||
|
init: function() {
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
if (this.field.type !== 'html') {
|
||||||
|
throw new Error(_.str.sprintf(
|
||||||
|
_t("Error with field %s, it is not allowed to use the widget 'html' with any other field type than 'html'"), this.string));
|
||||||
|
}
|
||||||
|
},
|
||||||
initialize_content: function() {
|
initialize_content: function() {
|
||||||
|
var self = this;
|
||||||
|
if (! this.get("effective_readonly")) {
|
||||||
|
self._updating_editor = false;
|
||||||
this.$textarea = this.$element.find('textarea');
|
this.$textarea = this.$element.find('textarea');
|
||||||
var width = ((this.node.attrs || {}).editor_width || 468);
|
var width = ((this.node.attrs || {}).editor_width || 468);
|
||||||
var height = ((this.node.attrs || {}).editor_height || 100);
|
var height = ((this.node.attrs || {}).editor_height || 100);
|
||||||
|
@ -2404,34 +2421,34 @@ instance.web.form.FieldTextHtml = instance.web.form.FieldText.extend({
|
||||||
width: width, // width not including margins, borders or padding
|
width: width, // width not including margins, borders or padding
|
||||||
height: height, // height not including margins, borders or padding
|
height: height, // height not including margins, borders or padding
|
||||||
controls: // controls to add to the toolbar
|
controls: // controls to add to the toolbar
|
||||||
"bold italic underline strikethrough | size " +
|
"bold italic underline strikethrough " +
|
||||||
"| removeformat | bullets numbering | outdent " +
|
"| removeformat | bullets numbering | outdent " +
|
||||||
"indent | link unlink",
|
"indent | link unlink | source",
|
||||||
sizes: // sizes in the font size popup
|
|
||||||
"1,2,3,4,5,6,7",
|
|
||||||
bodyStyle: // style to assign to document body contained within the editor
|
bodyStyle: // style to assign to document body contained within the editor
|
||||||
"margin:4px; font:12px monospace; cursor:text; color:#1F1F1F"
|
"margin:4px; font:12px monospace; cursor:text; color:#1F1F1F"
|
||||||
});
|
});
|
||||||
this.$cleditor = this.$textarea.cleditor()[0];
|
this.$cleditor = this.$textarea.cleditor()[0];
|
||||||
// call super now, because cleditor resets the disable attr
|
this.$cleditor.change(function() {
|
||||||
this._super.apply(this, arguments);
|
if (! self._updating_editor) {
|
||||||
// propagate disabled property to cleditor
|
self.$cleditor.updateTextArea();
|
||||||
this.$cleditor.disable(this.$textarea.prop('disabled'));
|
self.set({'value': self.$textarea.val()});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
set_value: function(value_) {
|
set_value: function(value_) {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
this._dirty_flag = true;
|
this.render_value();
|
||||||
},
|
},
|
||||||
|
|
||||||
render_value: function() {
|
render_value: function() {
|
||||||
this._super.apply(this, arguments);
|
if (! this.get("effective_readonly")) {
|
||||||
|
this.$textarea.val(this.get('value'));
|
||||||
|
this._updating_editor = true;
|
||||||
this.$cleditor.updateFrame();
|
this.$cleditor.updateFrame();
|
||||||
},
|
this._updating_editor = false;
|
||||||
|
} else {
|
||||||
get_value: function() {
|
this.$element.html(this.get('value'));
|
||||||
this.$cleditor.updateTextArea();
|
}
|
||||||
return this.$textarea.val();
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2706,6 +2723,11 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||||
this.floating = false;
|
this.floating = false;
|
||||||
this.render_value();
|
this.render_value();
|
||||||
});
|
});
|
||||||
|
instance.web.bus.on('click', this, function() {
|
||||||
|
if (!this.get("effective_readonly") && this.$input && this.$input.autocomplete('widget').is(':visible')) {
|
||||||
|
this.$input.autocomplete("close");
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
initialize_content: function() {
|
initialize_content: function() {
|
||||||
if (!this.get("effective_readonly"))
|
if (!this.get("effective_readonly"))
|
||||||
|
@ -2784,8 +2806,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var tip_def = $.Deferred();
|
self.tip_def = $.Deferred();
|
||||||
var untip_def = $.Deferred();
|
self.untip_def = $.Deferred();
|
||||||
var tip_delay = 200;
|
var tip_delay = 200;
|
||||||
var tip_duration = 15000;
|
var tip_duration = 15000;
|
||||||
var anyoneLoosesFocus = function() {
|
var anyoneLoosesFocus = function() {
|
||||||
|
@ -2807,24 +2829,25 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||||
}
|
}
|
||||||
self.floating = false;
|
self.floating = false;
|
||||||
}
|
}
|
||||||
if (used && self.get("value") === false) {
|
if (used && self.get("value") === false && ! self.no_tipsy) {
|
||||||
tip_def.reject();
|
self.tip_def.reject();
|
||||||
untip_def.reject();
|
self.untip_def.reject();
|
||||||
tip_def = $.Deferred();
|
self.tip_def = $.Deferred();
|
||||||
tip_def.then(function() {
|
self.tip_def.then(function() {
|
||||||
self.$input.tipsy("show");
|
self.$input.tipsy("show");
|
||||||
});
|
});
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
tip_def.resolve();
|
self.tip_def.resolve();
|
||||||
untip_def.reject();
|
self.untip_def.reject();
|
||||||
untip_def = $.Deferred();
|
self.untip_def = $.Deferred();
|
||||||
untip_def.then(function() {
|
self.untip_def.then(function() {
|
||||||
self.$input.tipsy("hide");
|
self.$input.tipsy("hide");
|
||||||
});
|
});
|
||||||
setTimeout(function() {untip_def.resolve();}, tip_duration);
|
setTimeout(function() {self.untip_def.resolve();}, tip_duration);
|
||||||
}, tip_delay);
|
}, tip_delay);
|
||||||
} else {
|
} else {
|
||||||
tip_def.reject();
|
self.no_tipsy = false;
|
||||||
|
self.tip_def.reject();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.$input.focusout(anyoneLoosesFocus);
|
this.$input.focusout(anyoneLoosesFocus);
|
||||||
|
@ -2953,7 +2976,17 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||||
},
|
},
|
||||||
focus: function () {
|
focus: function () {
|
||||||
this.$input.focus();
|
this.$input.focus();
|
||||||
}
|
},
|
||||||
|
_quick_create: function() {
|
||||||
|
this.no_tipsy = true;
|
||||||
|
this.tip_def.reject();
|
||||||
|
return instance.web.form.CompletionFieldMixin._quick_create.apply(this, arguments);
|
||||||
|
},
|
||||||
|
_search_create_popup: function() {
|
||||||
|
this.no_tipsy = true;
|
||||||
|
this.tip_def.reject();
|
||||||
|
return instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4078,7 +4111,7 @@ instance.web.form.Many2ManyQuickCreate = instance.web.Widget.extend({
|
||||||
/**
|
/**
|
||||||
* Class with everything which is common between FormOpenPopup and SelectCreatePopup.
|
* Class with everything which is common between FormOpenPopup and SelectCreatePopup.
|
||||||
*/
|
*/
|
||||||
instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({
|
instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
|
||||||
template: "AbstractFormPopup.render",
|
template: "AbstractFormPopup.render",
|
||||||
/**
|
/**
|
||||||
* options:
|
* options:
|
||||||
|
@ -4156,7 +4189,10 @@ instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({
|
||||||
this.view_form.appendTo(this.$element.find(".oe_popup_form"));
|
this.view_form.appendTo(this.$element.find(".oe_popup_form"));
|
||||||
this.view_form.on_loaded.add_last(function() {
|
this.view_form.on_loaded.add_last(function() {
|
||||||
var multi_select = self.row_id === null && ! self.options.disable_multiple_selection;
|
var multi_select = self.row_id === null && ! self.options.disable_multiple_selection;
|
||||||
self.$buttonpane.html(QWeb.render("AbstractFormPopup.buttons", {multi_select: multi_select}));
|
self.$buttonpane.html(QWeb.render("AbstractFormPopup.buttons", {
|
||||||
|
multi_select: multi_select,
|
||||||
|
readonly: self.row_id !== null && self.options.readonly,
|
||||||
|
}));
|
||||||
var $snbutton = self.$buttonpane.find(".oe_abstractformpopup-form-save-new");
|
var $snbutton = self.$buttonpane.find(".oe_abstractformpopup-form-save-new");
|
||||||
$snbutton.click(function() {
|
$snbutton.click(function() {
|
||||||
$.when(self.view_form.do_save()).then(function() {
|
$.when(self.view_form.do_save()).then(function() {
|
||||||
|
@ -4177,11 +4213,6 @@ instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({
|
||||||
$cbutton.click(function() {
|
$cbutton.click(function() {
|
||||||
self.check_exit();
|
self.check_exit();
|
||||||
});
|
});
|
||||||
if (self.row_id !== null && self.options.readonly) {
|
|
||||||
$snbutton.hide();
|
|
||||||
$sbutton.hide();
|
|
||||||
$cbutton.text(_t("Close"));
|
|
||||||
}
|
|
||||||
self.view_form.do_show();
|
self.view_form.do_show();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -4318,11 +4349,12 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
on_click_element: function(ids) {
|
on_click_element: function(ids) {
|
||||||
|
var self = this;
|
||||||
this.selected_ids = ids || [];
|
this.selected_ids = ids || [];
|
||||||
if(this.selected_ids.length > 0) {
|
if(this.selected_ids.length > 0) {
|
||||||
this.$element.find(".oe_selectcreatepopup-search-select").removeAttr('disabled');
|
self.$buttonpane.find(".oe_selectcreatepopup-search-select").removeAttr('disabled');
|
||||||
} else {
|
} else {
|
||||||
this.$element.find(".oe_selectcreatepopup-search-select").attr('disabled', "disabled");
|
self.$buttonpane.find(".oe_selectcreatepopup-search-select").attr('disabled', "disabled");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new_object: function() {
|
new_object: function() {
|
||||||
|
@ -4616,8 +4648,9 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
|
||||||
if (this.get('value') && ! /^\d+(\.\d*)? \w+$/.test(this.get('value'))) {
|
if (this.get('value') && ! /^\d+(\.\d*)? \w+$/.test(this.get('value'))) {
|
||||||
url = 'data:image/png;base64,' + this.get('value');
|
url = 'data:image/png;base64,' + this.get('value');
|
||||||
} else if (this.get('value')) {
|
} else if (this.get('value')) {
|
||||||
|
var id = escape(JSON.stringify(this.view.datarecord.id || null));
|
||||||
url = '/web/binary/image?session_id=' + this.session.session_id + '&model=' +
|
url = '/web/binary/image?session_id=' + this.session.session_id + '&model=' +
|
||||||
this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name + '&t=' + (new Date().getTime());
|
this.view.dataset.model +'&id=' + id + '&field=' + this.name + '&t=' + (new Date().getTime());
|
||||||
} else {
|
} else {
|
||||||
url = "/web/static/src/img/placeholder.png";
|
url = "/web/static/src/img/placeholder.png";
|
||||||
}
|
}
|
||||||
|
@ -4793,7 +4826,7 @@ instance.web.form.widgets = new instance.web.Registry({
|
||||||
'email' : 'instance.web.form.FieldEmail',
|
'email' : 'instance.web.form.FieldEmail',
|
||||||
'url' : 'instance.web.form.FieldUrl',
|
'url' : 'instance.web.form.FieldUrl',
|
||||||
'text' : 'instance.web.form.FieldText',
|
'text' : 'instance.web.form.FieldText',
|
||||||
'text_html' : 'instance.web.form.FieldTextHtml',
|
'html' : 'instance.web.form.FieldTextHtml',
|
||||||
'date' : 'instance.web.form.FieldDate',
|
'date' : 'instance.web.form.FieldDate',
|
||||||
'datetime' : 'instance.web.form.FieldDatetime',
|
'datetime' : 'instance.web.form.FieldDatetime',
|
||||||
'selection' : 'instance.web.form.FieldSelection',
|
'selection' : 'instance.web.form.FieldSelection',
|
||||||
|
|
|
@ -2059,7 +2059,7 @@ instance.web.list.Button = instance.web.list.Column.extend({
|
||||||
title: this.string || '',
|
title: this.string || '',
|
||||||
additional_attributes: isNaN(row_data["id"].value) && instance.web.BufferedDataSet.virtual_id_regex.test(row_data["id"].value) ?
|
additional_attributes: isNaN(row_data["id"].value) && instance.web.BufferedDataSet.virtual_id_regex.test(row_data["id"].value) ?
|
||||||
'disabled="disabled" class="oe_list_button_disabled"' : '',
|
'disabled="disabled" class="oe_list_button_disabled"' : '',
|
||||||
prefix: instance.connection.prefix,
|
prefix: instance.session.prefix,
|
||||||
icon: this.icon,
|
icon: this.icon,
|
||||||
alt: this.string || ''
|
alt: this.string || ''
|
||||||
});
|
});
|
||||||
|
@ -2086,7 +2086,7 @@ instance.web.list.Binary = instance.web.list.Column.extend({
|
||||||
var text = _t("Download");
|
var text = _t("Download");
|
||||||
var download_url = _.str.sprintf(
|
var download_url = _.str.sprintf(
|
||||||
'/web/binary/saveas?session_id=%s&model=%s&field=%s&id=%d',
|
'/web/binary/saveas?session_id=%s&model=%s&field=%s&id=%d',
|
||||||
instance.connection.session_id, options.model, this.id, options.id);
|
instance.session.session_id, options.model, this.id, options.id);
|
||||||
if (this.filename) {
|
if (this.filename) {
|
||||||
download_url += '&filename_field=' + this.filename;
|
download_url += '&filename_field=' + this.filename;
|
||||||
if (row_data[this.filename]) {
|
if (row_data[this.filename]) {
|
||||||
|
|
|
@ -159,8 +159,10 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
//state = _.extend(this.inner_action.params || {}, state);
|
//state = _.extend(this.inner_action.params || {}, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!this.dialog) {
|
||||||
this.getParent().do_push_state(state);
|
this.getParent().do_push_state(state);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
do_load_state: function(state, warm) {
|
do_load_state: function(state, warm) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
@ -222,7 +224,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
}
|
}
|
||||||
var type = action.type.replace(/\./g,'_');
|
var type = action.type.replace(/\./g,'_');
|
||||||
var popup = action.target === 'new';
|
var popup = action.target === 'new';
|
||||||
var inline = action.target === 'inline';
|
var inline = action.target === 'inline' || action.target === 'inlineview';
|
||||||
action.flags = _.extend({
|
action.flags = _.extend({
|
||||||
views_switcher : !popup && !inline,
|
views_switcher : !popup && !inline,
|
||||||
search_view : !popup && !inline,
|
search_view : !popup && !inline,
|
||||||
|
@ -241,8 +243,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
this.dialog_stop();
|
this.dialog_stop();
|
||||||
this.clear_breadcrumbs();
|
this.clear_breadcrumbs();
|
||||||
},
|
},
|
||||||
|
ir_actions_common: function(action, on_close) {
|
||||||
do_ir_actions_common: function(action, on_close) {
|
|
||||||
var self = this, klass, widget, post_process;
|
var self = this, klass, widget, post_process;
|
||||||
if (action.type === 'ir.actions.client') {
|
if (action.type === 'ir.actions.client') {
|
||||||
var ClientWidget = instance.web.client_actions.get_object(action.tag);
|
var ClientWidget = instance.web.client_actions.get_object(action.tag);
|
||||||
|
@ -286,16 +287,8 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
this.inner_widget.appendTo(this.$element);
|
this.inner_widget.appendTo(this.$element);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
ir_actions_act_window: function (action, on_close) {
|
ir_actions_act_window: function (action, on_close) {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (_(['base.module.upgrade', 'base.setup.installer'])
|
|
||||||
.contains(action.res_model)) {
|
|
||||||
var old_close = on_close;
|
|
||||||
on_close = function () {
|
|
||||||
instance.webclient.do_reload().then(old_close);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (action.target !== 'new') {
|
if (action.target !== 'new') {
|
||||||
if(action.menu_id) {
|
if(action.menu_id) {
|
||||||
this.dialog_stop();
|
this.dialog_stop();
|
||||||
|
@ -304,10 +297,10 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.do_ir_actions_common(action, on_close);
|
return this.ir_actions_common(action, on_close);
|
||||||
},
|
},
|
||||||
ir_actions_client: function (action, on_close) {
|
ir_actions_client: function (action, on_close) {
|
||||||
return this.do_ir_actions_common(action, on_close);
|
return this.ir_actions_common(action, on_close);
|
||||||
},
|
},
|
||||||
ir_actions_act_window_close: function (action, on_closed) {
|
ir_actions_act_window_close: function (action, on_closed) {
|
||||||
if (!this.dialog && on_closed) {
|
if (!this.dialog && on_closed) {
|
||||||
|
@ -350,9 +343,6 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
ir_actions_act_url: function (action) {
|
ir_actions_act_url: function (action) {
|
||||||
window.open(action.url, action.target === 'self' ? '_self' : '_blank');
|
window.open(action.url, action.target === 'self' ? '_self' : '_blank');
|
||||||
},
|
},
|
||||||
ir_ui_menu: function (action) {
|
|
||||||
this.getParent().do_action(action);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web.ViewManager = instance.web.Widget.extend({
|
instance.web.ViewManager = instance.web.Widget.extend({
|
||||||
|
@ -475,17 +465,12 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
||||||
// Lazy loading of views
|
// Lazy loading of views
|
||||||
var self = this;
|
var self = this;
|
||||||
var view = this.views[view_type];
|
var view = this.views[view_type];
|
||||||
var controllerclass = this.registry.get_object(view_type);
|
var viewclass = this.registry.get_object(view_type);
|
||||||
var options = _.clone(view.options);
|
var options = _.clone(view.options);
|
||||||
if (view_type === "form" && this.action) {
|
if (view_type === "form" && this.action && (this.action.target == 'new' || this.action.target == 'inline')) {
|
||||||
switch (this.action.target) {
|
|
||||||
case 'new':
|
|
||||||
case 'inline':
|
|
||||||
options.initial_mode = 'edit';
|
options.initial_mode = 'edit';
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
var controller = new viewclass(this, this.dataset, view.view_id, options);
|
||||||
var controller = new controllerclass(this, this.dataset, view.view_id, options);
|
|
||||||
|
|
||||||
controller.on('history_back', this, function() {
|
controller.on('history_back', this, function() {
|
||||||
var am = self.getParent();
|
var am = self.getParent();
|
||||||
|
@ -1179,7 +1164,6 @@ instance.web.TranslateDialog = instance.web.Dialog.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web.View = instance.web.Widget.extend({
|
instance.web.View = instance.web.Widget.extend({
|
||||||
template: "EmptyComponent",
|
|
||||||
// name displayed in view switchers
|
// name displayed in view switchers
|
||||||
display_name: '',
|
display_name: '',
|
||||||
/**
|
/**
|
||||||
|
@ -1349,12 +1333,10 @@ instance.web.View = instance.web.Widget.extend({
|
||||||
do_search: function(view) {
|
do_search: function(view) {
|
||||||
},
|
},
|
||||||
on_sidebar_import: function() {
|
on_sidebar_import: function() {
|
||||||
var import_view = new instance.web.DataImport(this, this.dataset);
|
new instance.web.DataImport(this, this.dataset).open();
|
||||||
import_view.start();
|
|
||||||
},
|
},
|
||||||
on_sidebar_export: function() {
|
on_sidebar_export: function() {
|
||||||
var export_view = new instance.web.DataExport(this, this.dataset);
|
new instance.web.DataExport(this, this.dataset).open();
|
||||||
export_view.start();
|
|
||||||
},
|
},
|
||||||
on_sidebar_translate: function() {
|
on_sidebar_translate: function() {
|
||||||
return this.do_action({
|
return this.do_action({
|
||||||
|
|
|
@ -121,22 +121,22 @@
|
||||||
</select>
|
</select>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
|
|
||||||
<t t-name="DatabaseManager">
|
<t t-name="DatabaseManager">
|
||||||
<div class="oe_database_manager">
|
<div class="oe_view_manager_view_form">
|
||||||
<div class="oe_database_manager_menu">
|
<div class="oe_form">
|
||||||
<ul class="oe_notebook">
|
<form id="db_create" name="create_db_form" style="display: block;">
|
||||||
<li><a href="#db_create">Create</a></li>
|
<div class="oe_view_manager oe_view_manager_current">
|
||||||
<li><a href="#db_drop">Drop</a></li>
|
<div class="oe_view_manager_header" style="padding: 8px;">
|
||||||
<li><a href="#db_backup">Backup</a></li>
|
<div class="oe_header_row">
|
||||||
<li><a href="#db_restore">Restore</a></li>
|
<h2 class="oe_view_title">
|
||||||
<li><a href="#db_change_password">Password</a></li>
|
<span class="oe_view_title_text oe_breadcrumb_title">Create Database</span>
|
||||||
<li><a id="back_to_login" href="#">Back to Login</a></li>
|
</h2>
|
||||||
</ul>
|
<button type="submit" class="oe_button oe_highlight db_create">Create</button>
|
||||||
<form id="db_create" name="create_db_form" method="POST">
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<table align="center" class="db_option_table">
|
<table align="center" class="db_option_table">
|
||||||
<tr>
|
|
||||||
<th colspan="2" class="option_string"> CREATE DATABASE </th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="super_admin_pwd">Master password:</label></td>
|
<td><label for="super_admin_pwd">Master password:</label></td>
|
||||||
<td><input type="password" name="super_admin_pwd" class="required" value="admin" /></td>
|
<td><input type="password" name="super_admin_pwd" class="required" value="admin" /></td>
|
||||||
|
@ -147,14 +147,20 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="demo_data">Load Demonstration data:</label></td>
|
<td><label for="demo_data">Load Demonstration data:</label></td>
|
||||||
<td><input type="checkbox" name="demo_data"/></td>
|
<td class="oe_form_group_cell">
|
||||||
|
<span class="oe_form_field oe_form_field_boolean">
|
||||||
|
<input type="checkbox" name="demo_data" />
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="db_lang">Default language:</label></td>
|
<td><label for="db_lang">Default language:</label></td>
|
||||||
<td>
|
<td class="oe_form_field oe_form_field_selection ">
|
||||||
<select name="db_lang" t-if="widget.lang_list">
|
<select name="db_lang" t-if="widget.lang_list">
|
||||||
<t t-foreach="widget.lang_list" t-as="lang">
|
<t t-foreach="widget.lang_list" t-as="lang">
|
||||||
<option t-att-value="lang[0]" t-att-selected="lang[0] === 'en_US' ? 'selected' : undefined"><t t-esc="lang[1]"/></option>
|
<option t-att-value="lang[0]" t-att-selected="lang[0] === 'en_US' ? 'selected' : undefined">
|
||||||
|
<t t-esc="lang[1]" />
|
||||||
|
</option>
|
||||||
</t>
|
</t>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
|
@ -167,22 +173,28 @@
|
||||||
<td><label for="create_confirm_pwd">Confirm password:</label></td>
|
<td><label for="create_confirm_pwd">Confirm password:</label></td>
|
||||||
<td><input type="password" name="create_confirm_pwd" class="required" equalTo="input[name=create_admin_pwd]"/></td>
|
<td><input type="password" name="create_confirm_pwd" class="required" equalTo="input[name=create_admin_pwd]"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td colspan="2" align="right"><button class="oe_button">Create</button></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<form id="db_drop" name="drop_db_form" method="POST">
|
<form id="db_drop" name="drop_db_form" style="display: none; ">
|
||||||
|
<div class="oe_view_manager oe_view_manager_current">
|
||||||
|
<div class="oe_view_manager_header" style="padding: 8px;">
|
||||||
|
<div class="oe_header_row">
|
||||||
|
<h2 class="oe_view_title">
|
||||||
|
<span class="oe_view_title_text oe_breadcrumb_title">Drop Database</span>
|
||||||
|
</h2>
|
||||||
|
<button type="submit" class="oe_button oe_highlight db_drop">Drop</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<table align="center" class="db_option_table">
|
<table align="center" class="db_option_table">
|
||||||
<tr>
|
|
||||||
<th colspan="2" class="option_string"> DROP DATABASE </th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="drop_db">Database:</label></td>
|
<td><label for="drop_db">Database:</label></td>
|
||||||
<td>
|
<td class="oe_form_field oe_form_field_selection">
|
||||||
<select t-if="widget.db_list" name="drop_db" autofocus="autofocus">
|
<select t-if="widget.db_list" name="drop_db" autofocus="autofocus">
|
||||||
<t t-foreach="widget.db_list" t-as="db">
|
<t t-foreach="widget.db_list" t-as="db">
|
||||||
<option t-att-value="db"><t t-esc="db"/></option>
|
<option t-att-value="db">
|
||||||
|
<t t-esc="db" />
|
||||||
|
</option>
|
||||||
</t>
|
</t>
|
||||||
</select>
|
</select>
|
||||||
<input t-if="!widget.db_list" name="drop_db" class="required" type="text" autofocus="autofocus"/>
|
<input t-if="!widget.db_list" name="drop_db" class="required" type="text" autofocus="autofocus"/>
|
||||||
|
@ -192,23 +204,29 @@
|
||||||
<td><label for="drop_password">Master Password:</label></td>
|
<td><label for="drop_password">Master Password:</label></td>
|
||||||
<td><input type="password" name="drop_pwd" class="required" /></td>
|
<td><input type="password" name="drop_pwd" class="required" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td colspan="2" align="right"><button class="oe_button">Drop</button></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<form id="db_backup" name="backup_db_form" method="POST" target="backup-target" action="/web/database/backup">
|
<form id="db_backup" name="backup_db_form" target="backup-target" action="/web/database/backup" style="display: none;">
|
||||||
|
<div class="oe_view_manager oe_view_manager_current">
|
||||||
|
<div class="oe_view_manager_header" style="padding: 8px;">
|
||||||
|
<div class="oe_header_row">
|
||||||
|
<h2 class="oe_view_title">
|
||||||
|
<span class="oe_view_title_text oe_breadcrumb_title">Backup Database</span>
|
||||||
|
</h2>
|
||||||
|
<button type="submit" class="oe_button oe_highlight db_backup">Backup</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<input type="hidden" name="token" />
|
<input type="hidden" name="token" />
|
||||||
<table align="center" class="db_option_table">
|
<table align="center" class="db_option_table">
|
||||||
<tr>
|
|
||||||
<th colspan="2" class="option_string"> BACKUP DATABASE </th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="backup_db">Database:</label></td>
|
<td><label for="backup_db">Database:</label></td>
|
||||||
<td>
|
<td class="oe_form_field oe_form_field_selection ">
|
||||||
<select t-if="widget.db_list" name="backup_db" autofocus="autofocus">
|
<select t-if="widget.db_list" name="backup_db" autofocus="autofocus">
|
||||||
<t t-foreach="widget.db_list" t-as="db">
|
<t t-foreach="widget.db_list" t-as="db">
|
||||||
<option t-att-value="db"><t t-esc="db"/></option>
|
<option t-att-value="db">
|
||||||
|
<t t-esc="db" />
|
||||||
|
</option>
|
||||||
</t>
|
</t>
|
||||||
</select>
|
</select>
|
||||||
<input t-if="!widget.db_list" name="backup_db" class="required" type="text" autofocus="autofocus"/>
|
<input t-if="!widget.db_list" name="backup_db" class="required" type="text" autofocus="autofocus"/>
|
||||||
|
@ -218,16 +236,20 @@
|
||||||
<td><label for="backup_pwd">Master Password:</label></td>
|
<td><label for="backup_pwd">Master Password:</label></td>
|
||||||
<td><input type="password" name="backup_pwd" class="required" /></td>
|
<td><input type="password" name="backup_pwd" class="required" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td colspan="2" align="right"><button class="oe_button">Backup</button></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<form id="db_restore" name="restore_db_form" method="POST">
|
<form id="db_restore" name="restore_db_form" style="display: none; ">
|
||||||
|
<div class="oe_view_manager oe_view_manager_current">
|
||||||
|
<div class="oe_view_manager_header" style="padding: 8px;">
|
||||||
|
<div class="oe_header_row">
|
||||||
|
<h2 class="oe_view_title">
|
||||||
|
<span class="oe_view_title_text oe_breadcrumb_title">Restore Database</span>
|
||||||
|
</h2>
|
||||||
|
<button type="submit" class="oe_button oe_highlight db_restore">Restore</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<table align="center" class="db_option_table">
|
<table align="center" class="db_option_table">
|
||||||
<tr>
|
|
||||||
<th colspan="2" class="option_string"> RESTORE DATABASE </th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="restore_db">File:</label></td>
|
<td><label for="restore_db">File:</label></td>
|
||||||
<td><input type="file" name="db_file" class="required" autofocus="autofocus"/></td>
|
<td><input type="file" name="db_file" class="required" autofocus="autofocus"/></td>
|
||||||
|
@ -240,16 +262,20 @@
|
||||||
<td><label for="new_db">New database name:</label></td>
|
<td><label for="new_db">New database name:</label></td>
|
||||||
<td><input type="text" name="new_db" class="required"/></td>
|
<td><input type="text" name="new_db" class="required"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td colspan="2" align="right"><button class="oe_button">Restore</button></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<form id="db_change_password" name="change_pwd_form" method="POST">
|
<form id="db_change_password" name="change_pwd_form" style="display: none;">
|
||||||
|
<div class="oe_view_manager oe_view_manager_current">
|
||||||
|
<div class="oe_view_manager_header" style="padding: 8px;">
|
||||||
|
<div class="oe_header_row">
|
||||||
|
<h2 class="oe_view_title">
|
||||||
|
<span class="oe_view_title_text oe_breadcrumb_title">Change Master Password</span>
|
||||||
|
</h2>
|
||||||
|
<button type="submit" class="oe_button oe_highlight db-change-password">Change Password</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<table align="center" class="db_option_table">
|
<table align="center" class="db_option_table">
|
||||||
<tr>
|
|
||||||
<th colspan="2" class="option_string"> CHANGE MASTER PASSWORD </th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="old_pwd">Master password:</label></td>
|
<td><label for="old_pwd">Master password:</label></td>
|
||||||
<td><input type="password" name="old_pwd" class="required" minlength="1" autofocus="autofocus"/></td>
|
<td><input type="password" name="old_pwd" class="required" minlength="1" autofocus="autofocus"/></td>
|
||||||
|
@ -262,14 +288,26 @@
|
||||||
<td><label for="confirm_pwd">Confirm new master password:</label></td>
|
<td><label for="confirm_pwd">Confirm new master password:</label></td>
|
||||||
<td><input type="password" name="confirm_pwd" class="required" equalTo="input[name=new_pwd]" minlength="1"/> </td>
|
<td><input type="password" name="confirm_pwd" class="required" equalTo="input[name=new_pwd]" minlength="1"/> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td colspan="2" align="right"><button class="oe_button">Change Password</button></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
<t t-name="DatabaseManager.user_menu">
|
||||||
|
<span class="oe_right">
|
||||||
|
<a id="back-to-login" href="#"><span class="oe_topbar_item oe_topbar_name">Back to Login</span></a>
|
||||||
|
</span>
|
||||||
|
</t>
|
||||||
|
<t t-name="DatabaseManager.menu">
|
||||||
|
<div class="oe_secondary_menu_section">Database Management</div>
|
||||||
|
<ul class="oe_secondary_submenu">
|
||||||
|
<li><a href="#db_create">Create</a></li>
|
||||||
|
<li><a href="#db_drop">Drop</a></li>
|
||||||
|
<li><a href="#db_backup">Backup</a></li>
|
||||||
|
<li><a href="#db_restore">Restore</a></li>
|
||||||
|
<li><a href="#db_change_password">Password</a></li>
|
||||||
|
</ul>
|
||||||
|
</t>
|
||||||
|
|
||||||
<t t-name="ChangePassword">
|
<t t-name="ChangePassword">
|
||||||
<form name="change_password_form" method="POST">
|
<form name="change_password_form" method="POST">
|
||||||
|
@ -282,7 +320,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="new_password">New Password:</label></td>
|
<td><label for="new_password">New Password:</label></td>
|
||||||
<td><input type="password" name="new_password"
|
<td><input type="password" name="new_password"
|
||||||
minlength="1" autofocus="autofocus"/></td>
|
minlength="1"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for="confirm_pwd">Confirm Password:</label></td>
|
<td><label for="confirm_pwd">Confirm Password:</label></td>
|
||||||
|
@ -937,6 +975,14 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
<t t-name="FieldTextHtml">
|
||||||
|
<div t-att-class="'oe_form_field oe_form_field_html' + (widget.get('effective_readonly') ? ' oe_form_embedded_html' : '')"
|
||||||
|
t-att-style="widget.node.attrs.style">
|
||||||
|
<t t-if="! widget.get('effective_readonly')">
|
||||||
|
<textarea/>
|
||||||
|
</t>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
<t t-name="web.datepicker">
|
<t t-name="web.datepicker">
|
||||||
<span>
|
<span>
|
||||||
<t t-set="placeholder" t-value="widget.getParent().node and widget.getParent().node.attrs.placeholder"/>
|
<t t-set="placeholder" t-value="widget.getParent().node and widget.getParent().node.attrs.placeholder"/>
|
||||||
|
@ -1245,6 +1291,7 @@
|
||||||
<a class="oe_button oe_selectcreatepopup-search-close oe_bold oe_form_button_cancel" href="javascript:void(0)">Cancel</a>
|
<a class="oe_button oe_selectcreatepopup-search-close oe_bold oe_form_button_cancel" href="javascript:void(0)">Cancel</a>
|
||||||
</t>
|
</t>
|
||||||
<t t-name="AbstractFormPopup.buttons">
|
<t t-name="AbstractFormPopup.buttons">
|
||||||
|
<t t-if="! readonly">
|
||||||
<t t-if="! multi_select">
|
<t t-if="! multi_select">
|
||||||
<button type="button" class="oe_button oe_abstractformpopup-form-save oe_highlight">Save</button>
|
<button type="button" class="oe_button oe_abstractformpopup-form-save oe_highlight">Save</button>
|
||||||
</t>
|
</t>
|
||||||
|
@ -1252,7 +1299,16 @@
|
||||||
<button type="button" class="oe_button oe_abstractformpopup-form-save-new oe_highlight">Save & New</button>
|
<button type="button" class="oe_button oe_abstractformpopup-form-save-new oe_highlight">Save & New</button>
|
||||||
<button type="button" class="oe_button oe_abstractformpopup-form-save oe_highlight">Save & Close</button>
|
<button type="button" class="oe_button oe_abstractformpopup-form-save oe_highlight">Save & Close</button>
|
||||||
</t>
|
</t>
|
||||||
or <a class="oe_button oe_abstractformpopup-form-close oe_bold oe_form_button_cancel" href="javascript:void(0)">Discard</a>
|
or
|
||||||
|
</t>
|
||||||
|
<a class="oe_button oe_abstractformpopup-form-close oe_bold oe_form_button_cancel" href="javascript:void(0)">
|
||||||
|
<t t-if="! readonly">
|
||||||
|
Discard
|
||||||
|
</t>
|
||||||
|
<t t-if="readonly">
|
||||||
|
Close
|
||||||
|
</t>
|
||||||
|
</a>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
<t t-name="One2Many.viewmanager" t-extend="ViewManager">
|
<t t-name="One2Many.viewmanager" t-extend="ViewManager">
|
||||||
|
@ -1469,20 +1525,7 @@
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div t-name="SearchView.addtoreporting" class="oe_searchview_dashboard">
|
|
||||||
<h4>Add to Dashboard</h4>
|
|
||||||
<form>
|
|
||||||
<p><input placeholder="Title of new dashboard item"/></p>
|
|
||||||
<button class="oe_apply" type="submit">Add</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<t t-name="SearchView.addtoreporting.selection">
|
|
||||||
<select>
|
|
||||||
<option t-foreach="selections" t-as="element"
|
|
||||||
t-att-value="element.id || element.res_id ">
|
|
||||||
<t t-esc="element.name"/></option>
|
|
||||||
</select>
|
|
||||||
</t>
|
|
||||||
<div t-name="SearchView.advanced" class="oe_searchview_advanced">
|
<div t-name="SearchView.advanced" class="oe_searchview_advanced">
|
||||||
<h4>Advanced Search</h4>
|
<h4>Advanced Search</h4>
|
||||||
<form>
|
<form>
|
||||||
|
@ -1708,5 +1751,12 @@
|
||||||
<div t-name="Many2ManyKanban.quick_create" class="oe_kanban_quick_create">
|
<div t-name="Many2ManyKanban.quick_create" class="oe_kanban_quick_create">
|
||||||
<input t-att-placeholder="_t('Type name to search')"/>
|
<input t-att-placeholder="_t('Type name to search')"/>
|
||||||
</div>
|
</div>
|
||||||
|
<t t-name="Throbber">
|
||||||
|
<div>
|
||||||
|
<div class="oe_blockui_spin" style="height: 50px">
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div style="color:white">Loading...</div>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
</templates>
|
</templates>
|
||||||
|
|
|
@ -12,7 +12,7 @@ $(document).ready(function () {
|
||||||
// Context n should have base evaluation context + all of contexts
|
// Context n should have base evaluation context + all of contexts
|
||||||
// 0..n-1 in its own evaluation context
|
// 0..n-1 in its own evaluation context
|
||||||
var active_id = 4;
|
var active_id = 4;
|
||||||
var result = openerp.connection.test_eval_contexts([
|
var result = openerp.session.test_eval_contexts([
|
||||||
{
|
{
|
||||||
"__contexts": [
|
"__contexts": [
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test('non-literal_eval_contexts', function () {
|
test('non-literal_eval_contexts', function () {
|
||||||
var result = openerp.connection.test_eval_contexts([{
|
var result = openerp.session.test_eval_contexts([{
|
||||||
"__ref": "compound_context",
|
"__ref": "compound_context",
|
||||||
"__contexts": [
|
"__contexts": [
|
||||||
{"__ref": "context", "__debug": "{'type':parent.type}",
|
{"__ref": "context", "__debug": "{'type':parent.type}",
|
||||||
|
@ -141,9 +141,9 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
test('current_date', function () {
|
test('current_date', function () {
|
||||||
var current_date = openerp.web.date_to_str(new Date());
|
var current_date = openerp.web.date_to_str(new Date());
|
||||||
var result = openerp.connection.test_eval_domains(
|
var result = openerp.session.test_eval_domains(
|
||||||
[[],{"__ref":"domain","__debug":"[('name','>=',current_date),('name','<=',current_date)]","__id":"5dedcfc96648"}],
|
[[],{"__ref":"domain","__debug":"[('name','>=',current_date),('name','<=',current_date)]","__id":"5dedcfc96648"}],
|
||||||
openerp.connection.test_eval_get_context());
|
openerp.session.test_eval_get_context());
|
||||||
deepEqual(result, [
|
deepEqual(result, [
|
||||||
['name', '>=', current_date],
|
['name', '>=', current_date],
|
||||||
['name', '<=', current_date]
|
['name', '<=', current_date]
|
||||||
|
|
|
@ -7,7 +7,7 @@ $(document).ready(function () {
|
||||||
t.module('Dataset shortcuts', 'data');
|
t.module('Dataset shortcuts', 'data');
|
||||||
t.test('read_index', function (openerp) {
|
t.test('read_index', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet(
|
var ds = new openerp.web.DataSet(
|
||||||
{session: openerp.connection}, 'some.model');
|
{session: openerp.session}, 'some.model');
|
||||||
ds.ids = [10, 20, 30, 40, 50];
|
ds.ids = [10, 20, 30, 40, 50];
|
||||||
ds.index = 2;
|
ds.index = 2;
|
||||||
t.expect(ds.read_index(['a', 'b', 'c']), function (result) {
|
t.expect(ds.read_index(['a', 'b', 'c']), function (result) {
|
||||||
|
@ -24,7 +24,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
t.test('default_get', function (openerp) {
|
t.test('default_get', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet(
|
var ds = new openerp.web.DataSet(
|
||||||
{session: openerp.connection}, 'some.model', {foo: 'bar'});
|
{session: openerp.session}, 'some.model', {foo: 'bar'});
|
||||||
t.expect(ds.default_get(['a', 'b', 'c']), function (result) {
|
t.expect(ds.default_get(['a', 'b', 'c']), function (result) {
|
||||||
strictEqual(result.method, 'default_get');
|
strictEqual(result.method, 'default_get');
|
||||||
strictEqual(result.model, 'some.model');
|
strictEqual(result.model, 'some.model');
|
||||||
|
@ -38,7 +38,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('create', function (openerp) {
|
t.test('create', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'some.model');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'some.model');
|
||||||
t.expect(ds.create({foo: 1, bar: 2}), function (r) {
|
t.expect(ds.create({foo: 1, bar: 2}), function (r) {
|
||||||
strictEqual(r.method, 'create');
|
strictEqual(r.method, 'create');
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('write', function (openerp) {
|
t.test('write', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.write(42, {foo: 1}), function (r) {
|
t.expect(ds.write(42, {foo: 1}), function (r) {
|
||||||
strictEqual(r.method, 'write');
|
strictEqual(r.method, 'write');
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ $(document).ready(function () {
|
||||||
// });
|
// });
|
||||||
});
|
});
|
||||||
t.test('unlink', function (openerp) {
|
t.test('unlink', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.unlink([42]), function (r) {
|
t.expect(ds.unlink([42]), function (r) {
|
||||||
strictEqual(r.method, 'unlink');
|
strictEqual(r.method, 'unlink');
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('call', function (openerp) {
|
t.test('call', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.call('frob', ['a', 'b', 42]), function (r) {
|
t.expect(ds.call('frob', ['a', 'b', 42]), function (r) {
|
||||||
strictEqual(r.method, 'frob');
|
strictEqual(r.method, 'frob');
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('name_get', function (openerp) {
|
t.test('name_get', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.name_get([1, 2], null), function (r) {
|
t.expect(ds.name_get([1, 2], null), function (r) {
|
||||||
strictEqual(r.method, 'name_get');
|
strictEqual(r.method, 'name_get');
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('name_search, name', function (openerp) {
|
t.test('name_search, name', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.name_search('bob'), function (r) {
|
t.expect(ds.name_search('bob'), function (r) {
|
||||||
strictEqual(r.method, 'name_search');
|
strictEqual(r.method, 'name_search');
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('name_search, domain & operator', function (openerp) {
|
t.test('name_search, domain & operator', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.name_search(0, [['foo', '=', 3]], 'someop'), function (r) {
|
t.expect(ds.name_search(0, [['foo', '=', 3]], 'someop'), function (r) {
|
||||||
strictEqual(r.method, 'name_search');
|
strictEqual(r.method, 'name_search');
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('exec_workflow', function (openerp) {
|
t.test('exec_workflow', function (openerp) {
|
||||||
var ds = new openerp.web.DataSet({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.exec_workflow(42, 'foo'), function (r) {
|
t.expect(ds.exec_workflow(42, 'foo'), function (r) {
|
||||||
strictEqual(r['service'], 'object');
|
strictEqual(r['service'], 'object');
|
||||||
strictEqual(r.method, 'exec_workflow');
|
strictEqual(r.method, 'exec_workflow');
|
||||||
|
@ -147,7 +147,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
t.test('DataSetSearch#read_slice', function (openerp) {
|
t.test('DataSetSearch#read_slice', function (openerp) {
|
||||||
var ds = new openerp.web.DataSetSearch({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSetSearch({session: openerp.session}, 'mod');
|
||||||
t.expect(ds.read_slice(['foo', 'bar'], {
|
t.expect(ds.read_slice(['foo', 'bar'], {
|
||||||
domain: [['foo', '>', 42], ['qux', '=', 'grault']],
|
domain: [['foo', '>', 42], ['qux', '=', 'grault']],
|
||||||
context: {peewee: 'herman'},
|
context: {peewee: 'herman'},
|
||||||
|
@ -167,7 +167,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
t.test('DataSetSearch#read_slice sorted', function (openerp) {
|
t.test('DataSetSearch#read_slice sorted', function (openerp) {
|
||||||
var ds = new openerp.web.DataSetSearch({session: openerp.connection}, 'mod');
|
var ds = new openerp.web.DataSetSearch({session: openerp.session}, 'mod');
|
||||||
ds.sort('foo');
|
ds.sort('foo');
|
||||||
ds.sort('foo');
|
ds.sort('foo');
|
||||||
ds.sort('bar');
|
ds.sort('bar');
|
||||||
|
@ -194,7 +194,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
t.test('Dataset', function (openerp) {
|
t.test('Dataset', function (openerp) {
|
||||||
var ds = new openerp.web.DataSetSearch(
|
var ds = new openerp.web.DataSetSearch(
|
||||||
{session: openerp.connection}, 'mod');
|
{session: openerp.session}, 'mod');
|
||||||
var c = new openerp.web.CompoundContext(
|
var c = new openerp.web.CompoundContext(
|
||||||
{a: 'foo', b: 3, c: 5}, openerp.contexts[0]);
|
{a: 'foo', b: 3, c: 5}, openerp.contexts[0]);
|
||||||
t.expect(ds.read_slice(['foo', 'bar'], {
|
t.expect(ds.read_slice(['foo', 'bar'], {
|
||||||
|
@ -220,7 +220,7 @@ $(document).ready(function () {
|
||||||
parent: {model: 'qux'}
|
parent: {model: 'qux'}
|
||||||
};
|
};
|
||||||
var ds = new openerp.web.DataSet(
|
var ds = new openerp.web.DataSet(
|
||||||
{session: openerp.connection}, 'mod',
|
{session: openerp.session}, 'mod',
|
||||||
new openerp.web.CompoundContext({})
|
new openerp.web.CompoundContext({})
|
||||||
.set_eval_context(eval_context));
|
.set_eval_context(eval_context));
|
||||||
var domain = new openerp.web.CompoundDomain(openerp.domains[0])
|
var domain = new openerp.web.CompoundDomain(openerp.domains[0])
|
||||||
|
|
|
@ -87,10 +87,10 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
asyncTest('toggle-edition-save', 4, function () {
|
asyncTest('toggle-edition-save', 4, function () {
|
||||||
instance.connection.responses['/web/dataset/call_kw:create'] = function () {
|
instance.session.responses['/web/dataset/call_kw:create'] = function () {
|
||||||
return { result: 42 };
|
return { result: 42 };
|
||||||
};
|
};
|
||||||
instance.connection.responses['/web/dataset/call_kw:read'] = function () {
|
instance.session.responses['/web/dataset/call_kw:read'] = function () {
|
||||||
return { result: [{
|
return { result: [{
|
||||||
id: 42,
|
id: 42,
|
||||||
a: false,
|
a: false,
|
||||||
|
@ -125,7 +125,7 @@ $(document).ready(function () {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
asyncTest('toggle-edition-cancel', 2, function () {
|
asyncTest('toggle-edition-cancel', 2, function () {
|
||||||
instance.connection.responses['/web/dataset/call_kw:create'] = function () {
|
instance.session.responses['/web/dataset/call_kw:create'] = function () {
|
||||||
return { result: 42 };
|
return { result: 42 };
|
||||||
};
|
};
|
||||||
var e = new instance.web.list.Editor({
|
var e = new instance.web.list.Editor({
|
||||||
|
@ -153,7 +153,7 @@ $(document).ready(function () {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
asyncTest('toggle-save-required', 2, function () {
|
asyncTest('toggle-save-required', 2, function () {
|
||||||
instance.connection.responses['/web/dataset/call_kw:create'] = function () {
|
instance.session.responses['/web/dataset/call_kw:create'] = function () {
|
||||||
return { result: 42 };
|
return { result: 42 };
|
||||||
};
|
};
|
||||||
var e = new instance.web.list.Editor({
|
var e = new instance.web.list.Editor({
|
||||||
|
@ -191,7 +191,7 @@ $(document).ready(function () {
|
||||||
baseSetup();
|
baseSetup();
|
||||||
|
|
||||||
var records = {};
|
var records = {};
|
||||||
_.extend(instance.connection.responses, {
|
_.extend(instance.session.responses, {
|
||||||
'/web/listview/load': function () {
|
'/web/listview/load': function () {
|
||||||
return {result: {
|
return {result: {
|
||||||
type: 'tree',
|
type: 'tree',
|
||||||
|
@ -227,7 +227,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
asyncTest('newrecord', 6, function () {
|
asyncTest('newrecord', 6, function () {
|
||||||
var got_defaults = false;
|
var got_defaults = false;
|
||||||
instance.connection.responses['/web/dataset/call_kw:default_get'] = function (params) {
|
instance.session.responses['/web/dataset/call_kw:default_get'] = function (params) {
|
||||||
var fields = params.params.args[0];
|
var fields = params.params.args[0];
|
||||||
deepEqual(
|
deepEqual(
|
||||||
fields, ['a', 'b', 'c'],
|
fields, ['a', 'b', 'c'],
|
||||||
|
@ -267,7 +267,7 @@ $(document).ready(function () {
|
||||||
module('list-edition-events', {
|
module('list-edition-events', {
|
||||||
setup: function () {
|
setup: function () {
|
||||||
baseSetup();
|
baseSetup();
|
||||||
_.extend(instance.connection.responses, {
|
_.extend(instance.session.responses, {
|
||||||
'/web/listview/load': function () {
|
'/web/listview/load': function () {
|
||||||
return {result: {
|
return {result: {
|
||||||
type: 'tree',
|
type: 'tree',
|
||||||
|
|
|
@ -164,8 +164,8 @@ $(document).ready(function () {
|
||||||
instance.dummy = {};
|
instance.dummy = {};
|
||||||
instance.dummy.DummyWidget = instance.web.search.Field.extend(
|
instance.dummy.DummyWidget = instance.web.search.Field.extend(
|
||||||
dummy_widget_attributes || {});
|
dummy_widget_attributes || {});
|
||||||
if (!('/web/searchview/load' in instance.connection.responses)) {
|
if (!('/web/searchview/load' in instance.session.responses)) {
|
||||||
instance.connection.responses['/web/searchview/load'] = function () {
|
instance.session.responses['/web/searchview/load'] = function () {
|
||||||
return {result: {fields_view: {
|
return {result: {fields_view: {
|
||||||
type: 'search',
|
type: 'search',
|
||||||
fields: {
|
fields: {
|
||||||
|
@ -186,10 +186,10 @@ $(document).ready(function () {
|
||||||
}}};
|
}}};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
instance.connection.responses['/web/searchview/get_filters'] = function () {
|
instance.session.responses['/web/searchview/get_filters'] = function () {
|
||||||
return {result: []};
|
return {result: []};
|
||||||
};
|
};
|
||||||
instance.connection.responses['/web/searchview/fields_get'] = function () {
|
instance.session.responses['/web/searchview/fields_get'] = function () {
|
||||||
return {result: {fields: {
|
return {result: {fields: {
|
||||||
dummy: {type: 'char', string: 'Dummy'}
|
dummy: {type: 'char', string: 'Dummy'}
|
||||||
}}};
|
}}};
|
||||||
|
@ -321,7 +321,7 @@ $(document).ready(function () {
|
||||||
{attrs: {name: 'dummy', string: 'Dummy'}},
|
{attrs: {name: 'dummy', string: 'Dummy'}},
|
||||||
{relation: 'dummy.model.name'},
|
{relation: 'dummy.model.name'},
|
||||||
view);
|
view);
|
||||||
instance.connection.responses['/web/dataset/call_kw'] = function (req) {
|
instance.session.responses['/web/dataset/call_kw'] = function (req) {
|
||||||
equal(req.params.method, 'name_get',
|
equal(req.params.method, 'name_get',
|
||||||
"m2o should resolve default id");
|
"m2o should resolve default id");
|
||||||
equal(req.params.model, f.attrs.relation,
|
equal(req.params.model, f.attrs.relation,
|
||||||
|
@ -357,7 +357,7 @@ $(document).ready(function () {
|
||||||
{attrs: {name: 'dummy', string: 'Dummy'}},
|
{attrs: {name: 'dummy', string: 'Dummy'}},
|
||||||
{relation: 'dummy.model.name'},
|
{relation: 'dummy.model.name'},
|
||||||
view);
|
view);
|
||||||
instance.connection.responses['/web/dataset/call_kw'] = function (req) {
|
instance.session.responses['/web/dataset/call_kw'] = function (req) {
|
||||||
return {result: []};
|
return {result: []};
|
||||||
};
|
};
|
||||||
f.facet_for_defaults({dummy: id})
|
f.facet_for_defaults({dummy: id})
|
||||||
|
@ -573,7 +573,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
asyncTest("M2O", 15, function () {
|
asyncTest("M2O", 15, function () {
|
||||||
instance.connection.responses['/web/dataset/call_kw'] = function (req) {
|
instance.session.responses['/web/dataset/call_kw'] = function (req) {
|
||||||
equal(req.params.method, "name_search");
|
equal(req.params.method, "name_search");
|
||||||
equal(req.params.model, "dummy.model");
|
equal(req.params.model, "dummy.model");
|
||||||
deepEqual(req.params.args, []);
|
deepEqual(req.params.args, []);
|
||||||
|
@ -607,7 +607,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
asyncTest("M2O no match", 5, function () {
|
asyncTest("M2O no match", 5, function () {
|
||||||
instance.connection.responses['/web/dataset/call_kw'] = function (req) {
|
instance.session.responses['/web/dataset/call_kw'] = function (req) {
|
||||||
equal(req.params.method, "name_search");
|
equal(req.params.method, "name_search");
|
||||||
equal(req.params.model, "dummy.model");
|
equal(req.params.model, "dummy.model");
|
||||||
deepEqual(req.params.args, []);
|
deepEqual(req.params.args, []);
|
||||||
|
@ -1070,7 +1070,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
asyncTest('checkboxing', 6, function () {
|
asyncTest('checkboxing', 6, function () {
|
||||||
var view = makeSearchView();
|
var view = makeSearchView();
|
||||||
instance.connection.responses['/web/searchview/get_filters'] = function () {
|
instance.session.responses['/web/searchview/get_filters'] = function () {
|
||||||
return {result: [{
|
return {result: [{
|
||||||
name: "filter name",
|
name: "filter name",
|
||||||
user_id: 42
|
user_id: 42
|
||||||
|
@ -1099,7 +1099,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
asyncTest('removal', 1, function () {
|
asyncTest('removal', 1, function () {
|
||||||
var view = makeSearchView();
|
var view = makeSearchView();
|
||||||
instance.connection.responses['/web/searchview/get_filters'] = function () {
|
instance.session.responses['/web/searchview/get_filters'] = function () {
|
||||||
return {result: [{
|
return {result: [{
|
||||||
name: "filter name",
|
name: "filter name",
|
||||||
user_id: 42
|
user_id: 42
|
||||||
|
|
|
@ -33,28 +33,28 @@ openerp.testing = (function () {
|
||||||
instance.web.qweb.add_template(doc);
|
instance.web.qweb.add_template(doc);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Alter provided instance's ``connection`` attribute to make response
|
* Alter provided instance's ``session`` attribute to make response
|
||||||
* mockable:
|
* mockable:
|
||||||
*
|
*
|
||||||
* * The ``responses`` parameter can be used to provide a map of (RPC)
|
* * The ``responses`` parameter can be used to provide a map of (RPC)
|
||||||
* paths (e.g. ``/web/view/load``) to a function returning a response
|
* paths (e.g. ``/web/view/load``) to a function returning a response
|
||||||
* to the query.
|
* to the query.
|
||||||
* * ``instance,connection`` grows a ``responses`` attribute which is
|
* * ``instance.session`` grows a ``responses`` attribute which is
|
||||||
* a map of the same (and is in fact initialized to the ``responses``
|
* a map of the same (and is in fact initialized to the ``responses``
|
||||||
* parameter if one is provided)
|
* parameter if one is provided)
|
||||||
*
|
*
|
||||||
* Note that RPC requests to un-mocked URLs will be rejected with an
|
* Note that RPC requests to un-mocked URLs will be rejected with an
|
||||||
* error message: only explicitly specified urls will get a response.
|
* error message: only explicitly specified urls will get a response.
|
||||||
*
|
*
|
||||||
* Mocked connections will *never* perform an actual RPC connection.
|
* Mocked sessions will *never* perform an actual RPC connection.
|
||||||
*
|
*
|
||||||
* @param instance openerp instance being initialized
|
* @param instance openerp instance being initialized
|
||||||
* @param {Object} [responses]
|
* @param {Object} [responses]
|
||||||
*/
|
*/
|
||||||
mockifyRPC: function (instance, responses) {
|
mockifyRPC: function (instance, responses) {
|
||||||
var connection = instance.connection;
|
var session = instance.session;
|
||||||
connection.responses = responses || {};
|
session.responses = responses || {};
|
||||||
connection.rpc_function = function (url, payload) {
|
session.rpc_function = function (url, payload) {
|
||||||
var fn = this.responses[url.url + ':' + payload.params.method]
|
var fn = this.responses[url.url + ':' + payload.params.method]
|
||||||
|| this.responses[url.url];
|
|| this.responses[url.url];
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
"X-Poedit-Language: Czech\n"
|
"X-Poedit-Language: Czech\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -15,8 +15,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:46+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
|
@ -14,8 +14,8 @@ msgstr ""
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Launchpad-Export-Date: 2012-08-08 04:45+0000\n"
|
"X-Launchpad-Export-Date: 2012-08-15 04:50+0000\n"
|
||||||
"X-Generator: Launchpad (build 15757)\n"
|
"X-Generator: Launchpad (build 15801)\n"
|
||||||
|
|
||||||
#. openerp-web
|
#. openerp-web
|
||||||
#: addons/web_calendar/static/src/js/calendar.js:11
|
#: addons/web_calendar/static/src/js/calendar.js:11
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue