diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 453484acee7..e23a0431a7c 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -227,7 +227,7 @@ class HttpRequest(WebRequest): _logger.debug("%s --> %s.%s %r", self.httprequest.method, controller.__class__.__name__, method.__name__, akw) r = method(controller, self, **self.params) if self.debug or 1: - if isinstance(r, werkzeug.wrappers.BaseResponse): + if isinstance(r, (werkzeug.wrappers.BaseResponse, werkzeug.exceptions.HTTPException)): _logger.debug('<-- %s', r) else: _logger.debug("<-- size: %s", len(r)) @@ -296,6 +296,35 @@ def session_context(request, storage_path, session_cookie='sessionid'): try: yield request.session finally: + # Remove all OpenERPSession instances with no uid, they're generated + # either by login process or by HTTP requests without an OpenERP + # session id, and are generally noise + for key, value in request.session.items(): + if isinstance(value, session.OpenERPSession) and not value._uid: + del request.session[key] + + # FIXME: remove this when non-literals disappear + if sid: + # Re-load sessions from storage and merge non-literal + # contexts and domains (they're indexed by hash of the + # content so conflicts should auto-resolve), otherwise if + # two requests alter those concurrently the last to finish + # will overwrite the previous one, leading to loss of data + # (a non-literal is lost even though it was sent to the + # client and client errors) + # + # note that domains_store and contexts_store are append-only (we + # only ever add items to them), so we can just update one with the + # other to get the right result, if we want to merge the + # ``context`` dict we'll need something smarter + in_store = session_store.get(sid) + for k, v in request.session.iteritems(): + stored = in_store.get(k) + if stored and isinstance(v, session.OpenERPSession)\ + and v != stored: + v.contexts_store.update(stored.contexts_store) + v.domains_store.update(stored.domains_store) + session_store.save(request.session) #---------------------------------------------------------- @@ -395,7 +424,8 @@ class Root(object): else: response = result - response.set_cookie(self.session_cookie, session.sid) + if hasattr(response, 'set_cookie'): + response.set_cookie(self.session_cookie, session.sid) return response(environ, start_response) @@ -437,8 +467,8 @@ class Root(object): :returns: a callable matching the path sections, or ``None`` :rtype: ``Controller | None`` """ - if len(l) > 1: - for i in range(len(l), 1, -1): + if len(l): + for i in range(len(l), 0, -1): ps = "/" + "/".join(l[0:i]) if ps in controllers_path: c = controllers_path[ps] diff --git a/addons/web/common/nonliterals.py b/addons/web/common/nonliterals.py index 986ca36cb2f..f6e81894a4c 100644 --- a/addons/web/common/nonliterals.py +++ b/addons/web/common/nonliterals.py @@ -21,12 +21,14 @@ class NonLiteralEncoder(simplejson.encoder.JSONEncoder): if isinstance(object, Domain): return { '__ref': 'domain', - '__id': object.key + '__id': object.key, + '__debug': object.get_domain_string() } elif isinstance(object, Context): return { '__ref': 'context', - '__id': object.key + '__id': object.key, + '__debug': object.get_context_string() } elif isinstance(object, CompoundDomain): return { @@ -42,7 +44,7 @@ class NonLiteralEncoder(simplejson.encoder.JSONEncoder): } raise TypeError('Could not encode unknown non-literal %s' % object) -_ALLOWED_KEYS = frozenset(['__ref', "__id", '__domains', +_ALLOWED_KEYS = frozenset(['__ref', "__id", '__domains', '__debug', '__contexts', '__eval_context', 'own_values']) def non_literal_decoder(dct): @@ -53,8 +55,8 @@ def non_literal_decoder(dct): ``own_values`` dict key. """ if '__ref' in dct: - for x in dct.keys(): - if not x in _ALLOWED_KEYS: + for x in dct: + if x not in _ALLOWED_KEYS: raise ValueError("'%s' key not allowed in non literal domain/context" % x) if dct['__ref'] == 'domain': domain = Domain(None, key=dct['__id']) @@ -131,7 +133,10 @@ class Domain(BaseDomain): ctx = self.session.evaluation_context(context) if self.own: ctx.update(self.own) - return eval(self.get_domain_string(), SuperDict(ctx)) + try: + return eval(self.get_domain_string(), SuperDict(ctx)) + except NameError as e: + raise ValueError('Error during evaluation of this domain: "%s", message: "%s"' % (self.get_domain_string(), e.message)) class Context(BaseContext): def __init__(self, session, context_string=None, key=None): @@ -176,7 +181,10 @@ class Context(BaseContext): ctx = self.session.evaluation_context(context) if self.own: ctx.update(self.own) - return eval(self.get_context_string(), SuperDict(ctx)) + try: + return eval(self.get_context_string(), SuperDict(ctx)) + except NameError as e: + raise ValueError('Error during evaluation of this context: "%s", message: "%s"' % (self.get_context_string(), e.message)) class SuperDict(dict): def __getattr__(self, name): diff --git a/addons/web/common/openerplib/main.py b/addons/web/common/openerplib/main.py index 217cb221cd9..5cae9ce4636 100644 --- a/addons/web/common/openerplib/main.py +++ b/addons/web/common/openerplib/main.py @@ -350,7 +350,7 @@ class Connection(object): return if not self.database or not self.login or self.password is None: - raise AuthenticationError("Creditentials not provided") + raise AuthenticationError("Credentials not provided") self.user_id = self.get_service("common").login(self.database, self.login, self.password) if not self.user_id: diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 7ca80fbfdec..6cc46b476a9 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -9,7 +9,6 @@ import operator import os import re import simplejson -import textwrap import time import xmlrpclib import zlib @@ -25,8 +24,7 @@ openerpweb = web.common.http # OpenERP Web web Controllers #---------------------------------------------------------- -# TODO change into concat_file(addons,key) taking care of addons_path -def concat_files(addons_path, file_list): +def concat_files(file_list): """ Concatenate file content return (concat,timestamp) concat: concatenation of file content @@ -34,8 +32,7 @@ def concat_files(addons_path, file_list): """ files_content = [] files_timestamp = 0 - for i in file_list: - fname = os.path.join(addons_path, i[1:]) + for fname in file_list: ftime = os.path.getmtime(fname) if ftime > files_timestamp: files_timestamp = ftime @@ -43,25 +40,25 @@ def concat_files(addons_path, file_list): files_concat = "".join(files_content) return files_concat,files_timestamp -home_template = textwrap.dedent(""" +html_template = """ OpenERP %(css)s - %(javascript)s + %(js)s -""") +""" + class WebClient(openerpweb.Controller): _cp_path = "/web/webclient" @@ -70,62 +67,61 @@ class WebClient(openerpweb.Controller): return addons def manifest_glob(self, req, addons, key): - if addons==None: + if addons is None: addons = self.server_wide_modules(req) else: addons = addons.split(',') - files = [] for addon in addons: manifest = openerpweb.addons_manifest.get(addon, None) if not manifest: continue - addons_path = manifest['addons_path'] + # ensure does not ends with / + addons_path = os.path.join(manifest['addons_path'], '')[:-1] globlist = manifest.get(key, []) for pattern in globlist: - for path in glob.glob(os.path.join(addons_path, addon, pattern)): - files.append(path[len(addons_path):]) - return files + for path in glob.glob(os.path.normpath(os.path.join(addons_path, addon, pattern))): + yield path, path[len(addons_path):] + + def manifest_list(self, req, mods, extension): + if not req.debug: + path = '/web/webclient/' + extension + if mods is not None: + path += '?mods=' + mods + return [path] + return ['%s?debug=%s' % (wp, os.path.getmtime(fp)) for fp, wp in self.manifest_glob(req, mods, extension)] @openerpweb.jsonrequest def csslist(self, req, mods=None): - return self.manifest_glob(req, mods, 'css') + return self.manifest_list(req, mods, 'css') @openerpweb.jsonrequest def jslist(self, req, mods=None): - return self.manifest_glob(req, mods, 'js') + return self.manifest_list(req, mods, 'js') @openerpweb.httprequest def css(self, req, mods=None): - files = self.manifest_glob(req, mods, 'css') - content,timestamp = concat_files(req.config.addons_path, files) - # TODO request set the Date of last modif and Etag + files = [f[0] for f in self.manifest_glob(req, mods, 'css')] + content,timestamp = concat_files(files) + # TODO use timestamp to set Last mofified date and E-tag return req.make_response(content, [('Content-Type', 'text/css')]) @openerpweb.httprequest def js(self, req, mods=None): - files = self.manifest_glob(req, mods, 'js') - content,timestamp = concat_files(req.config.addons_path, files) - # TODO request set the Date of last modif and Etag + files = [f[0] for f in self.manifest_glob(req, mods, 'js')] + content,timestamp = concat_files(files) + # TODO use timestamp to set Last mofified date and E-tag return req.make_response(content, [('Content-Type', 'application/javascript')]) @openerpweb.httprequest def home(self, req, s_action=None, **kw): - # script tags - jslist = ['/web/webclient/js'] - if req.debug: - jslist = [i + '?debug=' + str(time.time()) for i in self.manifest_glob(req, None, 'js')] - js = "\n ".join([''%i for i in jslist]) + js = "\n ".join(''%i for i in self.manifest_list(req, None, 'js')) + css = "\n ".join(''%i for i in self.manifest_list(req, None, 'css')) - # css tags - csslist = ['/web/webclient/css'] - if req.debug: - csslist = [i + '?debug=' + str(time.time()) for i in self.manifest_glob(req, None, 'css')] - css = "\n ".join([''%i for i in csslist]) - - r = home_template % { - 'javascript': js, + r = html_template % { + 'js': js, 'css': css, 'modules': simplejson.dumps(self.server_wide_modules(req)), + 'init': 'new s.web.WebClient("oe").start();', } return r @@ -445,18 +441,24 @@ def load_actions_from_ir_values(req, key, key2, models, meta): return [(id, name, clean_action(req, action)) for id, name, action in actions] -def clean_action(req, action): +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) - # values come from the server, we can just eval them - if isinstance(action.get('context'), basestring): - action['context'] = eval( action['context'], eval_ctx ) or {} - - if isinstance(action.get('domain'), basestring): - action['domain'] = eval( action['domain'], eval_ctx ) or [] + if not do_not_eval: + # values come from the server, we can just eval them + if isinstance(action.get('context'), basestring): + action['context'] = eval( action['context'], eval_ctx ) or {} + + if 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) if 'type' not in action: action['type'] = 'ir.actions.act_window_close' @@ -524,7 +526,7 @@ def fix_view_modes(action): if 'views' not in action: generate_views(action) - if action.pop('view_type') != 'form': + if action.pop('view_type', 'form') != 'form': return action action['views'] = [ @@ -790,9 +792,9 @@ class View(openerpweb.Controller): for view in field["views"].itervalues(): self.process_view(session, view, None, transform) if field.get('domain'): - field["domain"] = self.parse_domain(field["domain"], session) + field["domain"] = parse_domain(field["domain"], session) if field.get('context'): - field["context"] = self.parse_context(field["context"], session) + field["context"] = parse_context(field["context"], session) def process_toolbar(self, req, toolbar): """ @@ -804,10 +806,10 @@ class View(openerpweb.Controller): for actions in toolbar.itervalues(): for action in actions: if 'context' in action: - action['context'] = self.parse_context( + action['context'] = parse_context( action['context'], req.session) if 'domain' in action: - action['domain'] = self.parse_domain( + action['domain'] = parse_domain( action['domain'], req.session) @openerpweb.jsonrequest @@ -846,39 +848,6 @@ class View(openerpweb.Controller): self.parse_domains_and_contexts(elem, session) return root - def parse_domain(self, domain, session): - """ Parses an arbitrary string containing a domain, transforms it - to either a literal domain or a :class:`web.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, (str, unicode)): - return domain - try: - return ast.literal_eval(domain) - except ValueError: - # not a literal - return web.common.nonliterals.Domain(session, domain) - - def parse_context(self, context, session): - """ Parses an arbitrary string containing a context, transforms it - to either a literal context or a :class:`web.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, (str, unicode)): - return context - try: - return ast.literal_eval(context) - except ValueError: - return web.common.nonliterals.Context(session, context) - def parse_domains_and_contexts(self, elem, session): """ Converts domains and contexts from the view into Python objects, either literals if they can be parsed by literal_eval or a special @@ -893,16 +862,49 @@ class View(openerpweb.Controller): for el in ['domain', 'filter_domain']: domain = elem.get(el, '').strip() if domain: - elem.set(el, self.parse_domain(domain, session)) + elem.set(el, parse_domain(domain, session)) for el in ['context', 'default_get']: context_string = elem.get(el, '').strip() if context_string: - elem.set(el, self.parse_context(context_string, session)) + elem.set(el, parse_context(context_string, session)) @openerpweb.jsonrequest def load(self, req, model, view_id, view_type, toolbar=False): 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:`web.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, (str, unicode)): + return domain + try: + return ast.literal_eval(domain) + except ValueError: + # not a literal + return web.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:`web.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, (str, unicode)): + return context + try: + return ast.literal_eval(context) + except ValueError: + return web.common.nonliterals.Context(session, context) + class ListView(View): _cp_path = "/web/listview" @@ -948,9 +950,9 @@ class SearchView(View): for field in fields.values(): # shouldn't convert the views too? if field.get('domain'): - field["domain"] = self.parse_domain(field["domain"], req.session) + field["domain"] = parse_domain(field["domain"], req.session) if field.get('context'): - field["context"] = self.parse_domain(field["context"], req.session) + field["context"] = parse_context(field["context"], req.session) return {'fields': fields} @openerpweb.jsonrequest @@ -958,8 +960,8 @@ class SearchView(View): Model = req.session.model("ir.filters") filters = Model.get_filters(model) for filter in filters: - filter["context"] = req.session.eval_context(self.parse_context(filter["context"], req.session)) - filter["domain"] = req.session.eval_domain(self.parse_domain(filter["domain"], req.session)) + filter["context"] = req.session.eval_context(parse_context(filter["context"], req.session)) + filter["domain"] = req.session.eval_domain(parse_domain(filter["domain"], req.session)) return filters @openerpweb.jsonrequest @@ -1007,8 +1009,11 @@ class Binary(openerpweb.Controller): def saveas(self, req, model, id, field, fieldname, **kw): Model = req.session.model(model) context = req.session.eval_context(req.context) - res = Model.read([int(id)], [field, fieldname], context)[0] - filecontent = res.get(field, '') + if id: + res = Model.read([int(id)], [field, fieldname], context)[0] + else: + res = Model.default_get([field, fieldname], context) + filecontent = base64.b64decode(res.get(field, '')) if not filecontent: return req.not_found() else: @@ -1072,7 +1077,7 @@ class Action(openerpweb.Controller): _cp_path = "/web/action" @openerpweb.jsonrequest - def load(self, req, action_id): + def load(self, req, action_id, do_not_eval=False): Actions = req.session.model('ir.actions.actions') value = False context = req.session.eval_context(req.context) @@ -1084,7 +1089,7 @@ class Action(openerpweb.Controller): ctx.update(context) action = req.session.model(action_type[0]['type']).read([action_id], False, ctx) if action: - value = clean_action(req, action[0]) + value = clean_action(req, action[0], do_not_eval) return {'result': value} @openerpweb.jsonrequest @@ -1368,10 +1373,9 @@ class Reports(View): if 'report_type' in action: report_data['report_type'] = action['report_type'] if 'datas' in action: - if 'form' in action['datas']: - report_data['form'] = action['datas']['form'] if 'ids' in action['datas']: - report_ids = action['datas']['ids'] + report_ids = action['datas'].pop('ids') + report_data.update(action['datas']) report_id = report_srv.report( req.session._db, req.session._uid, req.session._password, @@ -1408,7 +1412,7 @@ class Import(View): return fields @openerpweb.httprequest - def detect_data(self, req, csvfile, csvsep, csvdel, csvcode, jsonp): + def detect_data(self, req, csvfile, csvsep=',', csvdel='"', csvcode='utf-8', jsonp='callback'): try: data = list(csv.reader( csvfile, quotechar=str(csvdel), delimiter=str(csvsep))) diff --git a/addons/web/po/es.po b/addons/web/po/es.po new file mode 100644 index 00000000000..508b4e62245 --- /dev/null +++ b/addons/web/po/es.po @@ -0,0 +1,710 @@ +# Spanish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-19 07:27+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web/static/src/js/view_form.js:355 +msgid "" +"Warning, the record has been modified, your changes will be discarded." +msgstr "" +"Advertencia, el registro se ha modificado, los cambios serán descartados." + +#: addons/web/static/src/js/view_form.js:1659 +msgid "   Search More..." +msgstr "   Buscar más..." + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "   Crear \"%s\"" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "   Crear y Editar..." + +#: addons/web/static/src/js/views.js:568 +msgid "You must choose at least one record." +msgstr "Debe seleccionar al menos un registro." + +#: addons/web/static/src/js/views.js:569 +msgid "Warning" +msgstr "Advertencia" + +#: addons/web/static/src/js/views.js:609 +msgid "Translations" +msgstr "Traducciones" + +#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0 +msgid "Save" +msgstr "Guardar" + +#: addons/web/static/src/js/views.js:615 +msgid "Close" +msgstr "Cerrar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "x" +msgstr "x" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{title}" +msgstr "#{title}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{text}" +msgstr "#{text}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Powered by" +msgstr "Desarrollado por" + +#: addons/web/static/src/xml/base.xml:0 +msgid "openerp.com" +msgstr "openerp.com" + +#: addons/web/static/src/xml/base.xml:0 +msgid "." +msgstr "." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Loading..." +msgstr "Cargando…" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create" +msgstr "Crear" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Drop" +msgstr "Eliminar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Backup" +msgstr "Copia de seguridad" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Restore" +msgstr "Restaurar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password" +msgstr "Contraseña" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Back to Login" +msgstr "Volver al Inicio de sesión" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CREATE DATABASE" +msgstr "CREAR BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master password:" +msgstr "Contraseña maestra" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New database name:" +msgstr "Nombre de la nueva base de datos:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Load Demonstration data:" +msgstr "Cargar datos de demostración:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Default language:" +msgstr "Idioma por defecto:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Admin password:" +msgstr "Contraseña de Admin:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm password:" +msgstr "Confirmar contraseña:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "DROP DATABASE" +msgstr "ELIMINAR BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database:" +msgstr "Base de datos:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master Password:" +msgstr "Contraseña Maestra" + +#: addons/web/static/src/xml/base.xml:0 +msgid "BACKUP DATABASE" +msgstr "COPIA DE SEGURIDAD DE LA BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "RESTORE DATABASE" +msgstr "RESTAURAR BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "File:" +msgstr "Archivo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CHANGE MASTER PASSWORD" +msgstr "CAMBIAR CONTRASEÑA MAESTRA" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New master password:" +msgstr "Nueva contraseña maestra:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm new master password:" +msgstr "Confirmar nueva contraseña maestra:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "User:" +msgstr "Usuario:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password:" +msgstr "Contraseña:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database" +msgstr "Database" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Login" +msgstr "Inicio de sesión" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Bad username or password" +msgstr "Nombre de usuario o contraseña incorrectos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"We think that daily job activities can be more intuitive, efficient, " +"automated, .. and even fun." +msgstr "" +"Creemos que las actividades diarias de trabajo pueden ser más intuitivas, " +"eficientes y automatizadas, .. e incluso divertidas." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP's vision to be:" +msgstr "Los objetivos de OpenERP son ser:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Full featured" +msgstr "Con todas las funciones" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Today's enterprise challenges are multiple. We provide one module for each " +"need." +msgstr "" +"Los retos actuales de la empresa son múltiples. Ofrecemos un módulo para " +"cada necesidad." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open Source" +msgstr "Código abierto" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"To Build a great product, we rely on the knowledge of thousands of " +"contributors." +msgstr "" +"Para construir un gran producto, contamos con los conocimientos de miles de " +"contribuyentes." + +#: addons/web/static/src/xml/base.xml:0 +msgid "User Friendly" +msgstr "Fácil de usar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"In order to be productive, people need clean and easy to use interface." +msgstr "" +"Con el fin de ser productivo, la gente necesita una interfaz clara y fácil " +"de usar." + +#: addons/web/static/src/xml/base.xml:0 +msgid "(" +msgstr "(" + +#: addons/web/static/src/xml/base.xml:0 +msgid ")" +msgstr ")" + +#: addons/web/static/src/xml/base.xml:0 +msgid "LOGOUT" +msgstr "CERRAR SESIÓN" + +#: addons/web/static/src/xml/base.xml:0 +msgid "«" +msgstr "«" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +msgstr "»" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_menu_item" +msgstr "oe_secondary_menu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_submenu_item" +msgstr "oe_secondary_submenu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Hide this tip" +msgstr "Ocultar esta sugerencia" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Disable all tips" +msgstr "Desactivar todas las sugerencias" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View#" +msgstr "Vista#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields" +msgstr "Campos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View labels" +msgstr "Ver etiquetas" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Sidebar Relates" +msgstr "Se relaciona con la barra lateral" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Field" +msgstr "Campo" + +#: addons/web/static/src/xml/base.xml:0 +msgid ":" +msgstr ":" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate view" +msgstr "Traducir vista" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate sidebar" +msgstr "Traducir barra lateral" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delete" +msgstr "Borrar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "First" +msgstr "Primero" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<" +msgstr "<" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">" +msgstr ">" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Last" +msgstr "Último" + +#: addons/web/static/src/xml/base.xml:0 +msgid "♻" +msgstr "♻" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Edit" +msgstr "Guardar y Editar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create & Edit" +msgstr "Crear y Editar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New" +msgstr "Nuevo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "Duplicar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Readonly/Editable" +msgstr "Sólo Lectura/Editable" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<<" +msgstr "<<" + +#: addons/web/static/src/xml/base.xml:0 +msgid "0" +msgstr "0" + +#: addons/web/static/src/xml/base.xml:0 +msgid "/" +msgstr "/" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add" +msgstr "Añadir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Unhandled widget" +msgstr "Widget no controlado" + +#: addons/web/static/src/xml/base.xml:0 +msgid "?" +msgstr "?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#" +msgstr "#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Done" +msgstr "Hecho" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open..." +msgstr "Abrir..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create..." +msgstr "Crear…" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Search..." +msgstr "Buscar..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "..." +msgstr "..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Uploading ..." +msgstr "Subiendo ..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Select" +msgstr "Seleccionar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save As" +msgstr "Guardar como" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Clear" +msgstr "Limpiar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Advanced Filter" +msgstr "Filtro Avanzado" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Filters --" +msgstr "-- Filtros --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Actions --" +msgstr "-- Acciones --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save Filter" +msgstr "Guardar Filtro" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Manage Filters" +msgstr "Gestionar Filtros" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Filter Name:" +msgstr "Nombre del Filtro" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(Any existing filter with the same name will be replaced)" +msgstr "(Cualquier filtro existente con el mismo nombre será reemplazado)" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Any of the following conditions must match" +msgstr "Cualquiera de las condiciones siguientes deben coincidir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "All the following conditions must match" +msgstr "Todas las condiciones siguientes deben coincidir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "None of the following conditions must match" +msgstr "Ninguna de las siguientes condiciones deben coincidir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add condition" +msgstr "Añadir condición" + +#: addons/web/static/src/xml/base.xml:0 +msgid "and" +msgstr "y" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Cancel" +msgstr "Cancelar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & New" +msgstr "Guardar y Nuevo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Close" +msgstr "Guardar y Cerrar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export" +msgstr "Exportar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"This wizard will export all data that matches the current search criteria to " +"a CSV file.\n" +" You can export all data or only the fields that can be " +"reimported after modification." +msgstr "" +"Este asistente le exportará todos los datos que coincidan con los criterios " +"de búsqueda actual a un archivo CSV.\n" +" Puede exportar todos los datos o sólo los campos que pueden " +"importarse de nuevo después de la modificación." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Type:" +msgstr "Tipo de Exportación:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Compatible Export" +msgstr "Exportación compatible con importación" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export all Data" +msgstr "Exportar todos los datos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Formats" +msgstr "Formatos de Exportación" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Available fields" +msgstr "Campos disponibles" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields to export" +msgstr "Campos a exportar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save fields list" +msgstr "Guardar lista de campos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove" +msgstr "Eliminar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove All" +msgstr "Eliminar Todo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Name" +msgstr "Nombre" + +#: addons/web/static/src/xml/base.xml:0 +msgid " " +msgstr " " + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save as:" +msgstr "Guardar como:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Ok" +msgstr "Ok" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Saved exports:" +msgstr "Exportaciones guardadas:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Old Password:" +msgstr "Contraseña anterior:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New Password:" +msgstr "Contraseña nueva:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm Password:" +msgstr "Confirmar la contraseña:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import" +msgstr "Importar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "1. Import a .CSV file" +msgstr "1. Importar un archivo .CSV" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Select a .CSV file to import. If you need a sample of file to import,\n" +" you should use the export tool with the \"Import Compatible\" option." +msgstr "" +"Seleccione un archivo .CSV para importar. Si necesita una muestra de archivo " +"para importar,\n" +" debería usar la herramienta de exportación con la opción de " +"\"Importación Compatible\"." + +#: addons/web/static/src/xml/base.xml:0 +msgid "CSV File:" +msgstr "Archivo CSV:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "2. Check your file format" +msgstr "2. Compruebe el formato de archivo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Options" +msgstr "Opciones de importación" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Does your file have titles?" +msgstr "¿Tiene su archivo títulos?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Separator:" +msgstr "Separador:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delimiter:" +msgstr "Delimitador:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Encoding:" +msgstr "Codificación:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "UTF-8" +msgstr "UTF-8" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Latin 1" +msgstr "Latin 1" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Lines to skip" +msgstr "Líneas a omitir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "The import failed due to:" +msgstr "La importación falló debido a:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Here is a preview of the file we could not import:" +msgstr "Esta es una vista previa del archivo que no se pudo importar:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP Web" +msgstr "OpenERP Web" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Version" +msgstr "Versión" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved." +msgstr "Copyright © 2011-HOY OpenERP SA. Todos los Derechos Reservados." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP is a trademark of the" +msgstr "OpenERP es una marca registrada de la" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP SA Company" +msgstr "Compañía OpenERP SA" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Licenced under the terms of" +msgstr "Con licencia bajo los términos de" + +#: addons/web/static/src/xml/base.xml:0 +msgid "GNU Affero General Public License" +msgstr "GNU Affero General Public License" + +#: addons/web/static/src/xml/base.xml:0 +msgid "About OpenERP" +msgstr "Acerca de OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"is a free enterprise-scale software system that is designed to boost\n" +" productivity and profit through data integration. It connects, " +"improves and\n" +" manages business processes in areas such as sales, finance, " +"supply chain,\n" +" project management, production, services, CRM, etc..." +msgstr "" +"Es un sistema software empresarial-escalar libre diseñado para mejorar\n" +" la productividad y beneficios a través de la integración de " +"datos. Conecta, mejora y\n" +" gestiona los procesos de negocio en áreas como ventas, finanzas, " +"cadena de suministro,\n" +" gestión de proyectos, producción, servicios, CRM, etc..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"The system is platform-independent, and can be installed on Windows, Mac OS " +"X,\n" +" and various Linux and other Unix-based distributions. Its " +"architecture enables\n" +" new functionality to be rapidly created, modifications to be " +"made to a\n" +" production system and migration to a new version to be " +"straightforward." +msgstr "" +"El sistema es una plataforma-independiente, y puede ser instalada en " +"Windows, Mac OS X,\n" +" y varias distribuciones Linux y otra basadas en Unix. Su " +"arquitectura permite\n" +" crear nuevas funcionalidades rápidamente, las modificaciones a " +"hacer en un\n" +" sistema en producción y migración a una nueva versión son " +"sencillas." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Depending on your needs, OpenERP is available through a web or application " +"client." +msgstr "" +"Según sus necesidades, OpenERP está disponible mediante un cliente web o una " +"aplicación de escritorio." diff --git a/addons/web/po/fr.po b/addons/web/po/fr.po new file mode 100644 index 00000000000..a4287a31030 --- /dev/null +++ b/addons/web/po/fr.po @@ -0,0 +1,678 @@ +# French translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-23 12:20+0000\n" +"Last-Translator: Xavier (Open ERP) \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" + +#: addons/web/static/src/js/view_form.js:355 +msgid "" +"Warning, the record has been modified, your changes will be discarded." +msgstr "" +"Attention, l'enregistrement a été modifié, vos changements seront perdus." + +#: addons/web/static/src/js/view_form.js:1659 +msgid "   Search More..." +msgstr "" + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "" + +#: addons/web/static/src/js/views.js:568 +msgid "You must choose at least one record." +msgstr "Vous devez choisir au moins un enregistrement" + +#: addons/web/static/src/js/views.js:569 +msgid "Warning" +msgstr "Attention" + +#: addons/web/static/src/js/views.js:609 +msgid "Translations" +msgstr "Traductions" + +#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0 +msgid "Save" +msgstr "Enregistrer" + +#: addons/web/static/src/js/views.js:615 +msgid "Close" +msgstr "Fermer" + +#: addons/web/static/src/xml/base.xml:0 +msgid "x" +msgstr "x" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{title}" +msgstr "#{title}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{text}" +msgstr "#{text}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Powered by" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "openerp.com" +msgstr "openerp.com" + +#: addons/web/static/src/xml/base.xml:0 +msgid "." +msgstr "." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Loading..." +msgstr "Chargement..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create" +msgstr "Créer" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Drop" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Backup" +msgstr "Archiver" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Restore" +msgstr "Restaurer" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password" +msgstr "Mot de passe" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Back to Login" +msgstr "Retour à la page d'authentification" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CREATE DATABASE" +msgstr "CRÉER LA BASE DE DONNÉES" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master password:" +msgstr "Mot de passe principal:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New database name:" +msgstr "Nom de la nouvelle base de données :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Load Demonstration data:" +msgstr "Charger les données de démonstration:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Default language:" +msgstr "Langue par défaut :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Admin password:" +msgstr "Mot de passe administrateur:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm password:" +msgstr "Confirmer le mot de passe:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "DROP DATABASE" +msgstr "SUPPRIMER LA BASE DE DONNÉES" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database:" +msgstr "Base de données :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master Password:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "BACKUP DATABASE" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "RESTORE DATABASE" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "File:" +msgstr "Fichier :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CHANGE MASTER PASSWORD" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New master password:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm new master password:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "User:" +msgstr "Utilisateur :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password:" +msgstr "Mot de passe :" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database" +msgstr "Base de données" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Login" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Bad username or password" +msgstr "Mauvais identfiant ou mot de passe" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"We think that daily job activities can be more intuitive, efficient, " +"automated, .. and even fun." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP's vision to be:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Full featured" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Today's enterprise challenges are multiple. We provide one module for each " +"need." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open Source" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"To Build a great product, we rely on the knowledge of thousands of " +"contributors." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "User Friendly" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"In order to be productive, people need clean and easy to use interface." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(" +msgstr "(" + +#: addons/web/static/src/xml/base.xml:0 +msgid ")" +msgstr ")" + +#: addons/web/static/src/xml/base.xml:0 +msgid "LOGOUT" +msgstr "DÉCONNEXION" + +#: addons/web/static/src/xml/base.xml:0 +msgid "«" +msgstr "«" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +msgstr "»" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_menu_item" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_submenu_item" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Hide this tip" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Disable all tips" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View#" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View labels" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Sidebar Relates" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Field" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid ":" +msgstr ":" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate view" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate sidebar" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delete" +msgstr "Supprimer" + +#: addons/web/static/src/xml/base.xml:0 +msgid "First" +msgstr "Premier" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<" +msgstr "<" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">" +msgstr ">" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Last" +msgstr "Dernier" + +#: addons/web/static/src/xml/base.xml:0 +msgid "♻" +msgstr "♻" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Edit" +msgstr "Enregistrer et éditer" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create & Edit" +msgstr "Créer et éditer" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "Dupliquer" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Readonly/Editable" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<<" +msgstr "<<" + +#: addons/web/static/src/xml/base.xml:0 +msgid "0" +msgstr "0" + +#: addons/web/static/src/xml/base.xml:0 +msgid "/" +msgstr "/" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Unhandled widget" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "?" +msgstr "?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Done" +msgstr "Terminé" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open..." +msgstr "Ouvrir..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create..." +msgstr "Créer..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Search..." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "..." +msgstr "..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Uploading ..." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Select" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save As" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Clear" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Advanced Filter" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Filters --" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Actions --" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save Filter" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Manage Filters" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Filter Name:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(Any existing filter with the same name will be replaced)" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Any of the following conditions must match" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "All the following conditions must match" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "None of the following conditions must match" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add condition" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "and" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Cancel" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & New" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Close" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"This wizard will export all data that matches the current search criteria to " +"a CSV file.\n" +" You can export all data or only the fields that can be " +"reimported after modification." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Type:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Compatible Export" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export all Data" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Formats" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Available fields" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields to export" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save fields list" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove All" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Name" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid " " +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save as:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Ok" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Saved exports:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Old Password:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New Password:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm Password:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "1. Import a .CSV file" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Select a .CSV file to import. If you need a sample of file to import,\n" +" you should use the export tool with the \"Import Compatible\" option." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CSV File:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "2. Check your file format" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Options" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Does your file have titles?" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Separator:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delimiter:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Encoding:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "UTF-8" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Latin 1" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Lines to skip" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "The import failed due to:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Here is a preview of the file we could not import:" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP Web" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Version" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP is a trademark of the" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP SA Company" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Licenced under the terms of" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "GNU Affero General Public License" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "About OpenERP" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"is a free enterprise-scale software system that is designed to boost\n" +" productivity and profit through data integration. It connects, " +"improves and\n" +" manages business processes in areas such as sales, finance, " +"supply chain,\n" +" project management, production, services, CRM, etc..." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"The system is platform-independent, and can be installed on Windows, Mac OS " +"X,\n" +" and various Linux and other Unix-based distributions. Its " +"architecture enables\n" +" new functionality to be rapidly created, modifications to be " +"made to a\n" +" production system and migration to a new version to be " +"straightforward." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Depending on your needs, OpenERP is available through a web or application " +"client." +msgstr "" diff --git a/addons/web/po/gl.po b/addons/web/po/gl.po new file mode 100644 index 00000000000..b43664b9bee --- /dev/null +++ b/addons/web/po/gl.po @@ -0,0 +1,709 @@ +# Galician translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-19 07:54+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web/static/src/js/view_form.js:355 +msgid "" +"Warning, the record has been modified, your changes will be discarded." +msgstr "Advertencia, o rexistro modificouse, os cambios serán descartados." + +#: addons/web/static/src/js/view_form.js:1659 +msgid "   Search More..." +msgstr "   Buscar máis..." + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "   Crear \"%s\"" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "   Crear e Editar..." + +#: addons/web/static/src/js/views.js:568 +msgid "You must choose at least one record." +msgstr "Debe seleccionar polo menos un rexistro." + +#: addons/web/static/src/js/views.js:569 +msgid "Warning" +msgstr "Advertencia" + +#: addons/web/static/src/js/views.js:609 +msgid "Translations" +msgstr "Traducións" + +#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0 +msgid "Save" +msgstr "Gardar" + +#: addons/web/static/src/js/views.js:615 +msgid "Close" +msgstr "Pechar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "x" +msgstr "x" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{title}" +msgstr "#{title}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{text}" +msgstr "#{text}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Powered by" +msgstr "Desenvolvido por" + +#: addons/web/static/src/xml/base.xml:0 +msgid "openerp.com" +msgstr "openerp.com" + +#: addons/web/static/src/xml/base.xml:0 +msgid "." +msgstr "." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Loading..." +msgstr "Cargando…" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create" +msgstr "Crear" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Drop" +msgstr "Eliminar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Backup" +msgstr "Copia de seguridade" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Restore" +msgstr "Restaurar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password" +msgstr "Contrasinal" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Back to Login" +msgstr "Voltar ó Inicio de sesión" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CREATE DATABASE" +msgstr "CREAR BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master password:" +msgstr "Contrasinal maestra" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New database name:" +msgstr "Nome da nova base de datos:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Load Demonstration data:" +msgstr "Cargar datos de demostración:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Default language:" +msgstr "Idioma por defecto:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Admin password:" +msgstr "Contrasinal de Admin:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm password:" +msgstr "Confirmar contrasinal:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "DROP DATABASE" +msgstr "ELIMINAR BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database:" +msgstr "Base de datos:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master Password:" +msgstr "Contrasinal Maestra" + +#: addons/web/static/src/xml/base.xml:0 +msgid "BACKUP DATABASE" +msgstr "COPIA DE SEGURIDADE DA BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "RESTORE DATABASE" +msgstr "RESTAURAR BASE DE DATOS" + +#: addons/web/static/src/xml/base.xml:0 +msgid "File:" +msgstr "Arquivo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CHANGE MASTER PASSWORD" +msgstr "CAMBIAR CONTRASINAL MAESTRA" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New master password:" +msgstr "Nova contrasinal maestra:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm new master password:" +msgstr "Confirmar nova contrasinal maestra:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "User:" +msgstr "Usuario:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password:" +msgstr "Contrasinal:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database" +msgstr "Base de datos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Login" +msgstr "Inicio de sesión" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Bad username or password" +msgstr "Nome de usuario ou contrasinal incorrectos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"We think that daily job activities can be more intuitive, efficient, " +"automated, .. and even fun." +msgstr "" +"Cremos que as actividades diarias de traballo poden ser máis intuitivas, " +"eficientes e automatizadas, .. e mesmo divertidas." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP's vision to be:" +msgstr "Los obxectivos de OpenERP son ser:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Full featured" +msgstr "Con todas as funcións" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Today's enterprise challenges are multiple. We provide one module for each " +"need." +msgstr "" +"Os retos actuais da empresa son múltiples. Ofrecemos un módulo para cada " +"necesidade." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open Source" +msgstr "Código aberto" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"To Build a great product, we rely on the knowledge of thousands of " +"contributors." +msgstr "" +"Para construir un gran producto, contamos coos coñecementos de miles de " +"contribuíntes." + +#: addons/web/static/src/xml/base.xml:0 +msgid "User Friendly" +msgstr "Sinxelo de usar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"In order to be productive, people need clean and easy to use interface." +msgstr "" +"Co fin de ser produtivo, a xente necesita unha interface clara e sinxela de " +"usar." + +#: addons/web/static/src/xml/base.xml:0 +msgid "(" +msgstr "(" + +#: addons/web/static/src/xml/base.xml:0 +msgid ")" +msgstr ")" + +#: addons/web/static/src/xml/base.xml:0 +msgid "LOGOUT" +msgstr "PECHAR SESIÓN" + +#: addons/web/static/src/xml/base.xml:0 +msgid "«" +msgstr "«" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +msgstr "»" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_menu_item" +msgstr "oe_secondary_menu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_submenu_item" +msgstr "oe_secondary_submenu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Hide this tip" +msgstr "Ocultar esta suxerencia" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Disable all tips" +msgstr "Desactivar todas as suxerencias" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View#" +msgstr "Vista#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields" +msgstr "Campos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View labels" +msgstr "Ver etiquetas" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Sidebar Relates" +msgstr "Relaciónase coa barra lateral" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Field" +msgstr "Campo" + +#: addons/web/static/src/xml/base.xml:0 +msgid ":" +msgstr ":" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate view" +msgstr "Traducir vista" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate sidebar" +msgstr "Traducir barra lateral" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delete" +msgstr "Borrar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "First" +msgstr "Primeiro" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<" +msgstr "<" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">" +msgstr ">" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Last" +msgstr "Último" + +#: addons/web/static/src/xml/base.xml:0 +msgid "♻" +msgstr "♻" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Edit" +msgstr "Gardar e Editar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create & Edit" +msgstr "Crear e Editar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New" +msgstr "Novo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "Duplicar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Readonly/Editable" +msgstr "Só Lectura/Editable" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<<" +msgstr "<<" + +#: addons/web/static/src/xml/base.xml:0 +msgid "0" +msgstr "0" + +#: addons/web/static/src/xml/base.xml:0 +msgid "/" +msgstr "/" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add" +msgstr "Engadir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Unhandled widget" +msgstr "Widget non controlado" + +#: addons/web/static/src/xml/base.xml:0 +msgid "?" +msgstr "?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#" +msgstr "#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Done" +msgstr "Feito" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open..." +msgstr "Abrir..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create..." +msgstr "Crear…" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Search..." +msgstr "Buscar..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "..." +msgstr "…" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Uploading ..." +msgstr "Subindo ..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Select" +msgstr "Seleccionar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save As" +msgstr "Gardar como" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Clear" +msgstr "Limpar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Advanced Filter" +msgstr "Filtro Avanzado" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Filters --" +msgstr "-- Filtros --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Actions --" +msgstr "-- Accións --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save Filter" +msgstr "Gardar Filtro" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Manage Filters" +msgstr "Xestionar filtros" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Filter Name:" +msgstr "Nome do Filtro" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(Any existing filter with the same name will be replaced)" +msgstr "(Calquer filtro existente co mesmo nome será reemplazado)" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Any of the following conditions must match" +msgstr "Calquera das condicións seguintes deben coincidir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "All the following conditions must match" +msgstr "Todas as condicións seguintes deben coincidir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "None of the following conditions must match" +msgstr "Ningunha das seguintes condicións deben coincidir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add condition" +msgstr "Engadir condición" + +#: addons/web/static/src/xml/base.xml:0 +msgid "and" +msgstr "e" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Cancel" +msgstr "Cancelar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & New" +msgstr "Gardar e Novo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Close" +msgstr "Gardar e Pechar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export" +msgstr "Exportar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"This wizard will export all data that matches the current search criteria to " +"a CSV file.\n" +" You can export all data or only the fields that can be " +"reimported after modification." +msgstr "" +"Este asistente exportaralle todos os datos que coincidan cos criterios de " +"procura actual a un arquivo CSV.\n" +" Pode exportar todos os datos ou só os campos que poden " +"importarse de novo despois da modificación." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Type:" +msgstr "Tipo de Exportación:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Compatible Export" +msgstr "Exportación compatible con importación" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export all Data" +msgstr "Exportar todos os datos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Formats" +msgstr "Formatos de Exportación" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Available fields" +msgstr "Campos dispoñibles" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields to export" +msgstr "Campos a exportar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save fields list" +msgstr "Gardar lista de campos" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove" +msgstr "Eliminar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove All" +msgstr "Eliminar Todo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Name" +msgstr "Nome" + +#: addons/web/static/src/xml/base.xml:0 +msgid " " +msgstr " " + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save as:" +msgstr "Gardar como:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Ok" +msgstr "Ok" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Saved exports:" +msgstr "Exportacións gardadas:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Old Password:" +msgstr "Contrasinal anterior:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New Password:" +msgstr "Contrasinal nova:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm Password:" +msgstr "Confirmar contrasinal:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import" +msgstr "Importar" + +#: addons/web/static/src/xml/base.xml:0 +msgid "1. Import a .CSV file" +msgstr "1. Importar un arquivo .CSV" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Select a .CSV file to import. If you need a sample of file to import,\n" +" you should use the export tool with the \"Import Compatible\" option." +msgstr "" +"Seleccione un arquivo .CSV para importar. Se necesita unha mostra de arquivo " +"para importar,\n" +" debería usar a ferramenta de exportación coa opción de \"Importación " +"Compatible\"." + +#: addons/web/static/src/xml/base.xml:0 +msgid "CSV File:" +msgstr "Arquivo CSV:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "2. Check your file format" +msgstr "2. Comprobe o formato de arquivo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Options" +msgstr "Importar opcións" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Does your file have titles?" +msgstr "¿Ten o seu arquivo títulos?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Separator:" +msgstr "Separador:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delimiter:" +msgstr "Delimitador:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Encoding:" +msgstr "Codificación:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "UTF-8" +msgstr "UTF-8" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Latin 1" +msgstr "Latin 1" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Lines to skip" +msgstr "Liñas a omitir" + +#: addons/web/static/src/xml/base.xml:0 +msgid "The import failed due to:" +msgstr "A importación fallou debido a:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Here is a preview of the file we could not import:" +msgstr "Esta é a vista previa do arquivo que non se pode importar:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP Web" +msgstr "OpenERP Web" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Version" +msgstr "Versión" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved." +msgstr "Copyright © 2011-HOXE OpenERP SA. Todos os Dereitos Reservados." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP is a trademark of the" +msgstr "OpenERP é unha marca rexistrada da" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP SA Company" +msgstr "Compañía OpenERP SA" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Licenced under the terms of" +msgstr "Con licencia baixo os termos de" + +#: addons/web/static/src/xml/base.xml:0 +msgid "GNU Affero General Public License" +msgstr "GNU Affero General Public License" + +#: addons/web/static/src/xml/base.xml:0 +msgid "About OpenERP" +msgstr "Acerca de OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"is a free enterprise-scale software system that is designed to boost\n" +" productivity and profit through data integration. It connects, " +"improves and\n" +" manages business processes in areas such as sales, finance, " +"supply chain,\n" +" project management, production, services, CRM, etc..." +msgstr "" +"É un sistema software empresarial-escalar libre deseñado para mellorar\n" +" a productividade y beneficios a través da integración de datos. " +"Conecta, mellora e\n" +" xestiona os procesos de negocio en áreas como ventas, finanzas, " +"cadena de suministro,\n" +" xestión de proxectos, producción, servizos, CRM, etc..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"The system is platform-independent, and can be installed on Windows, Mac OS " +"X,\n" +" and various Linux and other Unix-based distributions. Its " +"architecture enables\n" +" new functionality to be rapidly created, modifications to be " +"made to a\n" +" production system and migration to a new version to be " +"straightforward." +msgstr "" +"O sistema é unha plataforma-independente, e pode ser instalada en Windows, " +"Mac OS X,\n" +" e varias distribucións Linux e outra basadas en Unix. A súa " +"arquitectura permite\n" +" crear novas funcionalidades rápidamente, as modificacións a " +"facer nun\n" +" sistema en producción e migración a unha nova versión son " +"sinxelas." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Depending on your needs, OpenERP is available through a web or application " +"client." +msgstr "" +"Segundo as súas necesidades, OpenERP está dispoñible a través dun cliente " +"web ou unha aplicación de escritorio." diff --git a/addons/web/po/sl.po b/addons/web/po/sl.po new file mode 100644 index 00000000000..bc63e7ff313 --- /dev/null +++ b/addons/web/po/sl.po @@ -0,0 +1,707 @@ +# Slovenian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-19 07:07+0000\n" +"Last-Translator: Anze (Neotek) \n" +"Language-Team: Slovenian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web/static/src/js/view_form.js:355 +msgid "" +"Warning, the record has been modified, your changes will be discarded." +msgstr "" +"Opozorilo, zapis je bil spremenjen, zato bodo vaše spremembe zavržene." + +#: addons/web/static/src/js/view_form.js:1659 +msgid "   Search More..." +msgstr "   Iskanje več..." + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "   Ustvari \"%s\"" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "   Ustvari in uredi..." + +#: addons/web/static/src/js/views.js:568 +msgid "You must choose at least one record." +msgstr "Izbrati morate vsaj en zapis." + +#: addons/web/static/src/js/views.js:569 +msgid "Warning" +msgstr "Opozorilo" + +#: addons/web/static/src/js/views.js:609 +msgid "Translations" +msgstr "Prevodi" + +#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0 +msgid "Save" +msgstr "Shrani" + +#: addons/web/static/src/js/views.js:615 +msgid "Close" +msgstr "Zapri" + +#: addons/web/static/src/xml/base.xml:0 +msgid "x" +msgstr "x" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{title}" +msgstr "#{title}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#{text}" +msgstr "#{text}" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Powered by" +msgstr "Poganja ga" + +#: addons/web/static/src/xml/base.xml:0 +msgid "openerp.com" +msgstr "openerp.com" + +#: addons/web/static/src/xml/base.xml:0 +msgid "." +msgstr "." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Loading..." +msgstr "Nalaganje …" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create" +msgstr "Ustvari" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Drop" +msgstr "Izbriši" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Backup" +msgstr "Varnostna kopija" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Restore" +msgstr "Obnovi" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password" +msgstr "Geslo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Back to Login" +msgstr "Nazaj na prijavo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CREATE DATABASE" +msgstr "USTVARI PODATKOVNO BAZO" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master password:" +msgstr "Glavno geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New database name:" +msgstr "Ime nove podatkovne baze" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Load Demonstration data:" +msgstr "Naloži demonstracijske podatke:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Default language:" +msgstr "Privzeti jezik:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Admin password:" +msgstr "Admin geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm password:" +msgstr "Potrdite geslo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "DROP DATABASE" +msgstr "IZBRIŠI PODATKOVNO BAZO" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database:" +msgstr "Podatkovna baza" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Master Password:" +msgstr "Glavno geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "BACKUP DATABASE" +msgstr "VARNOSTNA KOPIJA PODATKOVNE BAZE" + +#: addons/web/static/src/xml/base.xml:0 +msgid "RESTORE DATABASE" +msgstr "OBNOVITEV PODATKOVNE BAZE" + +#: addons/web/static/src/xml/base.xml:0 +msgid "File:" +msgstr "Datoteka:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "CHANGE MASTER PASSWORD" +msgstr "SPREMENI GLAVNO GELSO" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New master password:" +msgstr "Novo glavno geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm new master password:" +msgstr "Potrdi novo glavno geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "User:" +msgstr "Uporabnik:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Password:" +msgstr "Geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Database" +msgstr "Podatkovna baza" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Login" +msgstr "Prijava" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Bad username or password" +msgstr "Napačno uporabniško ime ali geslo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"We think that daily job activities can be more intuitive, efficient, " +"automated, .. and even fun." +msgstr "" +"Menimo, da so lahko dnevne dejavnosti dela bolj intuitivna, učinkovita, " +"avtomatska, .. in celo zabavna." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP's vision to be:" +msgstr "Vizija OpenERP je:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Full featured" +msgstr "Oblikovno popoln" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Today's enterprise challenges are multiple. We provide one module for each " +"need." +msgstr "" +"Današnja podjetja imajo več izzivov. Nudimo en modul za vsako potrebo." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open Source" +msgstr "Odprta koda" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"To Build a great product, we rely on the knowledge of thousands of " +"contributors." +msgstr "" +"Za zgraditev odličnega izdeleka, se zanašamo na znanje tisočih sodelavcev." + +#: addons/web/static/src/xml/base.xml:0 +msgid "User Friendly" +msgstr "Prijazen do uporabnika" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"In order to be productive, people need clean and easy to use interface." +msgstr "" +"Da bi bili produktivni, ljudje potrebujejo čist in enostaven za uporabniški " +"vmesnik." + +#: addons/web/static/src/xml/base.xml:0 +msgid "(" +msgstr "(" + +#: addons/web/static/src/xml/base.xml:0 +msgid ")" +msgstr ")" + +#: addons/web/static/src/xml/base.xml:0 +msgid "LOGOUT" +msgstr "ODJAVA" + +#: addons/web/static/src/xml/base.xml:0 +msgid "«" +msgstr "«" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +msgstr "»" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_menu_item" +msgstr "oe_secondary_menu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "oe_secondary_submenu_item" +msgstr "oe_secondary_submenu_item" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Hide this tip" +msgstr "Skrij ta namig" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Disable all tips" +msgstr "Onemogoči vse namige" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View#" +msgstr "Ogled#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields" +msgstr "Polja" + +#: addons/web/static/src/xml/base.xml:0 +msgid "View labels" +msgstr "Ogled oznak" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Sidebar Relates" +msgstr "Sorodne stranske vrstice" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Field" +msgstr "Polje" + +#: addons/web/static/src/xml/base.xml:0 +msgid ":" +msgstr ":" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate view" +msgstr "Preveden pogled" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Translate sidebar" +msgstr "Prevedi stransko vrstico" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delete" +msgstr "Izbriši" + +#: addons/web/static/src/xml/base.xml:0 +msgid "First" +msgstr "Začetek" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<" +msgstr "<" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">" +msgstr ">" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Last" +msgstr "Konec" + +#: addons/web/static/src/xml/base.xml:0 +msgid "♻" +msgstr "♻" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Edit" +msgstr "Shrani & Uredi" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create & Edit" +msgstr "Ustvari & Uredi" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New" +msgstr "Novo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "Podvoji" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Readonly/Editable" +msgstr "Samo za branje/možno urejanje" + +#: addons/web/static/src/xml/base.xml:0 +msgid "<<" +msgstr "<<" + +#: addons/web/static/src/xml/base.xml:0 +msgid "0" +msgstr "0" + +#: addons/web/static/src/xml/base.xml:0 +msgid "/" +msgstr "/" + +#: addons/web/static/src/xml/base.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add" +msgstr "Dodaj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Unhandled widget" +msgstr "Neobravnavani gradnik" + +#: addons/web/static/src/xml/base.xml:0 +msgid "?" +msgstr "?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "#" +msgstr "#" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Done" +msgstr "Končano" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open..." +msgstr "Odpri ..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create..." +msgstr "Ustvari ..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Search..." +msgstr "Iskanje ..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "..." +msgstr "..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Uploading ..." +msgstr "Nalaganje..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Select" +msgstr "Izberi" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save As" +msgstr "Shrani kot" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Clear" +msgstr "Počisti" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Advanced Filter" +msgstr "Napredni filter" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Filters --" +msgstr "-- Filtr i--" + +#: addons/web/static/src/xml/base.xml:0 +msgid "-- Actions --" +msgstr "-- Dejanja --" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save Filter" +msgstr "Shrani filter" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Manage Filters" +msgstr "Upravljanje filtrov" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Filter Name:" +msgstr "Ime filtra:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "(Any existing filter with the same name will be replaced)" +msgstr "(Vsak obstoječ filter z istim imenom bo zamenjan)" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Any of the following conditions must match" +msgstr "Vsak od teh pogojev se mora ujemati" + +#: addons/web/static/src/xml/base.xml:0 +msgid "All the following conditions must match" +msgstr "Vsi naslednji pogoji se morajo ujemati" + +#: addons/web/static/src/xml/base.xml:0 +msgid "None of the following conditions must match" +msgstr "Nobena od naslednjih pogojev se morajo ujemati" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Add condition" +msgstr "Dodaj pogoj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "and" +msgstr "in" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Cancel" +msgstr "Prekliči" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & New" +msgstr "Shrani & Novo" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Close" +msgstr "Shrani & Zapri" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export" +msgstr "Izvozi" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"This wizard will export all data that matches the current search criteria to " +"a CSV file.\n" +" You can export all data or only the fields that can be " +"reimported after modification." +msgstr "" +"Ta čarovnik bo izvozil vse podatke, ki se ujemajo s trenutnim kriterijem " +"iskanja, v datoteko CSV.\n" +" Izvozite lahko vse podatke ali samo polja, ki jih je mogoče " +"ponovno uvoziti po spremembi." + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Type:" +msgstr "Tip izvoza:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Compatible Export" +msgstr "Uvozi kompatibilen izvoz" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export all Data" +msgstr "Izvozi vse podatke" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Export Formats" +msgstr "Oblike izvoza" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Available fields" +msgstr "Razpoložljiva polja" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Fields to export" +msgstr "Polja za izvoz" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save fields list" +msgstr "Shrani seznam polj" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove" +msgstr "Odstrani" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Remove All" +msgstr "Odstrani vse" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Name" +msgstr "Ime" + +#: addons/web/static/src/xml/base.xml:0 +msgid " " +msgstr " " + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save as:" +msgstr "Shrani kot:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Ok" +msgstr "Vredu" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Saved exports:" +msgstr "Shranjeni izvozi:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Old Password:" +msgstr "Staro geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New Password:" +msgstr "Novo geslo:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Confirm Password:" +msgstr "Potrditev gesla:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import" +msgstr "Uvozi" + +#: addons/web/static/src/xml/base.xml:0 +msgid "1. Import a .CSV file" +msgstr "1. Uvozi .CSV datoteko" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Select a .CSV file to import. If you need a sample of file to import,\n" +" you should use the export tool with the \"Import Compatible\" option." +msgstr "" +"Izberi datoteko .CSV za uvoz. Če potrebujete vzorec daoteke za uvoz,\n" +" uporabite orodje izvoza z možnostjo \"Uvozi kompatibilno\"." + +#: addons/web/static/src/xml/base.xml:0 +msgid "CSV File:" +msgstr "CSV datoteka:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "2. Check your file format" +msgstr "2. Preveri format datoteke" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Import Options" +msgstr "Možnosti uvoza" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Does your file have titles?" +msgstr "Ali ima vaša datoteka naslove?" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Separator:" +msgstr "Ločitelj:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Delimiter:" +msgstr "Razmejitelj:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Encoding:" +msgstr "Nabor znakov:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "UTF-8" +msgstr "UTF-8" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Latin 1" +msgstr "Latin 1" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Lines to skip" +msgstr "Vrstice za preskočit" + +#: addons/web/static/src/xml/base.xml:0 +msgid "The import failed due to:" +msgstr "Uvoz ni uspel zaradi:" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Here is a preview of the file we could not import:" +msgstr "Tukaj je predogled datoteke, ki je nismo mogli uvozit" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP Web" +msgstr "OpenERP Web" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Version" +msgstr "Različica" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved." +msgstr "Copyright © 2011-DANES OpenERP SA. Vse pravice pridržane." + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP is a trademark of the" +msgstr "OpenERP je blagovna znamka" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP SA Company" +msgstr "podjetja OpenERP SA" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Licenced under the terms of" +msgstr "Licencirana pod pogoji" + +#: addons/web/static/src/xml/base.xml:0 +msgid "GNU Affero General Public License" +msgstr "GNU Affero General Public License" + +#: addons/web/static/src/xml/base.xml:0 +msgid "About OpenERP" +msgstr "O OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"is a free enterprise-scale software system that is designed to boost\n" +" productivity and profit through data integration. It connects, " +"improves and\n" +" manages business processes in areas such as sales, finance, " +"supply chain,\n" +" project management, production, services, CRM, etc..." +msgstr "" +"je brezplačna podjetniškega obsega sistemska programska oprema, ki je " +"namenjena za povečanje\n" +" produktivnosti in dobička skozi podatkovno integracijo. " +"Povezuje, izboljša in\n" +" upravlja poslovne procese v okoljih kot so prodaja, finance, " +"veriga dobavljanja,\n" +" upravljanje projektov, proizvodnje, storitev, CRM, itd..." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"The system is platform-independent, and can be installed on Windows, Mac OS " +"X,\n" +" and various Linux and other Unix-based distributions. Its " +"architecture enables\n" +" new functionality to be rapidly created, modifications to be " +"made to a\n" +" production system and migration to a new version to be " +"straightforward." +msgstr "" +"Sistem je neodvisnen od platforme in ga je mogoče namestiti na Windows, Mac " +"OS X,\n" +" in na različne Linux in ostale Unix-bazirane distribucije. " +"Njegova arhitektura omogoča\n" +" nove funkcionalnosti, ki so lahko hitro ustvarjene, " +"modifikacija, ki se naredi v\n" +" produkcijskem sistemu in migracijo na novo verzijo, ki se " +"enostavno izvede." + +#: addons/web/static/src/xml/base.xml:0 +msgid "" +"Depending on your needs, OpenERP is available through a web or application " +"client." +msgstr "" +"Glede na vaše potrebe, je OpenERP na voljo prek spleta ali programskega " +"klienta." diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 621ea39c74f..34457ade4fd 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -207,6 +207,7 @@ QWeb2.Engine = (function() { this.reserved_words = QWeb2.RESERVED_WORDS.slice(0); this.actions_precedence = QWeb2.ACTIONS_PRECEDENCE.slice(0); this.word_replacement = QWeb2.tools.extend({}, QWeb2.WORD_REPLACEMENT); + this.format_text_node = null; for (var i = 0; i < arguments.length; i++) { this.add_template(arguments[i]); } @@ -317,12 +318,14 @@ QWeb2.Engine = (function() { " dict = dict || {};\n" + " dict['__template__'] = '" + template + "';\n" + " var r = [];\n" + - " /* START TEMPLATE */ try {\n" + + " /* START TEMPLATE */" + + (this.debug ? "" : " try {\n") + (e.compile()) + "\n" + - " /* END OF TEMPLATE */ } catch(error) {\n" + + " /* END OF TEMPLATE */" + + (this.debug ? "" : " } catch(error) {\n" + " if (console && console.exception) console.exception(error);\n" + - " context.engine.tools.exception('Runtime Error: ' + error, context);\n" + - " }\n" + + " context.engine.tools.exception('Runtime Error: ' + error, context);\n") + + (this.debug ? "" : " }\n") + " return r.join('');"; }, render : function(template, dict) { @@ -486,12 +489,16 @@ QWeb2.Element = (function() { }, _compile : function() { switch (this.node.nodeType) { - case 3: - case 4: - this.top_string(this.node.data); + case 3: + case 4: + var text = this.node.data; + if (this.engine.format_text_node) { + text = this.engine.format_text_node.call(this, text); + } + this.top_string(text); break; - case 1: - this.compile_element(); + case 1: + this.compile_element(); } var r = this._top.join(''); if (this.process_children) { diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index a814ddbba1b..88d419c4059 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -40,6 +40,9 @@ body.openerp, .openerp textarea, .openerp input, .openerp select, .openerp optio } /* Loading */ +.loading { + cursor: wait; +} .openerp .loading { display: none; z-index: 100; @@ -156,7 +159,7 @@ body.openerp, .openerp textarea, .openerp input, .openerp select, .openerp optio } .db_container { - width: 15%; + width: 196px; background: #666666; } @@ -222,6 +225,7 @@ label.error { background: #f0eeee; } .openerp .oe-application-container { + width: 100%; height: 100%; } @@ -797,13 +801,15 @@ label.error { -moz-border-radius-topright: 7px; border-top-right-radius: 7px; } -.openerp .oe-listview table.oe-listview-content tfoot td:first-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:first-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:first-child, .openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child th:first-child { -webkit-border-bottom-left-radius: 7px; -moz-border-radius-bottomleft: 7px; border-bottom-left-radius: 7px; } -.openerp .oe-listview table.oe-listview-content tfoot td:last-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:last-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:last-child, .openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child td:last-child { -webkit-border-bottom-right-radius: 7px; -moz-border-radius-bottomright: 7px; @@ -1369,19 +1375,20 @@ label.error { } ul.oe-arrow-list { - padding-left: 0.5em; + padding-left: 1.1em; margin: 0; + white-space: nowrap; } ul.oe-arrow-list li { display: inline-block; - margin-left: -0.5em; + margin-left: -1em; } ul.oe-arrow-list li span { vertical-align: top; display: inline-block; border-width:1em; border-style:solid; - border-color: white; + border-color: #DEDEDE; line-height:0em; } ul.oe-arrow-list .oe-arrow-list-before { @@ -1390,25 +1397,43 @@ ul.oe-arrow-list .oe-arrow-list-before { } ul.oe-arrow-list .oe-arrow-list-after { border-color: rgba(0,0,0,0); - border-left-color: white; + border-left-color: #DEDEDE; border-right-width:0; } ul.oe-arrow-list li.oe-arrow-list-selected span { - border-color: #CFCCCC; + border-color: #B5B9FF; } ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-before { border-left-color: rgba(0,0,0,0); } ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { border-color: rgba(0,0,0,0); - border-left-color: #CFCCCC; + border-left-color: #B5B9FF; } -.openerp .view_editor{ +.openerp .oe_view_editor { + border-collapse: collapse; + padding: 0; + align: left; + width: 100%; +} +.openerp .oe_view_editor_colum{ font-size: 90%; font-weight: normal; - height : 10%; padding: 0; border-bottom: 1px solid #CFCCCC; } - - +.openerp .oe_view_editor_row:hover{ + background-color: #F3F3F3; +} +.openerp .oe_view_editor_tree_grid{ + text-align: left; + white-space: nowrap; + border-collapse: collapse; + width: 100%; +} +.openerp .oe_view_editor_tree_grid a:hover { + color: blue; +} +.openerp .oe_view_editor_tree_grid a { + display: block; +} diff --git a/addons/web/static/src/css/data_import.css b/addons/web/static/src/css/data_import.css index 1fb3b22aa45..e5d1c9a910c 100644 --- a/addons/web/static/src/css/data_import.css +++ b/addons/web/static/src/css/data_import.css @@ -11,6 +11,22 @@ .openerp .oe_import_grid-row .oe_import_grid-cell { border-bottom: 1px solid #E3E3E3; } + +.openerp .oe-import-no-result .oe-import-result { + display: none; +} +.openerp .oe-import fieldset { + cursor: pointer; +} +.openerp .oe-import fieldset legend:before { + content: '\25BC '; +} +.openerp .oe-import fieldset.oe-closed legend:before { + content: '\25B6 '; +} +.openerp .oe-import fieldset.oe-closed table { + display: none; +} .openerp .separator.horizontal { font-weight: bold; border-bottom-width: 1px; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 1955298ba27..bdb8e23c20b 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -5,15 +5,16 @@ openerp.web.chrome = function(openerp) { var QWeb = openerp.web.qweb; openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Notification# */{ - /** - * @constructs openerp.web.Notification - * @extends openerp.web.Widget - * - * @param parent - * @param element_id - */ - init: function(parent, element_id) { - this._super(parent, element_id); + template: 'Notification', + identifier_prefix: 'notification-', + + init: function() { + this._super.apply(this, arguments); + openerp.notification = this; + }, + + start: function() { + this._super.apply(this, arguments); this.$element.notify({ speed: 500, expires: 1500 @@ -28,9 +29,12 @@ openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Not warn: function(title, text) { this.$element.notify('create', 'oe_notification_alert', { title: title, - text: text + text: text, + }, { + expires: false, }); - } + }, + }); openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# */{ @@ -132,21 +136,11 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# } }); -openerp.web.CrashManager = openerp.web.Dialog.extend(/** @lends openerp.web.CrashManager# */{ - identifier_prefix: 'dialog_crash', - /** - * @constructs opener.web.CrashManager - * @extends openerp.web.Dialog - * - * @param parent - */ +openerp.web.CrashManager = openerp.web.SessionAware.extend({ init: function(parent) { - this._super(parent); + this._super((parent || {}).session); this.session.on_rpc_error.add(this.on_rpc_error); }, - on_button_Ok: function() { - this.close(); - }, on_rpc_error: function(error) { this.error = error; if (error.data.fault_code) { @@ -157,20 +151,36 @@ openerp.web.CrashManager = openerp.web.Dialog.extend(/** @lends openerp.web.Cras } } if (error.code === 200 && error.type) { - this.dialog_title = "OpenERP " + _.capitalize(error.type); - this.template = 'DialogWarning'; - this.open({ - width: 'auto', - height: 'auto' - }); + this.on_managed_error(error); } else { - this.dialog_title = "OpenERP Error"; - this.template = 'DialogTraceback'; - this.open({ - width: 'auto', - height: 'auto' - }); + this.on_traceback(error); } + }, + on_managed_error: function(error) { + $('
' + QWeb.render('DialogWarning', {error: error}) + '
').dialog({ + title: "OpenERP " + _.capitalize(error.type), + buttons: { + Ok: function() { + $(this).dialog("close"); + } + } + }); + }, + on_traceback: function(error) { + var dialog = new openerp.web.Dialog(this, { + title: "OpenERP " + _.capitalize(error.type), + autoOpen: true, + width: '90%', + height: '90%', + min_width: '800px', + min_height: '600px', + buttons: { + Ok: function() { + $(this).dialog("close"); + } + } + }).start(); + dialog.$element.html(QWeb.render('DialogTraceback', {error: error})); } }); @@ -194,8 +204,10 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading# //this.$element.html(QWeb.render("Loading", {})); this.$element.html("Loading ("+this.count+")"); this.$element.show(); + this.widget_parent.$element.addClass('loading'); } else { this.$element.fadeOut(); + this.widget_parent.$element.removeClass('loading'); } } }); @@ -369,7 +381,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database } $db_list.find(':selected').remove(); self.db_list.splice(_.indexOf(self.db_list, db, true), 1); - self.notification.notify("Dropping database", "The database '" + db + "' has been dropped"); + self.do_notify("Dropping database", "The database '" + db + "' has been dropped"); }); } }); @@ -454,7 +466,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database self.display_error(result); return; } - self.notification.notify("Changed Password", "Password has been changed successfully"); + self.do_notify("Changed Password", "Password has been changed successfully"); }); } }); @@ -462,7 +474,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database }); openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{ - remember_creditentials: true, + remember_credentials: true, template: "Login", identifier_prefix: 'oe-app-login-', @@ -480,13 +492,22 @@ openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{ this.selected_db = null; this.selected_login = null; - if (this.has_local_storage && this.remember_creditentials) { + if (this.has_local_storage && this.remember_credentials) { this.selected_db = localStorage.getItem('last_db_login_success'); this.selected_login = localStorage.getItem('last_login_login_success'); if (jQuery.deparam(jQuery.param.querystring()).debug != undefined) { this.selected_password = localStorage.getItem('last_password_login_success'); } } + + var qs = jQuery.deparam(jQuery.param.querystring()); + if (qs.db) { + this.selected_db = qs.db; + } + if (qs.login) { + this.selected_login = qs.login; + } + }, start: function() { var self = this; @@ -537,7 +558,7 @@ openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{ this.session.session_login(db, login, password, function() { if(self.session.session_is_valid()) { if (self.has_local_storage) { - if(self.remember_creditentials) { + if(self.remember_credentials) { localStorage.setItem('last_db_login_success', db); localStorage.setItem('last_login_login_success', login); if (jQuery.deparam(jQuery.param.querystring()).debug != undefined) { @@ -779,9 +800,8 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ }, start: function() { this.$secondary_menu.addClass(this.folded ? 'oe_folded' : 'oe_unfolded'); - this.reload(); }, - reload: function() { + do_reload: function() { this.rpc("/web/menu/load", {}, this.on_loaded); }, on_loaded: function(data) { @@ -823,7 +843,9 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ this.session.active_id = id; this.rpc('/web/menu/action', {'menu_id': id}, this.on_menu_action_loaded); } - ev.stopPropagation(); + if (ev) { + ev.stopPropagation(); + } return false; }, do_menu_click: function($clicked_menu, manual) { @@ -866,6 +888,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ $sub_menu.hide(); return true; } + return manual; } else { return true; } @@ -927,13 +950,10 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie } this.$element.html(QWeb.render("Interface", params)); + this.notification = new openerp.web.Notification(); this.session = new openerp.web.Session(); this.loading = new openerp.web.Loading(this,"oe_loading"); this.crashmanager = new openerp.web.CrashManager(this); - this.crashmanager.start(); - - // Do you autorize this ? will be replaced by notify() in controller - openerp.web.Widget.prototype.notification = new openerp.web.Notification(this, "oe_notification"); this.header = new openerp.web.Header(this); this.login = new openerp.web.Login(this); @@ -954,12 +974,27 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie }, start: function() { + this._super.apply(this, arguments); + this.notification.prependTo(this.$element); this.header.appendTo($("#oe_header")); this.session.start(); this.login.appendTo($('#oe_login')); this.menu.start(); }, + do_reload: function() { + this.session.session_restore(); + this.menu.do_reload(); + }, + do_notify: function() { + var n = this.notification; + n.notify.apply(n, arguments); + }, + do_warn: function() { + var n = this.notification; + n.warn.apply(n, arguments); + }, on_logged: function() { + this.menu.do_reload(); if(this.action_manager) this.action_manager.stop(); this.action_manager = new openerp.web.ActionManager(this); @@ -1046,7 +1081,8 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie this.action_manager.do_action(action); }, do_about: function() { - } + }, + }); }; diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index b1708bb5826..39a1ba7ef64 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -10,8 +10,6 @@ if (!console.debug) { } openerp.web.core = function(openerp) { -openerp.web.qweb = new QWeb2.Engine(); -openerp.web.qweb.debug = (window.location.search.indexOf('?debug') !== -1); /** * John Resig Class with factory improvement */ @@ -74,7 +72,6 @@ openerp.web.qweb.debug = (window.location.search.indexOf('?debug') !== -1); } return this; } - // This should NOT be used, like callbackenable it's too hackish not enough javasish Class.include = function (properties) { for (var name in properties) { if (typeof properties[name] !== 'function' @@ -288,14 +285,12 @@ openerp.web.Registry = openerp.web.Class.extend( /** @lends openerp.web.Registry */ get_any: function (keys) { for (var i=0; i', { - 'href': file + (self.debug ? '?debug=' + (new Date().getTime()) : ''), + 'href': file, 'rel': 'stylesheet', 'type': 'text/css' })); @@ -598,15 +597,15 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web var file = files.shift(); var tag = document.createElement('script'); tag.type = 'text/javascript'; - tag.src = file + (this.debug ? '?debug=' + (new Date().getTime()) : ''); + tag.src = file; tag.onload = tag.onreadystatechange = function() { if ( (tag.readyState && tag.readyState != "loaded" && tag.readyState != "complete") || tag.onload_done ) return; tag.onload_done = true; self.do_load_js(files); }; - $('head').append(tag); - self.do_load_js(files); + var head = document.head || document.getElementsByTagName('head')[0]; + head.appendChild(tag); } else { this.on_modules_loaded(); } @@ -1045,6 +1044,21 @@ openerp.web.TranslationDataBase = openerp.web.Class.extend(/** @lends openerp.we }); openerp.web._t = new openerp.web.TranslationDataBase().build_translation_function(); +openerp.web.qweb = new QWeb2.Engine(); +openerp.web.qweb.debug = (window.location.search.indexOf('?debug') !== -1); +openerp.web.qweb.format_text_node = function(s) { + // Note that 'this' is the Qweb Node of the text + var translation = this.node.parentNode.attributes['t-translation']; + if (translation && translation.value === 'off') { + return s; + } + var ts = _.trim(s); + if (ts.length === 0) { + return s; + } + var tr = openerp.web._t(ts); + return tr === ts ? s : tr; +} }; diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index ea0824fb1df..069506586ad 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -263,6 +263,15 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet } return this; }, + select_id: function(id) { + var idx = _.indexOf(this.ids, id); + if (idx === -1) { + return false; + } else { + this.index = idx; + return true; + } + }, /** * Read records. * @@ -484,7 +493,7 @@ openerp.web.DataSetStatic = openerp.web.DataSet.extend({ offset = options.offset || 0, limit = options.limit || false, fields = fields || false; - var end_pos = limit && limit !== -1 ? offset + limit : undefined; + var end_pos = limit && limit !== -1 ? offset + limit : this.ids.length; return this.read_ids(this.ids.slice(offset, end_pos), fields, callback); }, set_ids: function (ids) { diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 9c686846751..355c6c1b493 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -1,5 +1,6 @@ openerp.web.data_import = function(openerp) { -var QWeb = openerp.web.qweb; +var QWeb = openerp.web.qweb, + _t = openerp.web._t; /** * Safari does not deal well at all with raw JSON data being returned. As a * result, we're going to cheat by using a pseudo-jsonp: instead of getting @@ -37,6 +38,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this.model = parent.model; this.fields = []; this.all_fields = []; + this.fields_with_defaults = []; this.required_fields = null; var convert_fields = function (root, prefix) { @@ -50,7 +52,9 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ }; this.ready = $.Deferred.queue().then(function () { self.required_fields = _(self.fields).chain() - .filter(function (field) { return field.required; }) + .filter(function (field) { + return field.required && + !_.include(self.fields_with_defaults, field.id); }) .pluck('name') .value(); convert_fields(self); @@ -76,20 +80,38 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this.toggle_import_button(false); this.$element.find('#csvfile').change(this.on_autodetect_data); this.$element.find('fieldset').change(this.on_autodetect_data); - this.$element.find('fieldset legend').click(function() { - $(this).next().toggle(); + this.$element.delegate('fieldset legend', 'click', function() { + $(this).parent().toggleClass('oe-closed'); }); this.ready.push(new openerp.web.DataSet(this, this.model).call( 'fields_get', [], function (fields) { self.graft_fields(fields); - })); + self.ready.push(new openerp.web.DataSet(self, self.model) + .default_get(_.pluck(self.fields, 'id'), function (fields) { + _.each(fields, function(val, key) { + if (val) { + self.fields_with_defaults.push(key); + } + }); + }) + ) + })); }, graft_fields: function (fields, parent, level) { parent = parent || this; level = level || 0; var self = this; + if (level === 0) { + parent.fields.push({ + id: 'id', + name: 'id', + string: _t('External ID'), + required: false + }); + } _(fields).each(function (field, field_name) { + if (field_name === 'id') { return; } var f = { id: field_name, name: field_name, @@ -172,9 +194,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ : with_headers ? results.records.slice(1) : results.records })); + this.$element.find('fieldset').addClass('oe-closed'); } else if (results['error']) { result_node.append(QWeb.render('ImportView.error', { 'error': results['error']})); + this.$element.find('fieldset').removeClass('oe-closed'); } else if (results['success']) { if (this.widget_parent.widget_parent.active_view == "list") { this.widget_parent.reload_content(); @@ -182,6 +206,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this.stop(); return; } + this.$element.find('form').removeClass('oe-import-no-result'); + + this.$element.delegate('.oe-m2o-drop-down-button', 'click', function () { + $(this).prev('input').focus(); + }); var self = this; this.ready.then(function () { @@ -198,17 +227,50 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ }); // Column auto-detection _(headers).each(function (header, index) { - var f =_(self.fields).detect(function (field) { - // TODO: levenshtein between header and field.string - return field.name === header || field.string.toLowerCase() === header; - }); - if (f) { - $fields.eq(index).val(f.name); + var field_name = self.match_column_to_field(header); + if (field_name) { + $fields.eq(index).val(field_name); } }); self.on_check_field_values(); }); }, + /** + * Returns the name of the field (nested) matching the provided column name + * + * @param {String} name column name to look for + * @param {Array} [fields] fields to look into for the provided name + * @returns {String|undefined} + */ + match_column_to_field: function (name, fields) { + fields = fields || this.fields; + var f; + f = _(fields).detect(function (field) { + // TODO: levenshtein between header and field.string + return field.name === name + || field.string.toLowerCase() === name.toLowerCase(); + }); + if (f) { return f.name; } + + // if ``name`` is a path (o2m), we need to recurse through its .fields + var index = name.indexOf('/'); + if (index === -1) { return undefined; } + // Get the first path section, try to find the matching field + var column_name = name.substring(0, index); + f = _(fields).detect(function (field) { + // field.name for o2m is $foo/id, so we want to match on id + return field.id === column_name + || field.string.toLowerCase() === column_name.toLowerCase() + }); + if (!f) { return undefined; } + + // if we found a matching field for the first path section, recurse in + // its own .fields to try and get the rest of the path matched + var rest = this.match_column_to_field( + name.substring(index+1), f.fields); + if (!rest) { return undefined; } + return f.id + '/' + rest; + }, /** * Looks through all the field selections, and tries to find if two * (or more) columns were matched to the same model field. diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index d3d88bc3731..3ab972f7a86 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -28,10 +28,13 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) { case 'float': var precision = descriptor.digits ? descriptor.digits[1] : 2; var int_part = Math.floor(value); - var dec_part = Math.abs(Math.floor((value % 1) * Math.pow(10, precision))); - return _.sprintf('%d%s%d', - int_part, - openerp.web._t.database.parameters.decimal_point, dec_part); + var dec_part = _.sprintf( + '%.' + precision + 'f', + Math.abs(value) % 1).substring(2); + return _.sprintf('%d%s%s', + int_part, + openerp.web._t.database.parameters.decimal_point, + dec_part); case 'float_time': return _.sprintf("%02d:%02d", Math.floor(value), @@ -69,6 +72,13 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) { } catch (e) { return value.format("%H:%M:%S"); } + case 'selection': + // Each choice is [value, label] + var result = _(descriptor.selection).detect(function (choice) { + return choice[0] === value; + }); + if (result) { return result[1]; } + return; default: return value; } diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 9cab0ade9d0..b2402cf95fa 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -63,6 +63,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search rows.push(row); var filters = []; _.each(items, function (item) { + if (item.attrs.invisible === '1') { return; } if (filters.length && item.tag !== 'filter') { row.push( new openerp.web.search.FilterGroup( @@ -336,7 +337,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search * @param {Array} errors a never-empty array of error objects */ on_invalid: function (errors) { - this.notification.notify("Invalid Search", "triggered from search view"); + this.do_notify("Invalid Search", "triggered from search view"); }, do_clear: function () { this.$element.find('.filter_label, .filter_icon').removeClass('enabled'); @@ -643,6 +644,12 @@ openerp.web.search.Field = openerp.web.search.Input.extend( /** @lends openerp.w this.attrs = _.extend({}, field, view_section.attrs); this.filters = new openerp.web.search.FilterGroup(_.map( view_section.children, function (filter_node) { + if (filter_node.attrs.string && + typeof console !== 'undefined' && console.debug) { + console.debug("Filter-in-field with a 'string' attribute " + + "in view", view); + } + delete filter_node.attrs.string; return new openerp.web.search.Filter( filter_node, view); }), view); diff --git a/addons/web/static/src/js/view_editor.js b/addons/web/static/src/js/view_editor.js index 29a3f083883..7828c4366c9 100644 --- a/addons/web/static/src/js/view_editor.js +++ b/addons/web/static/src/js/view_editor.js @@ -9,12 +9,10 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ this.model = dataset.model; this.xml_id = 0; }, - start: function() { this.View_editor(); }, - - View_editor : function(){ + View_editor : function() { var self = this; var action = { name:'ViewEditor', @@ -36,7 +34,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ }, }; var action_manager = new openerp.web.ActionManager(this); - this.dialog = new openerp.web.Dialog(this,{ + this.view_edit_dialog = new openerp.web.Dialog(this,{ modal: true, title: 'ViewEditor', width: 750, @@ -54,12 +52,11 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } }, }); - this.dialog.start(); - this.dialog.open(); - action_manager.appendTo(this.dialog); + this.view_edit_dialog.start(); + this.view_edit_dialog.open(); + action_manager.appendTo(this.view_edit_dialog); action_manager.do_action(action); }, - check_attr: function(xml, tag, level) { var obj = new Object(); obj.child_id = []; @@ -84,7 +81,6 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ obj.name = render_name; return obj; }, - save_object: function(val, parent_list, child_obj_list) { var self = this; var check_id = parent_list[0]; @@ -104,8 +100,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ val.child_id = child_obj_list; } }, - - xml_node_create: function(xml, root, parent_list, parent_id, main_object ){ + xml_node_create: function(xml, root, parent_list, parent_id, main_object){ var self = this; var child_obj_list = []; var children_list = $(xml).filter(root).children(); @@ -127,21 +122,19 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } return main_object; }, - parse_xml: function(arch, view_id) { - var self = this; var root = $(arch).filter(":first")[0]; var tag = root.tagName.toLowerCase(); var obj ={'child_id':[],'id':this.xml_id++,'level':0,'att_list':[],'name':""}; - var root_object = self.check_attr(root,tag,0); - obj.child_id = self.xml_node_create(arch, tag, [], this.xml_id-1, [root_object], []) + var root_object = this.check_attr(root,tag,0); + obj.child_id = this.xml_node_create(arch, tag, [], this.xml_id-1, [root_object], []) return [obj]; }, - get_data: function() { var self = this; + var view_arch_list = []; - var view_id =(($("input[name='radiogroup']:checked").parent()).parent()).attr('data-id'); + var view_id =((this.view_edit_dialog.$element.find("input[name='radiogroup']:checked").parent()).parent()).attr('data-id'); var ve_dataset = new openerp.web.DataSet(this, 'ir.ui.view'); ve_dataset.read_ids([parseInt(view_id)], ['arch'], function (arch) { one_object = self.parse_xml(arch[0].arch,view_id); @@ -168,7 +161,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ }); return p_list; }, - inherit_view : function(one_object, result){ + inherit_view : function(one_object, result) { var self = this; var root = $(result.arch).filter('*'); var xml_list = []; @@ -236,11 +229,11 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } break; } - if(obj){ + if(obj) { check_list.shift(); if (check_list.length !=0){ self.full_path_search(check_list ,obj.child_id ,xpath_object); - }else{ + } else { var level = obj.level+1; self.increase_level(xpath_object[0], level) obj.child_id.push(xpath_object[0]); @@ -250,7 +243,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } else { _.each(val,function(element){ - self.full_path_search(check_list ,element.child_id ,xpath_object); + self.full_path_search(check_list ,element.child_id ,xpath_object); }); } } @@ -262,10 +255,9 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ self.increase_level(val, level + 1); }); }, - - edit_view : function(one_object){ + edit_view: function(one_object) { var self = this; - this.dialog = new openerp.web.Dialog(this,{ + this.edit_xml_dialog = new openerp.web.Dialog(this,{ modal: true, title: 'Edit Xml', width: 750, @@ -282,16 +274,15 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } } }); - this.dialog.start().open(); - this.dialog.$element.html(QWeb.render('view_editor', { + this.edit_xml_dialog.start().open(); + this.edit_xml_dialog.$element.html(QWeb.render('view_editor', { 'data': one_object['main_object'], })); - $("tr[id^='viewedit-']").click(function() { + this.edit_xml_dialog.$element.find("tr[id^='viewedit-']").click(function() { $("tr[id^='viewedit-']").removeClass('ui-selected'); $(this).addClass('ui-selected'); }); - - $("img[id^='parentimg-']").click(function() { + this.edit_xml_dialog.$element.find("img[id^='parentimg-']").click(function() { if ($(this).attr('src') == '/web/static/src/img/collapse.gif') { $(this).attr('src', '/web/static/src/img/expand.gif'); self.on_expand(this); @@ -301,8 +292,8 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ self.on_collapse(this,one_object['parent_child_id'], one_object['main_object']); } }); - $("img[id^='side-']").click(function() { - var side = $(this).closest("tr[id^='viewedit-']"); + this.edit_xml_dialog.$element.find("img[id^='side-']").click(function() { + var side = $(this).closest("tr[id^='viewedit-']") var id_tr = (side.attr('id')).split('-')[1]; var img = side.find("img[id='parentimg-"+id_tr+"']").attr('src'); ; var level = parseInt(side.attr('level')); @@ -378,7 +369,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ var last_tr_id = (last_tr.attr('id')).split('-')[1]; img = last_tr.find("img[id='parentimg-" + last_tr_id + "']").attr('src'); if (img) { - $("img[id='parentimg-" + last_tr_id + "']").attr('src', '/web/static/src/img/expand.gif'); + this.edit_xml_dialog.$element.find("img[id='parentimg-" + last_tr_id + "']").attr('src', '/web/static/src/img/expand.gif'); while (1) { var next_tr = last_tr.next(); if (next_tr.attr('level') <= level || next_tr.length == 0) break; @@ -399,7 +390,6 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } }); }, - save_move_arch: function(one_object, view_id, view_xml_id, id_tr, level, move_direct){ var self = this; var arch = _.detect(one_object['arch'],function(element){ @@ -476,9 +466,9 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } }, - on_expand: function(self){ - var level = parseInt($(self).closest("tr[id^='viewedit-']").attr('level')); - var cur_tr = $(self).closest("tr[id^='viewedit-']"); + on_expand: function(expand_img){ + var level = parseInt($(expand_img).closest("tr[id^='viewedit-']").attr('level')); + var cur_tr = $(expand_img).closest("tr[id^='viewedit-']"); while (1) { var nxt_tr = cur_tr.next(); if (parseInt(nxt_tr.attr('level')) > level){ @@ -487,14 +477,14 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({ } else return nxt_tr; } }, - - on_collapse: function(self, parent_child_id, id, main_object) { - var id = self.id.split('-')[1]; + on_collapse: function(collapse_img, parent_child_id, id, main_object) { + var self = this; + var id = collapse_img.id.split('-')[1]; var datas = _.detect(parent_child_id,function(res) { return res.key == id; }); _.each(datas.value, function(rec) { - var tr = $("tr[id='viewedit-"+rec+"']"); + var tr = self.edit_xml_dialog.$element.find("tr[id='viewedit-"+rec+"']"); tr.find("img[id='parentimg-"+rec+"']").attr('src','/web/static/src/img/expand.gif'); tr.show(); }); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index c940f4909e9..1f1b5b8ef6f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -15,7 +15,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# /** * @constructs openerp.web.FormView * @extends openerp.web.View - * + * * @param {openerp.web.Session} session the current openerp session * @param {openerp.web.DataSet} dataset the dataset this view will work with * @param {String} view_id the identifier of the OpenERP view object @@ -33,7 +33,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.widgets_counter = 0; this.fields = {}; this.datarecord = {}; - this.ready = false; this.show_invalid = true; this.dirty_for_user = false; this.default_focus_field = null; @@ -44,7 +43,10 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.translatable_fields = []; _.defaults(this.options, {"always_show_new_button": true, "not_interactible_on_create": false}); - this.save_lock = $.Deferred().resolve(); + this.mutating_lock = $.Deferred(); + this.initial_mutating_lock = this.mutating_lock; + this.on_change_lock = $.Deferred().resolve(); + this.reload_lock = $.Deferred().resolve(); }, start: function() { this._super(); @@ -100,7 +102,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# }); this.$form_header.find('button.oe_form_button_save').click(this.do_save); - this.$form_header.find('button.oe_form_button_save_edit').click(this.do_save_edit); this.$form_header.find('button.oe_form_button_cancel').click(this.do_cancel); this.$form_header.find('button.oe_form_button_new').click(this.on_button_new); this.$form_header.find('button.oe_form_button_duplicate').click(this.on_button_duplicate); @@ -120,7 +121,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id); this.sidebar.start(); this.sidebar.do_unfold(); - this.sidebar.attachments = new openerp.web.form.SidebarAttachments(this.sidebar, this.sidebar.add_section('attachments', "Attachments"), this); + this.sidebar.attachments = new openerp.web.form.SidebarAttachments(this.sidebar, this); this.sidebar.add_toolbar(this.fields_view.toolbar); this.set_common_sidebar_sections(this.sidebar); } @@ -181,7 +182,8 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# } } this.on_form_changed(); - this.show_invalid = this.ready = true; + this.initial_mutating_lock.resolve(); + this.show_invalid = true; this.do_update_pager(record.id == null); if (this.sidebar) { this.sidebar.attachments.do_update(); @@ -224,69 +226,78 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# $pager.find('span.oe_pager_count').html(this.dataset.ids.length); }, do_onchange: function(widget, processed) { - processed = processed || []; - if (widget.node.attrs.on_change) { - var self = this; - this.ready = false; - var onchange = _.trim(widget.node.attrs.on_change); - var call = onchange.match(/^\s?(.*?)\((.*?)\)\s?$/); - if (call) { - var method = call[1], args = []; - var context_index = null; - var argument_replacement = { - 'False' : function() {return false;}, - 'True' : function() {return true;}, - 'None' : function() {return null;}, - 'context': function(i) { - context_index = i; - var ctx = widget.build_context ? widget.build_context() : {}; - return ctx; - } - }; - var parent_fields = null; - _.each(call[2].split(','), function(a, i) { - var field = _.trim(a); - if (field in argument_replacement) { - args.push(argument_replacement[field](i)); - return; - } else if (self.fields[field]) { - var value = self.fields[field].get_on_change_value(); - args.push(value == null ? false : value); - return; - } else { - var splitted = field.split('.'); - if (splitted.length > 1 && _.trim(splitted[0]) === "parent" && self.dataset.parent_view) { - if (parent_fields === null) { - parent_fields = self.dataset.parent_view.get_fields_values(); - } - var p_val = parent_fields[_.trim(splitted[1])]; - if (p_val !== undefined) { - args.push(p_val == null ? false : p_val); - return; + var self = this; + var act = function() { + try { + processed = processed || []; + if (widget.node.attrs.on_change) { + var onchange = _.trim(widget.node.attrs.on_change); + var call = onchange.match(/^\s?(.*?)\((.*?)\)\s?$/); + if (call) { + var method = call[1], args = []; + var context_index = null; + var argument_replacement = { + 'False' : function() {return false;}, + 'True' : function() {return true;}, + 'None' : function() {return null;}, + 'context': function(i) { + context_index = i; + var ctx = widget.build_context ? widget.build_context() : {}; + return ctx; + } + }; + var parent_fields = null; + _.each(call[2].split(','), function(a, i) { + var field = _.trim(a); + if (field in argument_replacement) { + args.push(argument_replacement[field](i)); + return; + } else if (self.fields[field]) { + var value = self.fields[field].get_on_change_value(); + args.push(value == null ? false : value); + return; + } else { + var splitted = field.split('.'); + if (splitted.length > 1 && _.trim(splitted[0]) === "parent" && self.dataset.parent_view) { + if (parent_fields === null) { + parent_fields = self.dataset.parent_view.get_fields_values(); + } + var p_val = parent_fields[_.trim(splitted[1])]; + if (p_val !== undefined) { + args.push(p_val == null ? false : p_val); + return; + } } } - } - throw "Could not get field with name '" + field + - "' for onchange '" + onchange + "'"; - }); - var ajax = { - url: '/web/dataset/call', - async: false - }; - return this.rpc(ajax, { - model: this.dataset.model, - method: method, - args: [(this.datarecord.id == null ? [] : [this.datarecord.id])].concat(args), - context_id: context_index === null ? null : context_index + 1 - }, function(response) { - self.on_processed_onchange(response, processed); - }); - } else { - console.log("Wrong on_change format", on_change); + throw "Could not get field with name '" + field + + "' for onchange '" + onchange + "'"; + }); + var ajax = { + url: '/web/dataset/call', + async: false + }; + return self.rpc(ajax, { + model: self.dataset.model, + method: method, + args: [(self.datarecord.id == null ? [] : [self.datarecord.id])].concat(args), + context_id: context_index === null ? null : context_index + 1 + }).pipe(function(response) { + return self.on_processed_onchange(response, processed); + }); + } else { + console.log("Wrong on_change format", on_change); + } } - } + } catch(e) { + console.error(e); + return $.Deferred().reject(); + } + }; + this.on_change_lock = this.on_change_lock.pipe(act, act); + return this.on_change_lock; }, on_processed_onchange: function(response, processed) { + try { var result = response; if (result.value) { for (var f in result.value) { @@ -319,7 +330,11 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# if (result.domain) { // TODO: } - this.ready = true; + return $.Deferred().resolve(); + } catch(e) { + console.error(e); + return $.Deferred().reject(); + } }, on_button_new: function() { var self = this; @@ -367,9 +382,9 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# do_save: function(success, prepend_on_create) { var self = this; var action = function() { - if (!self.ready) { - return $.Deferred().reject(); - } + try { + if (!self.initial_mutating_lock.isResolved() && !self.initial_mutating_lock.isRejected()) + return; var form_dirty = false, form_invalid = false, values = {}, @@ -403,12 +418,13 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# }).then(success); } } + } catch (e) { + console.error(e); + return $.Deferred().reject(); + } }; - this.save_lock = this.save_lock.pipe(action, action); - }, - do_save_edit: function() { - this.do_save(); - //this.switch_readonly(); Use promises + this.mutating_lock = this.mutating_lock.pipe(action, action); + return this.mutating_lock; }, switch_readonly: function() { }, @@ -422,14 +438,15 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# } }); msg += ""; - this.notification.warn("The following fields are invalid :", msg); + this.do_warn("The following fields are invalid :", msg); }, on_saved: function(r, success) { if (!r.result) { // should not happen in the server, but may happen for internal purpose return $.Deferred().reject(); } else { - return this.reload().then(success); + this.reload(); + return $.when(r).then(success); } }, /** @@ -463,9 +480,8 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.sidebar.attachments.do_update(); } console.debug("The record has been created with id #" + this.datarecord.id); - return this.reload().pipe(function() { - return _.extend(r, {created: true}); - }).then(success); + this.reload(); + return $.when(_.extend(r, {created: true})).then(success); } }, on_action: function (action) { @@ -475,11 +491,16 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# console.debug("Cancelling form"); }, reload: function() { - if (this.dataset.index == null || this.dataset.index < 0) { - return $.when(this.on_button_new()); - } else { - return this.dataset.read_index(_.keys(this.fields_view.fields), this.on_record_loaded); - } + var self = this; + var act = function() { + if (self.dataset.index == null || self.dataset.index < 0) { + return $.when(self.on_button_new()); + } else { + return self.dataset.read_index(_.keys(self.fields_view.fields), self.on_record_loaded); + } + }; + this.reload_lock = this.reload_lock.pipe(act, act); + return this.reload_lock; }, get_fields_values: function() { var values = {}; @@ -530,11 +551,13 @@ openerp.web.FormDialog = openerp.web.Dialog.extend({ this.form.on_saved.add_last(this.on_form_dialog_saved); return this; }, - load_id: function(id) { - var self = this; - return this.dataset.read_ids([id], _.keys(this.form.fields_view.fields), function(records) { - self.form.on_record_loaded(records[0]); - }); + select_id: function(id) { + if (this.form.dataset.select_id(id)) { + return this.form.do_show(); + } else { + this.do_warn("Could not find id in dataset"); + return $.Deferred().reject(); + } }, on_form_dialog_saved: function(r) { this.close(); @@ -545,8 +568,12 @@ openerp.web.FormDialog = openerp.web.Dialog.extend({ openerp.web.form = {}; openerp.web.form.SidebarAttachments = openerp.web.Widget.extend({ - init: function(parent, element_id, form_view) { - this._super(parent, element_id); + init: function(parent, form_view) { + var $section = parent.add_section(_t('Attachments'), 'attachments'); + this.$div = $('
'); + $section.append(this.$div); + + this._super(parent, $section.attr('id')); this.view = form_view; }, do_update: function() { @@ -564,7 +591,7 @@ openerp.web.form.SidebarAttachments = openerp.web.Widget.extend({ }, on_attachments_loaded: function(attachments) { this.attachments = attachments; - this.$element.html(QWeb.render('FormView.sidebar.attachments', this)); + this.$div.html(QWeb.render('FormView.sidebar.attachments', this)); this.$element.find('.oe-binary-file').change(this.on_attachment_changed); this.$element.find('.oe-sidebar-attachment-delete').click(this.on_attachment_delete); }, @@ -586,7 +613,7 @@ openerp.web.form.SidebarAttachments = openerp.web.Widget.extend({ ids: [parseInt($e.attr('data-id'))] }, function(r) { $e.parent().remove(); - self.notification.notify("Delete an attachment", "The attachment '" + name + "' has been deleted"); + self.do_notify("Delete an attachment", "The attachment '" + name + "' has been deleted"); }); } } @@ -669,6 +696,7 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form. this.view = view; this.node = node; this.modifiers = JSON.parse(this.node.attrs.modifiers || '{}'); + this.always_invisible = (this.modifiers.invisible && this.modifiers.invisible === true); this.type = this.type || node.tag; this.element_name = this.element_name || this.type; this.element_class = [ @@ -705,6 +733,51 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form. render: function() { var template = this.template; return QWeb.render(template, { "widget": this }); + }, + _build_view_fields_values: function() { + var a_dataset = this.view.dataset; + var fields_values = this.view.get_fields_values(); + var parent_values = a_dataset.parent_view ? a_dataset.parent_view.get_fields_values() : {}; + fields_values.parent = parent_values; + return fields_values; + }, + _build_eval_context: function() { + var a_dataset = this.view.dataset; + return new openerp.web.CompoundContext(a_dataset.get_context(), this._build_view_fields_values()); + }, + /** + * Builds a new context usable for operations related to fields by merging + * the fields'context with the action's context. + */ + build_context: function() { + var f_context = (this.field || {}).context || {}; + if (!!f_context.__ref) { + var fields_values = this._build_eval_context(); + f_context = new openerp.web.CompoundDomain(f_context).set_eval_context(fields_values); + } + // maybe the default_get should only be used when we do a default_get? + var v_contexts = _.compact([this.node.attrs.default_get || null, + this.node.attrs.context || null]); + var v_context = new openerp.web.CompoundContext(); + _.each(v_contexts, function(x) {v_context.add(x);}); + if (_.detect(v_contexts, function(x) {return !!x.__ref;})) { + var fields_values = this._build_eval_context(); + v_context.set_eval_context(fields_values); + } + // if there is a context on the node, overrides the model's context + var ctx = v_contexts.length > 0 ? v_context : f_context; + return ctx; + }, + build_domain: function() { + var f_domain = this.field.domain || []; + var n_domain = this.node.attrs.domain || null; + // if there is a domain on the node, overrides the model's domain + var final_domain = n_domain !== null ? n_domain : f_domain; + if (!(final_domain instanceof Array)) { + var fields_values = this._build_eval_context(); + final_domain = new openerp.web.CompoundDomain(final_domain).set_eval_context(fields_values); + } + return final_domain; } }); @@ -739,18 +812,26 @@ openerp.web.form.WidgetFrame = openerp.web.form.Widget.extend({ }, set_row_cells_with: function(row) { var bypass = 0, - max_width = 100; + max_width = 100, + row_length = row.length; for (var i = 0; i < row.length; i++) { - bypass += row[i].width === undefined ? 0 : 1; - max_width -= row[i].decrease_max_width; + if (row[i].always_invisible) { + row_length--; + } else { + bypass += row[i].width === undefined ? 0 : 1; + max_width -= row[i].decrease_max_width; + } } var size_unit = Math.round(max_width / (this.columns - bypass)), colspan_sum = 0; for (var i = 0; i < row.length; i++) { var w = row[i]; + if (w.always_invisible) { + continue; + } colspan_sum += w.colspan; if (w.width === undefined) { - var width = (i === row.length - 1 && colspan_sum === this.columns) ? max_width : Math.round(size_unit * w.colspan); + var width = (i === row_length - 1 && colspan_sum === this.columns) ? max_width : Math.round(size_unit * w.colspan); max_width -= width; w.width = width + '%'; } @@ -780,13 +861,15 @@ openerp.web.form.WidgetFrame = openerp.web.form.Widget.extend({ this.add_widget(widget); }, add_widget: function(widget, colspan) { - colspan = colspan || widget.colspan; var current_row = this.table[this.table.length - 1]; - if (current_row.length && (this.x + colspan) > this.columns) { - current_row = this.add_row(); + if (!widget.always_invisible) { + colspan = colspan || widget.colspan; + if (current_row.length && (this.x + colspan) > this.columns) { + current_row = this.add_row(); + } + this.x += widget.colspan; } current_row.push(widget); - this.x += widget.colspan; return widget; } }); @@ -918,7 +1001,7 @@ openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({ return self.on_confirmed(); } }; - if (!this.node.attrs.special && (this.view.dirty_for_user || !this.view.datarecord.id)) { + if (!this.node.attrs.special) { return this.view.recursive_save().pipe(exec_action); } else { return exec_action(); @@ -927,8 +1010,15 @@ openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({ on_confirmed: function() { var self = this; + var context = this.node.attrs.context; + if (context && context.__ref) { + context = new openerp.web.CompoundContext(context); + context.set_eval_context(this._build_eval_context()); + } + return this.view.do_execute_action( - this.node.attrs, this.view.dataset, this.view.datarecord.id, function () { + _.extend({}, this.node.attrs, {context: context}), + this.view.dataset, this.view.datarecord.id, function () { self.view.reload(); }); }, @@ -937,7 +1027,7 @@ openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({ this.check_disable(); }, check_disable: function() { - if (this.force_disabled || !this.view.is_interactible_record()) { + if (this.readonly || this.force_disabled || !this.view.is_interactible_record()) { this.$element.find("button").attr("disabled", "disabled"); this.$element.find("button").css("color", "grey"); } else { @@ -1075,51 +1165,6 @@ openerp.web.form.Field = openerp.web.form.Widget.extend(/** @lends openerp.web.f this.invalid = false; }, focus: function() { - }, - _build_view_fields_values: function() { - var a_dataset = this.view.dataset; - var fields_values = this.view.get_fields_values(); - var parent_values = a_dataset.parent_view ? a_dataset.parent_view.get_fields_values() : {}; - fields_values.parent = parent_values; - return fields_values; - }, - _build_eval_context: function() { - var a_dataset = this.view.dataset; - return new openerp.web.CompoundContext(a_dataset.get_context(), this._build_view_fields_values()); - }, - /** - * Builds a new context usable for operations related to fields by merging - * the fields'context with the action's context. - */ - build_context: function() { - var f_context = this.field.context || {}; - if (!!f_context.__ref) { - var fields_values = this._build_eval_context(); - f_context = new openerp.web.CompoundDomain(f_context).set_eval_context(fields_values); - } - // maybe the default_get should only be used when we do a default_get? - var v_contexts = _.compact([this.node.attrs.default_get || null, - this.node.attrs.context || null]); - var v_context = new openerp.web.CompoundContext(); - _.each(v_contexts, function(x) {v_context.add(x);}); - if (_.detect(v_contexts, function(x) {return !!x.__ref;})) { - var fields_values = this._build_eval_context(); - v_context.set_eval_context(fields_values); - } - // if there is a context on the node, overrides the model's context - var ctx = v_contexts.length > 0 ? v_context : f_context; - return ctx; - }, - build_domain: function() { - var f_domain = this.field.domain || []; - var n_domain = this.node.attrs.domain || null; - // if there is a domain on the node, overrides the model's domain - var final_domain = n_domain !== null ? n_domain : f_domain; - if (!(final_domain instanceof Array)) { - var fields_values = this._build_eval_context(); - final_domain = new openerp.web.CompoundDomain(final_domain).set_eval_context(fields_values); - } - return final_domain; } }); @@ -1165,7 +1210,7 @@ openerp.web.form.FieldEmail = openerp.web.form.FieldChar.extend({ }, on_button_clicked: function() { if (!this.value || !this.is_valid()) { - this.notification.warn("E-mail error", "Can't send email to invalid e-mail address"); + this.do_warn("E-mail error", "Can't send email to invalid e-mail address"); } else { location.href = 'mailto:' + this.value; } @@ -1180,7 +1225,7 @@ openerp.web.form.FieldUrl = openerp.web.form.FieldChar.extend({ }, on_button_clicked: function() { if (!this.value) { - this.notification.warn("Resource error", "This resource is empty"); + this.do_warn("Resource error", "This resource is empty"); } else { window.open(this.value); } @@ -1188,6 +1233,19 @@ openerp.web.form.FieldUrl = openerp.web.form.FieldChar.extend({ }); openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({ + init: function (view, node) { + this._super(view, node); + if (node.attrs.digits) { + this.parse_digits(node.attrs.digits); + } else { + this.digits = view.fields_view.fields[node.attrs.name].digits; + } + }, + parse_digits: function (digits_attr) { + // could use a Python parser instead. + var match = /^\s*[\(\[](\d+),\s*(\d+)/.exec(digits_attr); + return [parseInt(match[1], 10), parseInt(match[2], 10)]; + }, set_value: function(value) { if (value === false || value === undefined) { // As in GTK client, floats default to 0 @@ -1214,7 +1272,7 @@ openerp.web.DateTimeWidget = openerp.web.Widget.extend({ }); this.$element.find('img.oe_datepicker_trigger').click(function() { if (!self.readonly) { - self.picker('setDate', self.value || new Date()); + self.picker('setDate', self.value ? openerp.web.auto_str_to_date(self.value) : new Date()); self.$element.find('.oe_datepicker').toggle(); } }); @@ -1361,11 +1419,7 @@ openerp.web.form.FieldBoolean = openerp.web.form.Field.extend({ start: function() { var self = this; this._super.apply(this, arguments); - this.$element.find('input').click(function() { - if ($(this).is(':checked') != self.value) { - self.on_ui_change(); - } - }); + this.$element.find('input').click(self.on_ui_change); }, set_value: function(value) { this._super.apply(this, arguments); @@ -1379,9 +1433,6 @@ openerp.web.form.FieldBoolean = openerp.web.form.Field.extend({ this._super.apply(this, arguments); this.$element.find('input').attr('disabled', this.readonly); }, - validate: function() { - this.invalid = this.required && !this.$element.find('input').is(':checked'); - }, focus: function() { this.$element.find('input').focus(); } @@ -1577,6 +1628,11 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ } else { $("#" + self.cm_id + " .oe_m2o_menu_item_mandatory").addClass("oe-m2o-disabled-cm"); } + if (!self.readonly) { + $("#" + self.cm_id + " .oe_m2o_menu_item_noreadonly").removeClass("oe-m2o-disabled-cm"); + } else { + $("#" + self.cm_id + " .oe_m2o_menu_item_noreadonly").addClass("oe-m2o-disabled-cm"); + } return true; }, menuStyle: {width: "200px"} }); @@ -1596,6 +1652,8 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ } }); this.$drop_down.click(function() { + if (self.readonly) + return; if (self.$input.autocomplete("widget").is(":visible")) { self.$input.autocomplete("close"); } else { @@ -1802,6 +1860,10 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ }, focus: function () { this.$input.focus(); + }, + update_dom: function() { + this._super.apply(this, arguments); + this.$input.attr('disabled', this.readonly); } }); @@ -1856,7 +1918,9 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ init: function(view, node) { this._super(view, node); this.is_started = $.Deferred(); + this.is_setted = $.Deferred(); this.form_last_update = $.Deferred(); + this.init_form_last_update = this.form_last_update; this.disable_utility_classes = true; }, start: function() { @@ -1898,7 +1962,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ form: 'openerp.web.form.One2ManyFormView' }); var once = $.Deferred().then(function() { - self.form_last_update.resolve(); + self.init_form_last_update.resolve(); }); this.viewmanager.on_controller_inited.add_last(function(view_type, controller) { if (view_type == "list") { @@ -1910,7 +1974,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ controller.on_pager_action.add_first(function() { self.save_form_view(); }); - controller.$element.find(".oe_form_button_save_edit").hide(); + controller.$element.find(".oe_form_button_save").hide(); } else if (view_type == "graph") { self.reload_current_view() } @@ -1919,9 +1983,11 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ this.viewmanager.on_mode_switch.add_first(function() { self.save_form_view(); }); - setTimeout(function () { - self.viewmanager.appendTo(self.$element); - }, 0); + this.is_setted.then(function() { + setTimeout(function () { + self.viewmanager.appendTo(self.$element); + }, 0); + }); }, reload_current_view: function() { var self = this; @@ -1932,9 +1998,10 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ if (this.dataset.index === null && this.dataset.ids.length >= 1) { this.dataset.index = 0; } - this.form_last_update.then(function() { - this.form_last_update = view.do_show(); - }); + var act = function() { + return view.do_show(); + } + this.form_last_update = this.form_last_update.pipe(act, act);; } else if (self.viewmanager.active_view === "graph") { view.do_search(this.build_domain(), this.dataset.get_context(), []); } @@ -1997,6 +2064,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ $.when(this.is_started).then(function() { self.reload_current_view(); }); + this.is_setted.resolve(); }, get_value: function() { var self = this; @@ -2025,9 +2093,10 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ var view = this.viewmanager.views[this.viewmanager.active_view].controller; if (this.viewmanager.active_view === "form") { var res = $.when(view.do_save()); - if (!res.isResolved() && !res.isRejected()) { - throw "Asynchronous get_value() is not supported in form view."; - } + // it seems line there are some cases when this happens + /*if (!res.isResolved() && !res.isRejected()) { + console.warn("Asynchronous get_value() is not supported in form view."); + }*/ return res; } } @@ -2039,6 +2108,8 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ }, validate: function() { this.invalid = false; + if (!this.viewmanager.views[this.viewmanager.active_view]) + return; var view = this.viewmanager.views[this.viewmanager.active_view].controller; if (this.viewmanager.active_view === "form") { for (var f in view.fields) { @@ -2362,13 +2433,17 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope var $nbutton = $buttons.find(".oe_selectcreatepopup-form-save-new"); $nbutton.click(function() { $.when(self.view_form.do_save()).then(function() { - self.view_form.on_button_new(); + self.view_form.reload_lock.then(function() { + self.view_form.on_button_new(); + }); }); }); var $nbutton = $buttons.find(".oe_selectcreatepopup-form-save"); $nbutton.click(function() { $.when(self.view_form.do_save()).then(function() { - self.check_exit(); + self.view_form.reload_lock.then(function() { + self.check_exit(); + }); }); }); var $cbutton = $buttons.find(".oe_selectcreatepopup-form-close"); @@ -2437,7 +2512,6 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp this.setup_form_view(); }, on_write: function(id, data) { - this.stop(); if (!this.options.auto_write) return; var self = this; @@ -2460,7 +2534,9 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp $buttons.html(QWeb.render("FormOpenPopup.form.buttons")); var $nbutton = $buttons.find(".oe_formopenpopup-form-save"); $nbutton.click(function() { - self.view_form.do_save(); + self.view_form.do_save().then(function() { + self.stop(); + }); }); var $cbutton = $buttons.find(".oe_formopenpopup-form-close"); $cbutton.click(function() { @@ -2587,7 +2663,7 @@ openerp.web.form.FieldBinary = openerp.web.form.Field.extend({ on_file_uploaded: function(size, name, content_type, file_base64) { delete(window[this.iframe]); if (size === false) { - this.notification.warn("File Upload", "There was a problem while uploading your file"); + this.do_warn("File Upload", "There was a problem while uploading your file"); // TODO: use openerp web crashmanager console.warn("Error while uploading file : ", name); } else { @@ -2600,14 +2676,10 @@ openerp.web.form.FieldBinary = openerp.web.form.Field.extend({ on_file_uploaded_and_valid: function(size, name, content_type, file_base64) { }, on_save_as: function() { - if (!this.view.datarecord.id) { - this.notification.warn("Can't save file", "The record has not yet been saved"); - } else { - var url = '/web/binary/saveas?session_id=' + this.session.session_id + '&model=' + - this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name + - '&fieldname=' + (this.node.attrs.filename || '') + '&t=' + (new Date().getTime()); - window.open(url); - } + var url = '/web/binary/saveas?session_id=' + this.session.session_id + '&model=' + + this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name + + '&fieldname=' + (this.node.attrs.filename || '') + '&t=' + (new Date().getTime()); + window.open(url); }, on_clear: function() { if (this.value !== false) { @@ -2624,6 +2696,7 @@ openerp.web.form.FieldBinaryFile = openerp.web.form.FieldBinary.extend({ update_dom: function() { this._super.apply(this, arguments); this.$element.find('.oe-binary-file-set, .oe-binary-file-clear').toggle(!this.readonly); + this.$element.find('input[type=text]').attr('disabled', this.readonly); }, set_value: function(value) { this._super.apply(this, arguments); @@ -2691,21 +2764,21 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({ start: function() { this._super(); this.selected_value = null; - + this.render_list(); }, set_value: function(value) { this._super(value); this.selected_value = value; - + this.render_list(); }, render_list: function() { var self = this; var shown = _.map(((this.node.attrs || {}).statusbar_visible || "").split(","), - function(x) { return x.trim(); }); + function(x) { return _.trim(x); }); shown = _.select(shown, function(x) { return x.length > 0; }); - + if (shown.length == 0) { this.to_show = this.field.selection; } else { @@ -2713,27 +2786,44 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({ return _.indexOf(shown, x[0]) !== -1 || x[0] === self.selected_value; }); } - + var content = openerp.web.qweb.render("FieldStatus.content", {widget: this, _:_}); this.$element.html(content); - + var colors = JSON.parse((this.node.attrs || {}).statusbar_colors || "{}"); var color = colors[this.selected_value]; if (color) { var elem = this.$element.find("li.oe-arrow-list-selected span"); elem.css("border-color", color); + if (this.check_white(color)) + elem.css("color", "white"); elem = this.$element.find("li.oe-arrow-list-selected .oe-arrow-list-before"); elem.css("border-left-color", "rgba(0,0,0,0)"); elem = this.$element.find("li.oe-arrow-list-selected .oe-arrow-list-after"); elem.css("border-color", "rgba(0,0,0,0)"); elem.css("border-left-color", color); } + }, + check_white: function(color) { + var div = $("
"); + div.css("display", "none"); + div.css("color", color); + div.appendTo($("body")); + var ncolor = div.css("color"); + div.remove(); + var res = /^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/.exec(ncolor); + if (!res) { + return false; + } + var comps = [parseInt(res[1]), parseInt(res[2]), parseInt(res[3])]; + var lum = comps[0] * 0.3 + comps[1] * 0.59 + comps[1] * 0.11; + if (lum < 128) { + return true; + } + return false; } }); -openerp.web.form.WidgetNotebookReadonly = openerp.web.form.WidgetNotebook.extend({ - template: 'WidgetNotebook.readonly' -}); openerp.web.form.FieldReadonly = openerp.web.form.Field.extend({ }); @@ -2761,15 +2851,15 @@ openerp.web.form.FieldEmailReadonly = openerp.web.form.FieldURIReadonly.extend({ }); openerp.web.form.FieldUrlReadonly = openerp.web.form.FieldURIReadonly.extend({ set_value: function (value) { - var s = /(\w+):(\.+)/.match(value); - if (!(s[0] === 'http' || s[0] === 'https')) { return; } - this.scheme = s[0]; - this._super(s[1]); + var s = /(\w+):(.+)/.exec(value); + if (!s || !(s[1] === 'http' || s[1] === 'https')) { return; } + this.scheme = s[1]; + this._super(s[2]); } }); openerp.web.form.FieldBooleanReadonly = openerp.web.form.FieldCharReadonly.extend({ set_value: function (value) { - this._super(value ? '\u2714' : '\u2718'); + this._super(value ? '\u2611' : '\u2610'); } }); openerp.web.form.FieldSelectionReadonly = openerp.web.form.FieldReadonly.extend({ @@ -2800,7 +2890,7 @@ openerp.web.form.FieldMany2OneReadonly = openerp.web.form.FieldCharReadonly.exte value = value || null; this.invalid = false; var self = this; - this.tmp_value = value; + this.value = value; self.update_dom(); self.on_value_changed(); var real_set_value = function(rval) { @@ -2852,7 +2942,6 @@ openerp.web.form.widgets = new openerp.web.Registry({ 'statusbar': 'openerp.web.form.FieldStatus' }); openerp.web.form.readonly = openerp.web.form.widgets.clone({ - 'notebook': 'openerp.web.form.WidgetNotebookReadonly', 'char': 'openerp.web.form.FieldCharReadonly', 'email': 'openerp.web.form.FieldEmailReadonly', 'url': 'openerp.web.form.FieldUrlReadonly', diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 0ea1f7ec944..d09ec1d3035 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1,4 +1,5 @@ openerp.web.list = function (openerp) { +var _t = openerp.web._t; var QWeb = openerp.web.qweb; openerp.web.views.add('list', 'openerp.web.ListView'); openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# */ { @@ -10,7 +11,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# // whether the column headers should be displayed 'header': true, // display addition button, with that label - 'addable': "New", + 'addable': _t("New"), // whether the list view can be sorted, note that once a view has been // sorted it can not be reordered anymore 'sortable': true, @@ -252,7 +253,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# '' + '' + '' + - '') + '') .change(function () { var val = parseInt($select.val(), 10); self._limit = (isNaN(val) ? null : val); @@ -463,7 +464,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# * @param {Array} ids the ids of the records to delete */ do_delete: function (ids) { - if (!ids.length) { + if (!(ids.length && confirm(_t("Are you sure to remove those records ?")))) { return; } var self = this; @@ -767,24 +768,71 @@ openerp.web.ListView.List = openerp.web.Class.extend( /** @lends openerp.web.Lis $row = $target.closest('tr'), record_id = self.row_id($row); - $(self).trigger('action', [field, record_id, function () { + // note: $.data converts data to number if it's composed only + // of digits, nice when storing actual numbers, not nice when + // storing strings composed only of digits. Force the action + // name to be a string + $(self).trigger('action', [field.toString(), record_id, function () { return self.reload_record(self.records.get(record_id)); }]); }) .delegate('tr', 'click', function (e) { e.stopPropagation(); - self.dataset.index = self.records.indexOf( - self.records.get( - self.row_id(e.currentTarget))); - self.row_clicked(e); + var row_id = self.row_id(e.currentTarget); + if (row_id !== undefined) { + if (!self.dataset.select_id(row_id)) { + throw "Could not find id in dataset" + } + self.row_clicked(e); + } }); }, row_clicked: function () { $(this).trigger( 'row_link', - [this.records.at(this.dataset.index).get('id'), + [this.dataset.ids[this.dataset.index], this.dataset]); }, + render_cell: function (record, column) { + var value; + if(column.type === 'reference') { + value = record.get(column.id); + var ref_match; + // Ensure that value is in a reference "shape", otherwise we're + // going to loop on performing name_get after we've resolved (and + // set) a human-readable version. m2o does not have this issue + // because the non-human-readable is just a number, where the + // human-readable version is a pair + if (value && (ref_match = /([\w\.]+),(\d+)/.exec(value))) { + // reference values are in the shape "$model,$id" (as a + // string), we need to split and name_get this pair in order + // to get a correctly displayable value in the field + var model = ref_match[1], + id = parseInt(ref_match[2], 10); + new openerp.web.DataSet(this.view, model).name_get([id], function(names) { + if (!names.length) { return; } + record.set(column.id, names[0][1]); + }); + } + } else if (column.type === 'many2one') { + value = record.get(column.id); + // m2o values are usually name_get formatted, [Number, String] + // pairs, but in some cases only the id is provided. In these + // cases, we need to perform a name_get call to fetch the actual + // displayable value + if (typeof value === 'number' || value instanceof Number) { + // fetch the name, set it on the record (in the right field) + // and let the various registered events handle refreshing the + // row + new openerp.web.DataSet(this.view, column.relation) + .name_get([value], function (names) { + if (!names.length) { return; } + record.set(column.id, names[0]); + }); + } + } + return openerp.web.format_cell(record.toForm().data, column); + }, render: function () { if (this.$current) { this.$current.remove(); @@ -792,7 +840,7 @@ openerp.web.ListView.List = openerp.web.Class.extend( /** @lends openerp.web.Lis this.$current = this.$_element.clone(true); this.$current.empty().append( QWeb.render('ListView.rows', _.extend({ - render_cell: openerp.web.format_cell}, this))); + render_cell: $.proxy(this, 'render_cell')}, this))); this.pad_table_to(5); }, pad_table_to: function (count) { @@ -900,7 +948,7 @@ openerp.web.ListView.List = openerp.web.Class.extend( /** @lends openerp.web.Lis record: record, row_parity: (index % 2 === 0) ? 'even' : 'odd', view: this.view, - render_cell: openerp.web.format_cell + render_cell: $.proxy(this, 'render_cell') }); }, /** @@ -1075,7 +1123,7 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L var group_column = _(self.columns).detect(function (column) { return column.id === group.grouped_on; }); $group_column.html(openerp.web.format_cell( - row_data, group_column, "Undefined" + row_data, group_column, _t("Undefined") )); if (group.openable) { // Make openable if not terminal group & group_by_no_leaf diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 826508eaa27..4cc081a6266 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -194,7 +194,7 @@ openerp.web.list_editable = function (openerp) { } self.edition = true; self.edition_id = record_id; - self.edition_form = _.extend(new openerp.web.ListEditableFormView(self, self.dataset, false), { + self.edition_form = _.extend(new openerp.web.ListEditableFormView(self.view, self.dataset, false), { form_template: 'ListView.row.form', registry: openerp.web.list.form.widgets, $element: $new_row diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index 78818c069c0..5143adb3838 100644 --- a/addons/web/static/src/js/view_tree.js +++ b/addons/web/static/src/js/view_tree.js @@ -110,7 +110,7 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView# } }); - if (this.fields_view.arch.attrs.colors) { + if (!this.fields_view.arch.attrs.colors) { return; } this.colors = _(this.fields_view.arch.attrs.colors.split(';')).chain() diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 04415166de2..10e53efa591 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -2,21 +2,21 @@ * OpenERP web library *---------------------------------------------------------*/ -openerp.web.views = function(db) { +openerp.web.views = function(session) { -var _t = db.web._t; +var _t = session.web._t; /** * Registry for all the client actions key: tag value: widget */ -db.web.client_actions = new db.web.Registry(); +session.web.client_actions = new session.web.Registry(); /** * Registry for all the main views */ -db.web.views = new db.web.Registry(); +session.web.views = new session.web.Registry(); -db.web.ActionManager = db.web.Widget.extend({ +session.web.ActionManager = session.web.Widget.extend({ identifier_prefix: "actionmanager", init: function(parent) { this._super(parent); @@ -93,20 +93,20 @@ db.web.ActionManager = db.web.Widget.extend({ ir_actions_act_window: function (action, on_close) { if (action.target === 'new') { if (this.dialog == null) { - this.dialog = new db.web.Dialog(this, { title: action.name, width: '80%' }); + this.dialog = new session.web.Dialog(this, { title: action.name, width: '80%' }); if(on_close) this.dialog.on_close.add(on_close); this.dialog.start(); } else { this.dialog_viewmanager.stop(); } - this.dialog_viewmanager = new db.web.ViewManagerAction(this, action); + this.dialog_viewmanager = new session.web.ViewManagerAction(this, action); this.dialog_viewmanager.appendTo(this.dialog.$element); this.dialog.open(); } else { this.dialog_stop(); this.content_stop(); - this.inner_viewmanager = new db.web.ViewManagerAction(this, action); + this.inner_viewmanager = new session.web.ViewManagerAction(this, action); this.inner_viewmanager.appendTo(this.$element); this.url_update(action); } @@ -121,6 +121,12 @@ db.web.ActionManager = db.web.Widget.extend({ if (!this.dialog && on_closed) { on_closed(); } + if (this.dialog && action.context) { + var model = action.context.active_model; + if (model === 'base.module.upgrade' || model === 'base.setup.installer' || model === 'base.module.upgrade') { + session.webclient.do_reload(); + } + } this.dialog_stop(); }, ir_actions_server: function (action, on_closed) { @@ -134,7 +140,7 @@ db.web.ActionManager = db.web.Widget.extend({ }, ir_actions_client: function (action) { this.content_stop(); - var ClientWidget = db.web.client_actions.get_object(action.tag); + var ClientWidget = session.web.client_actions.get_object(action.tag); (this.client_widget = new ClientWidget(this, action.params)).appendTo(this); }, ir_actions_report_xml: function(action) { @@ -152,15 +158,18 @@ db.web.ActionManager = db.web.Widget.extend({ complete: $.unblockUI }); }); + }, + ir_actions_act_url: function (action) { + window.open(action.url, action.target === 'self' ? '_self' : '_blank'); } }); -db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ +session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.ViewManager# */{ identifier_prefix: "viewmanager", template: "ViewManager", /** - * @constructs db.web.ViewManager - * @extends db.web.Widget + * @constructs session.web.ViewManager + * @extends session.web.Widget * * @param parent * @param dataset @@ -176,10 +185,10 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ this.views_src = _.map(views, function(x) {return x instanceof Array? {view_id: x[0], view_type: x[1]} : x;}); this.views = {}; this.flags = this.flags || {}; - this.registry = db.web.views; + this.registry = session.web.views; }, render: function() { - return db.web.qweb.render(this.template, { + return session.web.qweb.render(this.template, { self: this, prefix: this.element_id, views: this.views_src}); @@ -275,7 +284,7 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ if (this.searchview) { this.searchview.stop(); } - this.searchview = new db.web.SearchView( + this.searchview = new session.web.SearchView( this, this.dataset, view_id, search_defaults, this.flags.search_view === false); @@ -325,13 +334,13 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{ on_action_executed: function () {} }); -db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.ViewManagerAction# */{ +session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepnerp.web.ViewManagerAction# */{ template:"ViewManagerAction", /** - * @constructs db.web.ViewManagerAction - * @extends db.web.ViewManager + * @constructs session.web.ViewManagerAction + * @extends session.web.ViewManager * - * @param {db.web.ActionManager} parent parent object/widget + * @param {session.web.ActionManager} parent parent object/widget * @param {Object} action descriptor for the action this viewmanager needs to manage its views. */ init: function(parent, action) { @@ -341,7 +350,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View this._super(parent, null, action.views); this.session = parent.session; this.action = action; - var dataset = new db.web.DataSetSearch(this, action.res_model, action.context, action.domain); + var dataset = new session.web.DataSetSearch(this, action.res_model, action.context, action.domain); if (action.res_id) { dataset.ids.push(action.res_id); dataset.index = 0; @@ -391,12 +400,12 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View this.$element.find('.oe_get_xml_view').click(function () { // TODO: add search view? - $('
').text(db.web.json_node_to_xml(
+            $('
').text(session.web.json_node_to_xml(
                 self.views[self.active_view].controller.fields_view.arch, true))
                     .dialog({ width: '95%'});
         });
         if (this.action.help && !this.flags.low_profile) {
-            var Users = new db.web.DataSet(self, 'res.users'),
+            var Users = new session.web.DataSet(self, 'res.users'),
                 header = this.$element.find('.oe-view-manager-header');
             header.delegate('blockquote button', 'click', function() {
                 var $this = $(this);
@@ -425,10 +434,16 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
     on_mode_switch: function (view_type) {
         var self = this;
         return $.when(
-            this._super(view_type),
-            this.shortcut_check(this.views[view_type])).then(function () {
-                var view_id = self.views[self.active_view].controller.fields_view.view_id;
+                this._super(view_type),
+                this.shortcut_check(this.views[view_type])
+            ).then(function() {
+                var controller = self.views[self.active_view].controller,
+                    fvg = controller.fields_view,
+                    view_id = (fvg && fvg.view_id) || '--';
                 self.$element.find('.oe_get_xml_view span').text(view_id);
+                if (!self.action.name && fvg) {
+                    self.$element.find('.oe_view_title').text(fvg.arch.attrs.string || fvg.name);
+                }
         });
     },
     shortcut_check : function(view) {
@@ -436,7 +451,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
         var grandparent = this.widget_parent && this.widget_parent.widget_parent;
         // display shortcuts if on the first view for the action
         var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle');
-        if (!(grandparent instanceof db.web.WebClient) ||
+        if (!(grandparent instanceof session.web.WebClient) ||
             !(view.view_type === this.views_src[0].view_type
                 && view.view_id === this.views_src[0].view_id)) {
             $shortcut_toggle.hide();
@@ -473,7 +488,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
      * Intercept do_action resolution from children views
      */
     on_action_executed: function () {
-        return new db.web.DataSet(this, 'res.log')
+        return new session.web.DataSet(this, 'res.log')
                 .call('get', [], this.do_display_log);
     },
     /**
@@ -500,7 +515,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
     }
 });
 
-db.web.Sidebar = db.web.Widget.extend({
+session.web.Sidebar = session.web.Widget.extend({
     init: function(parent, element_id) {
         this._super(parent, element_id);
         this.items = {};
@@ -509,14 +524,62 @@ db.web.Sidebar = db.web.Widget.extend({
     start: function() {
         this._super(this);
         var self = this;
-        this.$element.html(db.web.qweb.render('Sidebar'));
+        this.$element.html(session.web.qweb.render('Sidebar'));
         this.$element.find(".toggle-sidebar").click(function(e) {
             self.do_toggle();
         });
     },
+
+    call_default_on_sidebar: function(item) {
+        var func_name = 'on_sidebar_' + _.underscored(item.label);
+        var fn = this.widget_parent[func_name];
+        if(typeof fn === 'function') {
+            fn(item);
+        }
+    },
+
+    add_default_sections: function() {
+        this.add_section(_t('Customize'), 'customize');
+        this.add_items('customize', [
+            {
+                label: _t("Manage Views"),
+                callback: this.call_default_on_sidebar,
+                title: _t("Manage views of the current object"),
+            }, {
+                label: _t("Edit Workflow"),
+                callback: this.call_default_on_sidebar,
+                title: _t("Manage views of the current object"),
+                classname: 'oe_hide oe_sidebar_edit_workflow'
+            }, {
+                label: _t("Customize Object"),
+                callback: this.call_default_on_sidebar,
+                title: _t("Manage views of the current object"),
+            }
+        ]);
+
+        this.add_section(_t('Other Options'), 'other');
+        this.add_items('other', [
+            {
+                label: _t("Import"),
+                callback: this.call_default_on_sidebar,
+            }, {
+                label: _t("Export"),
+                callback: this.call_default_on_sidebar,
+            }, {
+                label: _t("Translate"),
+                callback: this.call_default_on_sidebar,
+                classname: 'oe_sidebar_translate oe_hide'
+            }, {
+                label: _t("View Log"),
+                callback: this.call_default_on_sidebar,
+                classname: 'oe_hide oe_sidebar_view_log'
+            }
+        ]);
+    },
+
     add_toolbar: function(toolbar) {
         var self = this;
-        _.each([['print', "Reports"], ['action', "Actions"], ['relate', "Links"]], function(type) {
+        _.each([['print', _t("Reports")], ['action', _t("Actions")], ['relate', _t("Links")]], function(type) {
             var items = toolbar[type[0]];
             if (items.length) {
                 for (var i = 0; i < items.length; i++) {
@@ -526,15 +589,30 @@ db.web.Sidebar = db.web.Widget.extend({
                         classname: 'oe_sidebar_' + type[0]
                     }
                 }
-                self.add_section(type[0], type[1], items);
+                self.add_section(type[1], type[0]);
+                self.add_items(type[0], items);
             }
         });
     },
-    add_section: function(code, name, items) {
-        // For each section, we pass a name/label and optionally an array of items.
-        // If no items are passed, then the section will be created as a custom section
-        // returning back an element_id to be used by a custom controller.
-        // Else, the section is a standard section with items displayed as links.
+
+    add_section: function(name, code) {
+        if(!code) code = _.underscored(name);
+        var $section = this.sections[code];
+
+        if(!$section) {
+            section_id = _.uniqueId(this.element_id + '_section_' + code + '_');
+            var $section = $(session.web.qweb.render("Sidebar.section", {
+                section_id: section_id,
+                name: name,
+                classname: 'oe_sidebar_' + code,
+            }));
+            $section.appendTo(this.$element.find('div.sidebar-actions'));
+            this.sections[code] = $section;
+        }
+        return $section;
+    },
+
+    add_items: function(section_code, items) {
         // An item is a dictonary : {
         //    label: label to be displayed for the link,
         //    action: action to be launch when the link is clicked,
@@ -543,25 +621,24 @@ db.web.Sidebar = db.web.Widget.extend({
         //    title: optional title for the link
         // }
         // Note: The item should have one action or/and a callback
+        //
+
         var self = this,
-            section_id = _.uniqueId(this.element_id + '_section_' + code + '_');
+            $section = this.add_section(_.titleize(section_code.replace('_', ' ')), section_code),
+            section_id = $section.attr('id');
+
         if (items) {
             for (var i = 0; i < items.length; i++) {
                 items[i].element_id = _.uniqueId(section_id + '_item_');
                 this.items[items[i].element_id] = items[i];
             }
-        }
-        var $section = $(db.web.qweb.render("Sidebar.section", {
-            section_id: section_id,
-            name: name,
-            classname: 'oe_sidebar_' + code,
-            items: items
-        }));
-        if (items) {
-            $section.find('a.oe_sidebar_action_a').click(function() {
+
+            var $items = $(session.web.qweb.render("Sidebar.section.items", {items: items}));
+
+            $items.find('a.oe_sidebar_action_a').click(function() {
                 var item = self.items[$(this).attr('id')];
                 if (item.callback) {
-                    item.callback();
+                    item.callback.apply(self, [item]);
                 }
                 if (item.action) {
                     var ids = self.widget_parent.get_selected_ids();
@@ -591,10 +668,13 @@ db.web.Sidebar = db.web.Widget.extend({
                 }
                 return false;
             });
+
+            var $ul = $section.find('ul');
+            if(!$ul.length) {
+                $ul = $('
    ').appendTo($section); + } + $items.appendTo($ul); } - $section.appendTo(this.$element.find('div.sidebar-actions')); - this.sections[code] = $section; - return section_id; }, do_fold: function() { this.$element.addClass('closed-sidebar').removeClass('open-sidebar'); @@ -607,7 +687,7 @@ db.web.Sidebar = db.web.Widget.extend({ } }); -db.web.TranslateDialog = db.web.Dialog.extend({ +session.web.TranslateDialog = session.web.Dialog.extend({ dialog_title: _t("Translations"), init: function(view) { // TODO fme: should add the language to fields_view_get because between the fields view get @@ -627,14 +707,14 @@ db.web.TranslateDialog = db.web.Dialog.extend({ this.translatable_fields_keys = _.map(this.view.translatable_fields || [], function(i) { return i.name }); this.languages = null; this.languages_loaded = $.Deferred(); - (new db.web.DataSetSearch(this, 'res.lang', this.view.dataset.get_context(), + (new session.web.DataSetSearch(this, 'res.lang', this.view.dataset.get_context(), [['translatable', '=', '1']])).read_slice(['code', 'name'], { sort: 'id' }, this.on_languages_loaded); }, start: function() { var self = this; this._super(); $.when(this.languages_loaded).then(function() { - self.$element.html(db.web.qweb.render('TranslateDialog', { widget: self })); + self.$element.html(session.web.qweb.render('TranslateDialog', { widget: self })); self.$element.tabs(); if (!(self.view.translatable_fields && self.view.translatable_fields.length)) { self.hide_tabs('fields'); @@ -739,7 +819,7 @@ db.web.TranslateDialog = db.web.Dialog.extend({ } }); -db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ +session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{ template: "EmptyComponent", set_default_options: function(options) { this.options = options || {}; @@ -753,7 +833,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ }, open_translate_dialog: function(field) { if (!this.translate_dialog) { - this.translate_dialog = new db.web.TranslateDialog(this).start(); + this.translate_dialog = new session.web.TranslateDialog(this).start(); } this.translate_dialog.open(field); }, @@ -765,7 +845,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ * @param {String} [action_data.special=null] special action handlers (currently: only ``'cancel'``) * @param {String} [action_data.type='workflow'] the action type, if present, one of ``'object'``, ``'action'`` or ``'workflow'`` * @param {Object} [action_data.context=null] additional action context, to add to the current context - * @param {db.web.DataSet} dataset a dataset object used to communicate with the server + * @param {session.web.DataSet} dataset a dataset object used to communicate with the server * @param {Object} [record_id] the identifier of the object on which the action is to be applied * @param {Function} on_closed callback to execute when dialog is closed or when the action does not generate any result (no new action) */ @@ -777,33 +857,41 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ return self.widget_parent.on_action_executed.apply(null, arguments); } }; + var context = new session.web.CompoundContext(dataset.get_context(), action_data.context || {}); + var handler = function (r) { var action = r.result; if (action && action.constructor == Object) { - return self.rpc('/web/session/eval_domain_and_context', { - contexts: [dataset.get_context(), action.context || {}, { - active_id: record_id || false, - active_ids: [record_id || false], + var ncontext = new session.web.CompoundContext(context); + if (record_id) { + ncontext.add({ + active_id: record_id, + active_ids: [record_id], active_model: dataset.model - }], + }); + } + ncontext.add(action.context || {}); + return self.rpc('/web/session/eval_domain_and_context', { + contexts: [ncontext], domains: [] }).pipe(function (results) { - action.context = results.context + action.context = results.context; + /* niv: previously we were overriding once more with action_data.context, + * I assumed this was not a correct behavior and removed it + */ return self.do_action(action, result_handler); - }); + }, null); } else { return result_handler(); } }; - var context = new db.web.CompoundContext(dataset.get_context(), action_data.context || {}); - if (action_data.special) { return handler({result: {"type":"ir.actions.act_window_close"}}); } else if (action_data.type=="object") { return dataset.call_button(action_data.name, [[record_id], context], handler); } else if (action_data.type=="action") { - return this.rpc('/web/action/load', { action_id: parseInt(action_data.name, 10), context: context }, handler); + return this.rpc('/web/action/load', { action_id: parseInt(action_data.name, 10), context: context, do_not_eval: true}, handler); } else { return dataset.exec_workflow(record_id, action_data.name, handler); } @@ -811,7 +899,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ /** * Directly set a view to use instead of calling fields_view_get. This method must * be called before start(). When an embedded view is set, underlying implementations - * of db.web.View must use the provided view instead of any other one. + * of session.web.View must use the provided view instead of any other one. * * @param embedded_view A view. */ @@ -823,47 +911,16 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ }, do_search: function(view) { }, + set_common_sidebar_sections: function(sidebar) { - sidebar.add_section('customize', "Customize", [ - { - label: "Manage Views", - callback: this.on_sidebar_manage_view, - title: "Manage views of the current object" - }, { - label: "Edit Workflow", - callback: this.on_sidebar_edit_workflow, - title: "Manage views of the current object", - classname: 'oe_hide oe_sidebar_edit_workflow' - }, { - label: "Customize Object", - callback: this.on_sidebar_customize_object, - title: "Manage views of the current object" - } - ]); - sidebar.add_section('other', "Other Options", [ - { - label: "Import", - callback: this.on_sidebar_import - }, { - label: "Export", - callback: this.on_sidebar_export - }, { - label: "Translate", - callback: this.on_sidebar_translate, - classname: 'oe_sidebar_translate oe_hide' - }, { - label: "View Log", - callback: this.on_sidebar_view_log, - classname: 'oe_hide oe_sidebar_view_log' - } - ]); + sidebar.add_default_sections(); }, - on_sidebar_manage_view: function() { + on_sidebar_manage_views: function() { if (this.fields_view && this.fields_view.arch) { - var view_editor = new db.web.ViewEditor(this, this.$element, this.dataset, this.fields_view.arch); + var view_editor = new session.web.ViewEditor(this, this.$element, this.dataset, this.fields_view.arch); view_editor.start(); } else { - this.notification.warn("Manage Views", "Could not find current view declaration"); + this.do_warn("Manage Views", "Could not find current view declaration"); } }, on_sidebar_edit_workflow: function() { @@ -873,11 +930,11 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ console.log('Todo'); }, on_sidebar_import: function() { - var import_view = new db.web.DataImport(this, this.dataset); + var import_view = new session.web.DataImport(this, this.dataset); import_view.start(); }, on_sidebar_export: function() { - var export_view = new db.web.DataExport(this, this.dataset); + var export_view = new session.web.DataExport(this, this.dataset); export_view.start(); }, on_sidebar_translate: function() { @@ -887,7 +944,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ } }); -db.web.json_node_to_xml = function(node, single_quote, indent) { +session.web.json_node_to_xml = function(node, single_quote, indent) { // For debugging purpose, this function will convert a json node back to xml // Maybe usefull for xml view editor @@ -916,7 +973,7 @@ db.web.json_node_to_xml = function(node, single_quote, indent) { r += '>\n'; var childs = []; for (var i = 0, ii = node.children.length; i < ii; i++) { - childs.push(db.web.json_node_to_xml(node.children[i], single_quote, indent + 1)); + childs.push(session.web.json_node_to_xml(node.children[i], single_quote, indent + 1)); } r += childs.join('\n'); r += '\n' + sindent + ''; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index b7b919e341f..323854fa7a3 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -2,9 +2,8 @@ - -
    -
    + +
    x

    #{title}

    @@ -17,6 +16,9 @@

    #{text}

    +
    + +
    - +
    @@ -447,11 +449,11 @@ -

    - - + +

    +

    @@ -467,17 +469,20 @@ -

    -
      +

      +
    +
    + + +
  • - -
    +
    • Fields
    • @@ -563,21 +568,7 @@ Delete

    - - - - - - - - -
    @@ -607,8 +598,26 @@ + + + + + + + + + + + + + @@ -640,7 +649,7 @@ - + @@ -653,15 +662,10 @@
    - - - @@ -749,12 +753,6 @@
    - - -

    - - -
    @@ -864,9 +862,9 @@
      -
    • Open...
    • -
    • Create...
    • -
    • Search...
    • +
    • Open...
    • +
    • Create...
    • +
    • Search...
    • @@ -1281,17 +1279,17 @@ - +
      - - - + + -
      +
      - + @@ -1299,36 +1297,36 @@
      - + - - - - - + + + + + Export @@ -1464,7 +1462,8 @@ Import -
      +

      1. Import a .CSV file

      Select a .CSV file to import. If you need a sample of file to import, @@ -1474,11 +1473,11 @@

      -

      2. Check your file format

      -
      -
      - Import Options -
      + - - - - - + +
      - + - + + - - - - + + id="side-edit" src="/web/static/src/img/icons/gtk-edit.png" style="cursor: pointer;"/> + + + +
      +

      2. Check your file format

      +
      +
      + Import Options +
      @@ -1508,22 +1507,24 @@ - - - - - - - - - - -
      -
      - -
      -
      + + + + + + + + + + + +
      +
      + + +
      +
      +

      The import failed due to:

      diff --git a/addons/web/static/test/formats.js b/addons/web/static/test/formats.js index 331725dd9a5..3c3c6b06e72 100644 --- a/addons/web/static/test/formats.js +++ b/addons/web/static/test/formats.js @@ -27,6 +27,18 @@ $(document).ready(function () { var fl = 12.1234; var str = openerp.web.format_value(fl, {type:"float"}); equal(str, "12.12"); + equal(openerp.web.format_value(12.02, {type: 'float'}), + '12.02'); + equal(openerp.web.format_value(0.0002, {type: 'float', digits: [1, 3]}), + '0.000'); + equal(openerp.web.format_value(0.0002, {type: 'float', digits: [1, 4]}), + '0.0002'); + equal(openerp.web.format_value(0.0002, {type: 'float', digits: [1, 6]}), + '0.000200'); + equal(openerp.web.format_value(1, {type: 'float', digits: [1, 6]}), + '1.000000'); + equal(openerp.web.format_value(1, {type: 'float'}), + '1.00'); }); test("parse_datetime", function () { var val = openerp.web.str_to_datetime("2009-05-04 12:34:23"); @@ -51,4 +63,4 @@ $(document).ready(function () { var val = openerp.web.parse_value(str, {type:"float"}); equal(val, -134112.1234); }); -}); \ No newline at end of file +}); diff --git a/addons/web/static/test/test.html b/addons/web/static/test/test.html index 38237a0600a..f6248e705c0 100644 --- a/addons/web/static/test/test.html +++ b/addons/web/static/test/test.html @@ -21,7 +21,7 @@ - + @@ -31,11 +31,8 @@ - - - + +

      OpenERP web Test Suite

      diff --git a/addons/web_calendar/po/es.po b/addons/web_calendar/po/es.po new file mode 100644 index 00000000000..25e6c8c24d6 --- /dev/null +++ b/addons/web_calendar/po/es.po @@ -0,0 +1,22 @@ +# Spanish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-18 10:41+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" +"X-Generator: Launchpad (build 14157)\n" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr " " diff --git a/addons/web_calendar/po/fr.po b/addons/web_calendar/po/fr.po new file mode 100644 index 00000000000..7679850c593 --- /dev/null +++ b/addons/web_calendar/po/fr.po @@ -0,0 +1,22 @@ +# French translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-23 12:12+0000\n" +"Last-Translator: fhe (OpenERP) \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr " " diff --git a/addons/web_calendar/po/gl.po b/addons/web_calendar/po/gl.po new file mode 100644 index 00000000000..73ecf153937 --- /dev/null +++ b/addons/web_calendar/po/gl.po @@ -0,0 +1,22 @@ +# Galician translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-19 10:25+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr " " diff --git a/addons/web_calendar/po/sk.po b/addons/web_calendar/po/sk.po new file mode 100644 index 00000000000..168ca1d2adf --- /dev/null +++ b/addons/web_calendar/po/sk.po @@ -0,0 +1,22 @@ +# Slovak translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-23 14:42+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr "" diff --git a/addons/web_calendar/po/sl.po b/addons/web_calendar/po/sl.po new file mode 100644 index 00000000000..40f8f43a756 --- /dev/null +++ b/addons/web_calendar/po/sl.po @@ -0,0 +1,22 @@ +# Slovenian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-10-19 06:26+0000\n" +"Last-Translator: Anze (Neotek) \n" +"Language-Team: Slovenian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr " " diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index da13012608f..a5fd8bcac9c 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -3,6 +3,7 @@ *---------------------------------------------------------*/ openerp.web_calendar = function(openerp) { +var _t = openerp.web._t; var QWeb = openerp.web.qweb; QWeb.add_template('/web_calendar/static/src/xml/web_calendar.xml'); openerp.web.views.add('calendar', 'openerp.web_calendar.CalendarView'); @@ -18,10 +19,8 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ this.has_been_loaded = $.Deferred(); this.creating_event_id = null; this.dataset_events = []; - if (this.options.action_views_ids.form) { - this.form_dialog = new openerp.web_calendar.CalendarFormDialog(this, {}, this.options.action_views_ids.form, dataset); - this.form_dialog.start(); - } + this.form_dialog = new openerp.web_calendar.CalendarFormDialog(this, {}, this.options.action_views_ids.form, dataset); + this.form_dialog.start(); this.COLOR_PALETTE = ['#f57900', '#cc0000', '#d400a8', '#75507b', '#3465a4', '#73d216', '#c17d11', '#edd400', '#fcaf3e', '#ef2929', '#ff00c9', '#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f', '#ff8e00', '#ff0000', '#b0008c', '#9000ff', '#0078ff', '#00ff00', '#e6ff00', '#ffff00', @@ -84,8 +83,8 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ if (this.options.sidebar && this.options.sidebar_id) { this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id); this.sidebar.start(); - this.sidebar.navigator = new openerp.web_calendar.SidebarNavigator(this.sidebar, this.sidebar.add_section('navigator', "Navigator"), this); - this.sidebar.responsible = new openerp.web_calendar.SidebarResponsible(this.sidebar, this.sidebar.add_section('responsible', "Responsible"), this); + this.sidebar.navigator = new openerp.web_calendar.SidebarNavigator(this.sidebar, this); + this.sidebar.responsible = new openerp.web_calendar.SidebarResponsible(this.sidebar, this); this.sidebar.add_toolbar(this.fields_view.toolbar); this.set_common_sidebar_sections(this.sidebar); this.sidebar.do_unfold(); @@ -157,7 +156,9 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ for (var e = 0; e < events.length; e++) { var evt = events[e]; if (!evt[this.date_start]) { - this.notification.warn("Start date is not defined for event :", evt['id']); + if (this.session.debug) { + this.do_warn("Start date is not defined for event :", evt['id']); + } break; } @@ -182,10 +183,10 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ } if (this.fields[this.date_start]['type'] == 'date') { - evt[this.date_start] = openerp.web.str_to_date(evt[this.date_start]).set({hour: 9}).toString('yyyy-MM-dd HH:mm:ss'); + evt[this.date_start] = openerp.web.auto_str_to_date(evt[this.date_start]).set({hour: 9}).toString('yyyy-MM-dd HH:mm:ss'); } if (this.date_stop && evt[this.date_stop] && this.fields[this.date_stop]['type'] == 'date') { - evt[this.date_stop] = openerp.web.str_to_date(evt[this.date_stop]).set({hour: 17}).toString('yyyy-MM-dd HH:mm:ss'); + evt[this.date_stop] = openerp.web.auto_str_to_date(evt[this.date_stop]).set({hour: 17}).toString('yyyy-MM-dd HH:mm:ss'); } res_events.push(this.convert_event(evt)); } @@ -268,12 +269,14 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ } }, do_edit_event: function(event_id) { + var self = this; event_id = parseInt(event_id, 10); var index = _.indexOf(this.dataset.ids, event_id); if (index > -1) { this.dataset.index = index; - this.form_dialog.form.do_show(); - this.form_dialog.open(); + this.form_dialog.form.do_show().then(function() { + self.form_dialog.open(); + }); return false; } return true; @@ -362,13 +365,16 @@ openerp.web_calendar.CalendarFormDialog = openerp.web.Dialog.extend({ }); openerp.web_calendar.SidebarResponsible = openerp.web.Widget.extend({ - init: function(parent, element_id, view) { - this._super(parent, element_id); + init: function(parent, view) { + var $section = parent.add_section(_t('Responsible'), 'responsible'); + this.$div = $('
      '); + $section.append(this.$div); + this._super(parent, $section.attr('id')); this.view = view; this.$element.delegate('input:checkbox', 'change', this.on_filter_click); }, on_events_loaded: function(filters) { - this.$element.html(QWeb.render('CalendarView.sidebar.responsible', { filters: filters })); + this.$div.html(QWeb.render('CalendarView.sidebar.responsible', { filters: filters })); }, on_filter_click: function(e) { var responsibles = [], @@ -388,8 +394,9 @@ openerp.web_calendar.SidebarResponsible = openerp.web.Widget.extend({ }); openerp.web_calendar.SidebarNavigator = openerp.web.Widget.extend({ - init: function(parent, element_id, view) { - this._super(parent, element_id); + init: function(parent, view) { + var $section = parent.add_section(_t('Navigator'), 'navigator'); + this._super(parent, $section.attr('id')); this.view = view; }, on_events_loaded: function(events) { diff --git a/addons/web_dashboard/controllers.py b/addons/web_dashboard/controllers.py index ebf74837899..0f6ae5dad7d 100644 --- a/addons/web_dashboard/controllers.py +++ b/addons/web_dashboard/controllers.py @@ -22,11 +22,7 @@ class Widgets(openerpweb.Controller): _cp_path = '/web_dashboard/widgets' @openerpweb.httprequest - def content(self, req, widget_id): - Widget = req.session.model('res.widget') - w = Widget.read([widget_id], ['content'], req.session.eval_context(req.context)) - if w: - r = WIDGET_CONTENT_PATTERN % w[0] - else: - r = "Widget unavailable" - return r + def content(self, request, widget_id): + return WIDGET_CONTENT_PATTERN % request.session.model('res.widget').read( + [int(widget_id)], ['content'], request.session.eval_context(request.context) + )[0] diff --git a/addons/web_dashboard/po/es.po b/addons/web_dashboard/po/es.po new file mode 100644 index 00000000000..8cd91812416 --- /dev/null +++ b/addons/web_dashboard/po/es.po @@ -0,0 +1,46 @@ +# Spanish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-18 10:44+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" +"X-Generator: Launchpad (build 14157)\n" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +msgstr "Reiniciar" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Undo" +msgstr "Deshacer" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Add Widget" +msgstr "Añadir Widget" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Change layout" +msgstr "Cambiar disposición" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "Cambiar disposición del tablero" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "progress:" +msgstr "progreso:" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "%" +msgstr "%" diff --git a/addons/web_dashboard/po/fr.po b/addons/web_dashboard/po/fr.po new file mode 100644 index 00000000000..b02d061cdd2 --- /dev/null +++ b/addons/web_dashboard/po/fr.po @@ -0,0 +1,46 @@ +# French translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-23 12:11+0000\n" +"Last-Translator: Xavier (Open ERP) \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Undo" +msgstr "Annuler" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Add Widget" +msgstr "Ajouter un Gadget" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Change layout" +msgstr "Changer la mise en page" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "Choisissez la mise en page du tableau de bord" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "progress:" +msgstr "progrès" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "%" +msgstr "%" diff --git a/addons/web_dashboard/po/gl.po b/addons/web_dashboard/po/gl.po new file mode 100644 index 00000000000..b7a081aff6f --- /dev/null +++ b/addons/web_dashboard/po/gl.po @@ -0,0 +1,46 @@ +# Galician translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-19 10:29+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +msgstr "Reiniciar" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Undo" +msgstr "Desfacer" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Add Widget" +msgstr "Engadir un widget" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Change layout" +msgstr "Cambiar disposición" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "Cambiar disposición do taboleiro" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "progress:" +msgstr "progreso:" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "%" +msgstr "%" diff --git a/addons/web_dashboard/po/sk.po b/addons/web_dashboard/po/sk.po new file mode 100644 index 00000000000..d2c2b2160a0 --- /dev/null +++ b/addons/web_dashboard/po/sk.po @@ -0,0 +1,46 @@ +# Slovak translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-23 14:45+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Undo" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Add Widget" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Change layout" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "progress:" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "%" +msgstr "" diff --git a/addons/web_dashboard/po/sl.po b/addons/web_dashboard/po/sl.po new file mode 100644 index 00000000000..9eee401c427 --- /dev/null +++ b/addons/web_dashboard/po/sl.po @@ -0,0 +1,46 @@ +# Slovenian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-19 06:25+0000\n" +"Last-Translator: Anze (Neotek) \n" +"Language-Team: Slovenian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +msgstr "Ponastavi" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Undo" +msgstr "Razveljavi" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Add Widget" +msgstr "Dodaj gradnik" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Change layout" +msgstr "Spreminjanje postavitve" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "Izberite postavitev nadzorne plošče" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "progress:" +msgstr "napredek:" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "%" +msgstr "%" diff --git a/addons/web_dashboard/static/src/css/dashboard.css b/addons/web_dashboard/static/src/css/dashboard.css index 4d48cd4ffbd..54b1cc7d2b5 100644 --- a/addons/web_dashboard/static/src/css/dashboard.css +++ b/addons/web_dashboard/static/src/css/dashboard.css @@ -34,6 +34,10 @@ -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; } +.openerp h2.oe-dashboard-action-header-empty { + padding-top: 0; + padding-bottom: 2px; +} .openerp a.oe-dashboard-action-rename { float: left; diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 3163453a122..923b43ce034 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -378,8 +378,8 @@ openerp.web_dashboard.apps = { module: 'account_voucher', name: 'Invoicing', help: "Send invoice, track payments and reminders" }, { - module: 'project', name: 'Projects', - help: "Manage projects, track tasks, invoice task works, follow issues, \u2026" + module: 'point_of_sale', name: 'Point of Sales', + help: "Manage shop sales, use touch-screen POS" } ], [ { @@ -389,19 +389,19 @@ openerp.web_dashboard.apps = { module: 'stock', name: 'Warehouse', help: "Track your stocks, schedule product moves, manage incoming and outgoing shipments, \u2026" }, { - module: 'hr', name: 'Human Resources', - help: "Manage employees and their contracts, follow laves, recruit people, \u2026" + module: 'mrp', name: 'Manufacturing', + help: "Manage your manufacturing, control your supply chain, personalize master data, \u2026" }, { - module: 'point_of_sale', name: 'Point of Sales', - help: "Manage shop sales, use touch-screen POS" + module: 'account_accountant', name: 'Accounting and Finance', + help: "Record financial operations, automate followup, manage multi-currency, \u2026" } ], [ { - module: 'profile_tools', name: 'Extra Tools', - help: "Track ideas, manage lunch, create surveys, share data" + module: 'project', name: 'Projects', + help: "Manage projects, track tasks, invoice task works, follow issues, \u2026" }, { - module: 'mrp', name: 'Manufacturing', - help: "Manage your manufacturing, control your supply chain, personalize master data, \u2026" + module: 'hr', name: 'Human Resources', + help: "Manage employees and their contracts, follow laves, recruit people, \u2026" }, { module: 'marketing', name: 'Marketing', help: "Manage campaigns, follow activities, automate emails, \u2026" @@ -420,18 +420,15 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({ // Check for installed application var Installer = new openerp.web.DataSet(this, 'base.setup.installer'); Installer.call('default_get', [], function (installed_modules) { - var installed = false; - _.each(installed_modules, function(v,k) { - if(_.startsWith(k,"cat")) { - installed =installed || v; - } - }); + var installed = _(installed_modules).any(function (active, name) { + return _.startsWith(name, 'cat') && active; }); + if(installed) { self.do_display_root_menu(); } else { self.do_display_installer(); } - } ); + }); }, do_display_root_menu: function() { var self = this; @@ -446,10 +443,8 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({ self.$element.append(tiles) .find('.oe-dashboard-home-tile') .click(function () { - var $this = $(this); - $this.closest('.openerp') - .find('.menu a[data-menu=' + $this.data('menuid') + ']') - .click();}); + openerp.webclient.menu.on_menu_click(null, $(this).data('menuid')) + }); }); return r; }, @@ -490,9 +485,8 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({ var self = this; new openerp.web.DataSet(this, 'res.config').call('start', [[]], function (action) { $.unblockUI(); - self.do_action(action, function () { - // TODO: less brutal reloading - window.location.reload(true); + self.widget_parent.widget_parent.do_action(action, function () { + openerp.webclient.do_reload(); }); }); } diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index fe96d72855d..87222baa5fd 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -30,9 +30,10 @@
      -

      +

      + &nbsp; diff --git a/addons/web_default_home/po/es.po b/addons/web_default_home/po/es.po new file mode 100644 index 00000000000..4f35e5b6345 --- /dev/null +++ b/addons/web_default_home/po/es.po @@ -0,0 +1,38 @@ +# Spanish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-18 10:47+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" +"X-Generator: Launchpad (build 14157)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Bienvenido a su nueva instancia de OpenERP." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Recuerde añadir a marcadores esta página" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Recordar su inicio de sesión:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Elija la primera Aplicación de OpenERP que quiere instalar." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Instalar" diff --git a/addons/web_default_home/po/fr.po b/addons/web_default_home/po/fr.po new file mode 100644 index 00000000000..ec8855f86cf --- /dev/null +++ b/addons/web_default_home/po/fr.po @@ -0,0 +1,39 @@ +# French translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-23 12:10+0000\n" +"Last-Translator: fhe (OpenERP) \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Bienvenue dans votre nouvelle instance OpenERP." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Assurez-vous de marquer cette page comme favoris." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Mémorisez votre identifiant:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "" +"Choisissez la première application OpenERP que vous voulez installer..." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Installer" diff --git a/addons/web_default_home/po/gl.po b/addons/web_default_home/po/gl.po new file mode 100644 index 00000000000..4069197dec9 --- /dev/null +++ b/addons/web_default_home/po/gl.po @@ -0,0 +1,38 @@ +# Galician translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-19 10:31+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Binvido á súa nova instancia de OpenERP." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Recorde engadir a marcadores esta páxgina" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Recordar o seu inicio de sesión:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Elixa a primeira Aplicación de OpenERP que quere instalar." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "Instalar" diff --git a/addons/web_default_home/po/da.po b/addons/web_default_home/po/sl.po similarity index 66% rename from addons/web_default_home/po/da.po rename to addons/web_default_home/po/sl.po index a56583755e5..d9f10a9e92f 100644 --- a/addons/web_default_home/po/da.po +++ b/addons/web_default_home/po/sl.po @@ -1,4 +1,4 @@ -# Danish translation for openerp-web +# Slovenian translation for openerp-web # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the openerp-web package. # FIRST AUTHOR , 2011. @@ -8,31 +8,31 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-10-07 10:39+0200\n" -"PO-Revision-Date: 2011-10-11 14:02+0000\n" -"Last-Translator: Jonas Mortensen \n" -"Language-Team: Danish \n" +"PO-Revision-Date: 2011-10-19 06:24+0000\n" +"Last-Translator: Anze (Neotek) \n" +"Language-Team: Slovenian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n" -"X-Generator: Launchpad (build 14124)\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Welcome to your new OpenERP instance." -msgstr "Velkommen til din nye OpenERP instans." +msgstr "Dobrodošli v vaš nov primer OpenERP." #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Remember to bookmark this page." -msgstr "Husk at tilføje denne side til dine favoritter." +msgstr "Ne pozabite narediti zaznamka te strani." #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Remember your login:" -msgstr "Husk dit log ind:" +msgstr "Zapomni si prijavo:" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Choose the first OpenERP Application you want to install.." -msgstr "Vælg den første OpenERP Applikation som du ønsker at installere." +msgstr "Izberite prvi aplikacijo OpenERP, ki jo želite namestiti .." #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Install" -msgstr "Installér" +msgstr "Namesti" diff --git a/addons/web_diagram/po/es.po b/addons/web_diagram/po/es.po new file mode 100644 index 00000000000..192c69b6428 --- /dev/null +++ b/addons/web_diagram/po/es.po @@ -0,0 +1,54 @@ +# Spanish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-18 10:50+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" +"X-Generator: Launchpad (build 14157)\n" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Node" +msgstr "Nuevo Nodo" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Edge" +msgstr "Nuevo margen" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Show Grid:" +msgstr "Mostrar Grid:" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "First" +msgstr "Primero" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "<<" +msgstr "<<" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "0" +msgstr "0" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "/" +msgstr "/" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Last" +msgstr "Último" diff --git a/addons/web_diagram/po/gl.po b/addons/web_diagram/po/gl.po new file mode 100644 index 00000000000..0aca25055d3 --- /dev/null +++ b/addons/web_diagram/po/gl.po @@ -0,0 +1,54 @@ +# Galician translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-19 10:33+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Node" +msgstr "Novo nodo" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Edge" +msgstr "Novo marxe" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Show Grid:" +msgstr "Mostrar Grid:" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "First" +msgstr "Primeiro" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "<<" +msgstr "<<" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "0" +msgstr "0" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "/" +msgstr "/" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Last" +msgstr "Último" diff --git a/addons/web_diagram/po/sl.po b/addons/web_diagram/po/sl.po new file mode 100644 index 00000000000..9cce3a3564e --- /dev/null +++ b/addons/web_diagram/po/sl.po @@ -0,0 +1,54 @@ +# Slovenian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-19 06:22+0000\n" +"Last-Translator: Anze (Neotek) \n" +"Language-Team: Slovenian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Node" +msgstr "Novo vozlišče" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Edge" +msgstr "Nov rob" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Show Grid:" +msgstr "Pokaži mrežo:" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "First" +msgstr "Začetek" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "<<" +msgstr "<<" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "0" +msgstr "0" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "/" +msgstr "/" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid ">>" +msgstr ">>" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "Last" +msgstr "Konec" diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index f92203589b2..82143e460d1 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -98,6 +98,7 @@ -moz-box-shadow: 2px 2px 5px #666; -webkit-box-shadow: 2px 2px 5px #666; box-shadow: 2px 2px 5px #666; + z-index: 2; } .oe_kanban_color_picker a { display: block; @@ -123,6 +124,12 @@ .openerp .oe_kanban_draghandle { cursor: move; } +.openerp .oe_kanban_color_border { + border-color: #CCCCCC; +} +.openerp .oe_kanban_color_border { + border-color: #CCCCCC; +} /* Custom colors are also present in kanban.js */ /* Custom color#1 */ diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 23a0b75a322..82b085d9749 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -16,12 +16,11 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ this.all_display_data = false; this.groups = []; this.qweb = new QWeb2.Engine(); + this.qweb.debug = (window.location.search.indexOf('?debug') !== -1); this.aggregates = {}; this.NO_OF_COLUMNS = 3; - if (this.options.action_views_ids.form) { - this.form_dialog = new openerp.web.FormDialog(this, {}, this.options.action_views_ids.form, dataset).start(); - this.form_dialog.on_form_dialog_saved.add_last(this.on_record_saved); - } + this.form_dialog = new openerp.web.FormDialog(this, {}, this.options.action_views_ids.form, dataset).start(); + this.form_dialog.on_form_dialog_saved.add_last(this.on_record_saved); }, start: function() { this._super(); @@ -124,23 +123,11 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ } } }, - sort_group: function (first, second) { - if (first.header && second.header) - { - first = first.header.toLowerCase(); - second = second.header.toLowerCase(); - if (first > second) return 1; - else if (first < second) return -1; - else return 0; - } - else return 0; - }, on_show_data: function() { var self = this; if (!this.group_by.length) { this.do_record_group(); } - self.all_display_data.sort(this.sort_group); this.$element.html(QWeb.render("KanbanView", {"data": self.all_display_data})); this.on_reload_kanban(); this.$element.find(".oe_vertical_text").hide(); @@ -203,12 +190,10 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ this.do_switch_view('form'); }, do_edit_record: function(record_id) { - if (this.form_dialog) { - this.form_dialog.load_id(record_id); - this.form_dialog.open(); - } else { - this.notification.warn("Kanban", "No form view defined for this object"); - } + var self = this; + this.form_dialog.select_id(record_id).then(function() { + self.form_dialog.open(); + }); }, on_record_saved: function(r) { var id = this.form_dialog.form.datarecord.id; @@ -226,13 +211,14 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ var timeoutId = setTimeout(function() { $cpicker.remove() }, 500); $cpicker.data('timeoutId', timeoutId); }); - $cpicker.find('a').click(function() { + $cpicker.find('a').click(function(evt) { var data = {}; data[$e.data('name')] = $(this).data('color'); self.dataset.write(id, data, {}, function() { self.on_reload_record(id); }); $cpicker.remove(); + return false; }); }, /** @@ -241,7 +227,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ */ on_reload_record: function (record_id){ var self = this; - this.dataset.read_ids([record_id], [], function (records) { + this.dataset.read_ids([record_id], _.keys(self.fields_view.fields), function (records) { if (records.length > 0) { for (var i=0, ii=self.all_display_data.length; i < ii; i++) { for(j=0, jj=self.all_display_data[i].records.length; j < jj; j++) { @@ -397,6 +383,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ }); }, on_action_clicked: function(evt) { + evt.preventDefault(); var $action = $(evt.currentTarget), record_id = parseInt($action.closest(".oe_kanban_record").attr("id").split('_')[1]), type = $action.data('type'); @@ -438,15 +425,14 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ self.groups = groups; if (groups.length) { self.do_render_group(groups); - } - else { + } else { self.all_display_data = []; self.on_show_data(); } }, function (dataset) { self.groups = []; - self.dataset.read_slice([], {}, function(records) { + self.dataset.read_slice(_.keys(self.fields_view.fields), {}, function(records) { if (records.length) { self.all_display_data = [{'records': records, 'value':false, 'header' : false, 'ids': self.dataset.ids}]; } else { @@ -475,8 +461,9 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ _.each(self.aggregates, function(value, key) { group_aggregates[value] = group.aggregates[key]; }); - self.dataset.read_slice([], {'domain': group.domain, 'conext': group.context}, function(records) { - self.all_display_data.push({"value" : group_value, "records": records, 'header':group_name, 'ids': self.dataset.ids, 'aggregates': group_aggregates}); + var dataset = new openerp.web.DataSetSearch(self, self.dataset.model, group.context, group.domain); + dataset.read_slice(_.keys(self.fields_view.fields), {'domain': group.domain, 'context': group.context}, function(records) { + self.all_display_data.push({"value" : group_value, "records": records, 'header':group_name, 'ids': dataset.ids, 'aggregates': group_aggregates}); if (datagroups.length == self.all_display_data.length) { self.$element.find(".oe_kanban_view").remove(); self.on_show_data(); diff --git a/addons/web_mobile/po/es.po b/addons/web_mobile/po/es.po new file mode 100644 index 00000000000..9a9e02c4893 --- /dev/null +++ b/addons/web_mobile/po/es.po @@ -0,0 +1,66 @@ +# Spanish translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-18 10:52+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n" +"X-Generator: Launchpad (build 14157)\n" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Database:" +msgstr "Base de datos:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login:" +msgstr "Inicio de Sesión:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Password:" +msgstr "Contraseña:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login" +msgstr "Inicio de sesión" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Bad username or password" +msgstr "Nombre de usuario o contraseña incorrectos" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Favourite" +msgstr "Favorito" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Preference" +msgstr "Preferencia" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Applications" +msgstr "Aplicaciones" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Options" +msgstr "Opciones" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Logout" +msgstr "Cerrar sesión" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr ":" diff --git a/addons/web_mobile/po/fr.po b/addons/web_mobile/po/fr.po index 19b9d0de4e3..b64bcecfb1e 100644 --- a/addons/web_mobile/po/fr.po +++ b/addons/web_mobile/po/fr.po @@ -8,30 +8,30 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-10-07 10:39+0200\n" -"PO-Revision-Date: 2011-10-08 02:26+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2011-10-23 12:09+0000\n" +"Last-Translator: fhe (OpenERP) \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n" -"X-Generator: Launchpad (build 14110)\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "OpenERP" -msgstr "" +msgstr "OpenERP" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Database:" -msgstr "" +msgstr "Base de données :" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Login:" -msgstr "" +msgstr "Identifiant :" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Password:" -msgstr "" +msgstr "Mot de passe :" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Login" @@ -39,23 +39,23 @@ msgstr "" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Bad username or password" -msgstr "" +msgstr "Mauvais nom d'utilisateur ou mot de passe" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Favourite" -msgstr "" +msgstr "Favoris" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Preference" -msgstr "" +msgstr "Préférences" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Applications" -msgstr "" +msgstr "Applications" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Options" -msgstr "" +msgstr "Réglages" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Logout" @@ -63,4 +63,4 @@ msgstr "" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid ":" -msgstr "" +msgstr ":" diff --git a/addons/web_mobile/po/gl.po b/addons/web_mobile/po/gl.po new file mode 100644 index 00000000000..4049dfb8d1f --- /dev/null +++ b/addons/web_mobile/po/gl.po @@ -0,0 +1,66 @@ +# Galician translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-19 10:36+0000\n" +"Last-Translator: Amós Oviedo \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Database:" +msgstr "Base de datos:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login:" +msgstr "Inicio de sesión:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Password:" +msgstr "Contrasinal:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login" +msgstr "Inicio de sesión" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Bad username or password" +msgstr "Nome de usuario ou contrasinal incorrectos" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Favourite" +msgstr "Favorito" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Preference" +msgstr "Preferenza" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Applications" +msgstr "Aplicacións" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Options" +msgstr "Opcións" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Logout" +msgstr "Pechar sesión" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr ":" diff --git a/addons/web_mobile/po/sk.po b/addons/web_mobile/po/sk.po new file mode 100644 index 00000000000..5e10f135cf9 --- /dev/null +++ b/addons/web_mobile/po/sk.po @@ -0,0 +1,66 @@ +# Slovak translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-23 14:55+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n" +"X-Generator: Launchpad (build 14185)\n" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "OpenERP" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Database:" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login:" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Password:" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Bad username or password" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Favourite" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Preference" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Applications" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Options" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Logout" +msgstr "" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr "" diff --git a/addons/web_mobile/po/sl.po b/addons/web_mobile/po/sl.po new file mode 100644 index 00000000000..041141d4824 --- /dev/null +++ b/addons/web_mobile/po/sl.po @@ -0,0 +1,66 @@ +# Slovenian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:39+0200\n" +"PO-Revision-Date: 2011-10-19 06:19+0000\n" +"Last-Translator: Anze (Neotek) \n" +"Language-Team: Slovenian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n" +"X-Generator: Launchpad (build 14165)\n" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "OpenERP" +msgstr "OpenERP" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Database:" +msgstr "Podatkovna baza" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login:" +msgstr "Uporabnik:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Password:" +msgstr "Geslo:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login" +msgstr "Prijava" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Bad username or password" +msgstr "Napačno uporabniško ime ali geslo" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Favourite" +msgstr "Priljubljen" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Preference" +msgstr "Lastnost" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Applications" +msgstr "Programi" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Options" +msgstr "Možnosti" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Logout" +msgstr "Odjava" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr ":" diff --git a/addons/web_mobile/static/lib/jquery_mobile/css/jquery-ui-1.8.9.custom.css b/addons/web_mobile/static/lib/jquery_mobile/css/jquery-ui-1.8.9.custom.css new file mode 100644 index 00000000000..8a73ef48ce9 --- /dev/null +++ b/addons/web_mobile/static/lib/jquery_mobile/css/jquery-ui-1.8.9.custom.css @@ -0,0 +1,573 @@ +/* + * jQuery UI CSS Framework 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.9 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* + * jQuery UI Progressbar 1.8.9 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:1.2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%;background-image:url(/web_mobile/static/lib/jquery_mobile/img/progress-bar.gif) } \ No newline at end of file diff --git a/addons/web_mobile/static/lib/jquery_mobile/img/progress-bar.gif b/addons/web_mobile/static/lib/jquery_mobile/img/progress-bar.gif new file mode 100644 index 00000000000..d8446a9ab7f Binary files /dev/null and b/addons/web_mobile/static/lib/jquery_mobile/img/progress-bar.gif differ diff --git a/addons/web_mobile/static/src/js/chrome_mobile.js b/addons/web_mobile/static/src/js/chrome_mobile.js index b52b4642b67..99b9651fa7b 100644 --- a/addons/web_mobile/static/src/js/chrome_mobile.js +++ b/addons/web_mobile/static/src/js/chrome_mobile.js @@ -12,11 +12,14 @@ openerp.web_mobile.mobilewebclient = function(element_id) { }; openerp.web_mobile.MobileWebClient = openerp.web.Widget.extend({ + + template: "WebClient", + init: function(element_id) { this._super(null, element_id); - QWeb.add_template("xml/web_mobile.xml"); + openerp.web.qweb.add_template("xml/web_mobile.xml"); var params = {}; - this.$element.html(QWeb.render("WebClient", {})); + this.$element.html(this.render()); this.session = new openerp.web.Session("oe_errors"); this.crashmanager = new openerp.web.CrashManager(this); this.login = new openerp.web_mobile.Login(this, "oe_login"); @@ -29,13 +32,26 @@ openerp.web_mobile.MobileWebClient = openerp.web.Widget.extend({ }); openerp.web_mobile.Login = openerp.web.Widget.extend({ + + template: "Login", + start: function() { + this.has_local_storage = typeof(localStorage) != 'undefined'; + this.remember_creditentials = true; + this.selected_login = null; + this.selected_password = null; + if (this.has_local_storage && this.remember_creditentials) { + this.selected_login = localStorage.getItem('last_login_login_success'); + this.selected_password = localStorage.getItem('last_password_login_success'); + } var self = this; jQuery("#oe_header").children().remove(); this.rpc("/web/database/get_list", {}, function(result) { - var selection = new openerp.web_mobile.Selection(); self.db_list = result.db_list; - self.$element.html(QWeb.render("Login", self)); + self.$element.html(self.render(self)); + if(self.session.db!=""){ + self.$element.find("#database").val(self.session.db); + } self.$element.find("#login_btn").click(self.on_login); $.mobile.initializePage(); }); @@ -49,11 +65,21 @@ openerp.web_mobile.Login = openerp.web.Widget.extend({ var db = $e.find("div select[name=database]").val(); var login = $e.find("div input[name=login]").val(); var password = $e.find("div input[name=password]").val(); - //$e.hide(); // Should hide then call callback this.session.session_login(db, login, password, function() { if(self.session.session_is_valid()) { + if (self.has_local_storage) { + if(self.remember_creditentials) { + localStorage.setItem('last_db_login_success', db); + localStorage.setItem('last_login_login_success', login); + localStorage.setItem('last_password_login_success', password); + } else { + localStorage.setItem('last_db_login_success', ''); + localStorage.setItem('last_login_login_success', ''); + localStorage.setItem('last_password_login_success', ''); + } + } self.on_login_valid(); } else { self.on_login_invalid(); @@ -71,9 +97,12 @@ openerp.web_mobile.Login = openerp.web.Widget.extend({ .removeClass("login_invalid") .addClass("login_valid"); //.hide(); - - this.menu = new openerp.web_mobile.Menu(this, "oe_menu", "oe_secondary_menu"); - this.menu.start(); + if(!$('#oe_menu').html().length){ + this.menu = new openerp.web_mobile.Menu(this, "oe_menu", "oe_secondary_menu"); + this.menu.start(); + }else{ + $.mobile.changePage("#oe_menu", "slide", false, true); + } }, do_ask_login: function(continuation) { this.on_login_invalid(); @@ -86,59 +115,80 @@ openerp.web_mobile.Login = openerp.web.Widget.extend({ }); openerp.web_mobile.Header = openerp.web.Widget.extend({ + + template: "Header", + init: function(session, element_id) { this._super(session, element_id); }, start: function() { - var self = this; - self.$element.html(QWeb.render("Header", this)); + this.$element.html(this.render(this)); } }); openerp.web_mobile.Footer = openerp.web.Widget.extend({ + + template: "Footer", + init: function(session, element_id) { this._super(session, element_id); }, start: function() { - var self = this; - self.$element.html(QWeb.render("Footer", this)); + this.$element.html(this.render(this)); } }); openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({ + + template: "Shortcuts", + init: function(session, element_id) { this._super(session, element_id); }, start: function() { var self = this; this.rpc('/web/session/sc_list',{} ,function(res){ - self.$element.html(QWeb.render("Shortcuts", {'sc' : res})) + self.$element.html(self.render({'sc' : res})) + self.$element.find("[data-role=header]").find('h1').html('Favourite'); + self.$element.find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); self.$element.find('#content').find("a").click(self.on_clicked); - self.$element.find("#footer").find('#preference').click(function(){ + self.$element.find("[data-role=footer]").find('#preference').click(function(){ if(!$('#oe_options').html().length){ this.options = new openerp.web_mobile.Options(self, "oe_options"); this.options.start(); - } - else{ - self.$element.find("#footer").find('#preference').attr('href','#oe_options'); + }else{ + $.mobile.changePage("#oe_options", "slide", false, true); } }); - $.mobile.changePage($("#oe_shortcuts"), "slide", true, true); + $.mobile.changePage("#oe_shortcuts", "slide", false, true); }); }, on_clicked: function(ev) { + var self = this; + ev.preventDefault(); + ev.stopPropagation(); $shortcut = $(ev.currentTarget); id = $shortcut.data('menu'); res_id = $shortcut.data('res'); -// this.header = new openerp.web_mobile.Header(this, "oe_header"); - this.listview = new openerp.web_mobile.ListView(this, res_id); -// this.header.start(); - this.listview.appendTo($("#oe_list")); + if(!$('[id^="oe_list_'+res_id+'"]').html()){ + $('
      ').appendTo('#moe'); + this.listview = new openerp.web_mobile.ListView(self, "oe_list_"+res_id, res_id); + this.listview.start(); + }else{ + $.mobile.changePage('#oe_list_'+res_id, "slide", false, true); + } + ev.preventDefault(); + ev.stopPropagation(); jQuery("#oe_header").find("h1").html($shortcut.data('name')); } }); openerp.web_mobile.Menu = openerp.web.Widget.extend({ + + template: "Menu", + init: function(session, element_id, secondary_menu_id) { this._super(session, element_id); this.secondary_menu_id = secondary_menu_id; @@ -151,32 +201,37 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({ on_loaded: function(data) { var self = this; this.data = data; - this.$element.html(QWeb.render("Menu", this.data)); - - this.$element.find("#footer").find('#shrotcuts').click(function(){ + this.header = new openerp.web_mobile.Header(this, "oe_header"); + this.header.start(); + this.footer = new openerp.web_mobile.Footer(this, "oe_footer"); + this.footer.start(); + this.$element.html(this.render(this.data)); + this.$element.find("[data-role=header]").find('h1').html('Applications'); + this.$element.find("[data-role=header]").find('#home').hide(); + this.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ if(!$('#oe_shortcuts').html().length){ this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); this.shortcuts.start(); - } - else{ - self.$element.find("#footer").find('#shrotcuts').attr('href','#oe_shortcuts'); + }else{ + $.mobile.changePage($("#oe_shortcuts"), "slide", false, true); } }); - this.$element.find("#footer").find('#preference').click(function(){ + this.$element.find("[data-role=footer]").find('#preference').click(function(){ if(!$('#oe_options').html().length){ this.options = new openerp.web_mobile.Options(self, "oe_options"); this.options.start(); - } - else{ - self.$element.find("#footer").find('#preference').attr('href','#oe_options'); + }else{ + $.mobile.changePage("#oe_options", "slide", false, true); } }); this.$element.add(this.$secondary_menu).find("#content").find('a').click(this.on_menu_click); - $.mobile.changePage($("#oe_menu"), "slide", true, true); + $.mobile.changePage("#oe_menu", "slide", false, true); }, on_menu_click: function(ev, id) { var $menu = $(ev.currentTarget); id = $menu.data('menu'); + ev.preventDefault(); + ev.stopPropagation(); for (var i = 0; i < this.data.data.children.length; i++) { if (this.data.data.children[i].id == id) { this.children = this.data.data.children[i]; @@ -185,102 +240,114 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({ this.$element .removeClass("login_valid") .addClass("secondary_menu"); - //.hide(); - if(!$('#oe_sec_menu').html().length){ - this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu", this.children); - this.secondary.start(); - }else{ - this.$element.find("#content").find('a').attr('href','#oe_sec_menu'); - } - /*if(!$('#oe_sec_menu').html().length){ - this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu", this.children); + if(!$('[id^="oe_sec_menu_'+id+'"]').html()){ + $('
      ').appendTo('#moe'); + this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu_"+id, this.children); this.secondary.start(); }else{ - // self.$element.find("#content").find('a').attr('href','#oe_sec_menu'); - this.$element.add(this.$secondary_menu).find("#content").find('a').attr('href','#oe_sec_menu'); - }*/ - + $.mobile.changePage('#oe_sec_menu_'+id, "slide", false, true); + } } }); + openerp.web_mobile.Secondary = openerp.web.Widget.extend({ + + template: "Menu.secondary", + init: function(session, element_id, secondary_menu_id) { this._super(session, element_id); this.data = secondary_menu_id; }, start: function(ev, id) { var self = this; - // console.log(this.data,this.$element.html().length); - - /* if(this.$element.html().length){ - self.$element.find('[data-role="listview"]').remove(); - - _.each(self.data.children,function(i){ - var newul = '
      • '+ - i.name+'
      '; // Create New List Item - self.$element.find('#content').append(newul); - //console.log('in for loop',i.children); - }); - console.log('saaasasaaa',self.$element.find('#content'),self.data); - //self.$element.find('[data-role="listview"]').listview('refresh'); - }else{*/ - var v = { menu : this.data }; - this.$element.html(QWeb.render("Menu.secondary", v)); - this.$element.find("#header").find("h1").html(this.data.name); + this.$element.html(this.render(v)); + this.$element.find("[data-role=header]").find("h1").html(this.data.name); this.$element.add(this.$secondary_menu).find('#content').find("a").click(this.on_menu_click); - this.$element.find("#footer").find('#shrotcuts').click(function(){ + this.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ if(!$('#oe_shortcuts').html().length){ this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); this.shortcuts.start(); - } - else{ - self.$element.find("#footer").find('#shrotcuts').attr('href','#oe_shortcuts'); + }else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); } }); - this.$element.find("#footer").find('#preference').click(function(){ + this.$element.find("[data-role=footer]").find('#preference').click(function(){ if(!$('#oe_options').html().length){ this.options = new openerp.web_mobile.Options(self, "oe_options"); this.options.start(); - } - else{ - self.$element.find("#footer").find('#preference').attr('href','#oe_options'); + }else{ + $.mobile.changePage("#oe_options", "slide", false, true); } }); - $.mobile.changePage($("#oe_sec_menu"), "slide", true, true); + this.$element.find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + $.mobile.changePage("#"+this.element_id, "slide", false, true); }, on_menu_click: function(ev, id) { - var $menu = $(ev.currentTarget); + $menu = $(ev.currentTarget); id = $menu.data('menu'); - if (id) { - this.listview = new openerp.web_mobile.ListView(this, id); - this.listview.appendTo("#oe_list"); + name = $menu.data('name'); + ev.preventDefault(); + ev.stopPropagation(); + var child_len = 0; + for (var i = 0; i < this.data.children.length; i++) { + for (var j=0; j < this.data.children[i].children.length; j++) { + if (this.data.children[i].children[j].id == id) { + this.children = this.data.children[i].children[j]; + child_len = this.children.children.length; + } + } + } + if (child_len > 0) { + this.$element + .addClass("secondary_menu"); + if(!$('[id^="oe_sec_menu_'+id+'"]').html()){ + $('
      ').appendTo('#moe'); + this.secondary = new openerp.web_mobile.Secondary(this, "oe_sec_menu_"+id, this.children); + this.secondary.start(); + }else{ + $.mobile.changePage('#oe_sec_menu_'+id, "slide", false, true); + } + }else { + if(!$('[id^="oe_list_'+id+'"]').html()){ + $('
      ').appendTo('#moe'); + this.listview = new openerp.web_mobile.ListView(this, "oe_list_"+id, id); + this.listview.start(); + }else{ + $.mobile.changePage('#oe_list_'+id, "slide", false, true); + } } jQuery("#oe_header").find("h1").html($menu.data('name')); } }); openerp.web_mobile.Options = openerp.web.Widget.extend({ + + template: "Options", + start: function() { var self = this; - this.$element.html(QWeb.render("Options", this)); - this.$element.find("#footer").find('#shrotcuts').click(function(){ + this.$element.html(this.render(this)); + this.$element.find("[data-role=header]").find('h1').html('Preference'); + this.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ if(!$('#oe_shortcuts').html().length){ this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); this.shortcuts.start(); - } - else{ - self.$element.find("#footer").find('#shrotcuts').attr('href','#oe_shortcuts'); + }else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); } }); - $.mobile.changePage($("#oe_options"), "slide", true, true); + this.$element.find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + this.$element.find("[data-role=content]").find('a').click(function(){ + $('#oe_login').empty(); + window.location.replace('/mobile'); + }); + $.mobile.changePage("#oe_options", "slide", false, true); } }); -openerp.web_mobile.Selection = openerp.web.Widget.extend({ - on_select_option: function(ev){ - ev.preventDefault(); - var $this = ev.currentTarget; - $($this).prev().find(".ui-btn-text").html($($this).find("option:selected").text()); - } -}); }; diff --git a/addons/web_mobile/static/src/js/form_mobile.js b/addons/web_mobile/static/src/js/form_mobile.js index 3dc777a2bd6..1cb1dfb494e 100644 --- a/addons/web_mobile/static/src/js/form_mobile.js +++ b/addons/web_mobile/static/src/js/form_mobile.js @@ -5,126 +5,247 @@ openerp.web_mobile.form_mobile = function (openerp) { openerp.web_mobile.FormView = openerp.web.Widget.extend({ - init: function(session, element_id, list_id, action) { + + template: 'FormView', + + init: function(session, element_id, list_id, action, head_title, resmodel, viewid) { this._super(session, element_id); this.list_id = list_id; this.action = action; - this.content_expanded_class = "ui-collapsible-content ui-collapsible-content-expanded"; - this.content_collapsed_class = "ui-collapsible-content ui-collapsible-content-collapsed"; - this.expanded_class = "ui-collapsible-content-expanded"; - this.collapsed_class = "ui-collapsible-content-collapsed"; - this.plus_class = "ui-icon-plus"; - this.minus_class = "ui-icon-minus"; + this.head_title = head_title; + this.resmodel = resmodel; + this.viewid = viewid; }, start: function() { var self = this; var id = this.list_id; - var model = this.action.res_model; - var view_id = this.action.views[1][0]; - this.dataset = new openerp.web.DataSetSearch(this, this.action.res_model, null, null); + var model = this.action.res_model || this.resmodel; + if(this.action){ + var view_id = this.action.views[1][0]; + }else{ + var view_id = this.viewid; + } + this.dataset = new openerp.web.DataSetSearch(this, model, null, null); var context = new openerp.web.CompoundContext(this.dataset.get_context()); this.dataset.read_slice([],{}, function (result) { for (var i = 0; i < result.length; i++) { if (result[i].id == id) { - var data = result[i]; + self.datarecord = result[i]; } } - self.rpc("/web/view/load", {"model": model, "view_id": view_id, "view_type": "form", context: context}, function (result) { - var fields = result.fields; - var view_fields = result.arch.children; - var get_fields = self.get_fields(view_fields); - var selection = new openerp.web_mobile.Selection(); - for (var j = 0; j < view_fields.length; j++) { - if (view_fields[j].tag == 'notebook') { - var notebooks = view_fields[j]; - } + self.rpc("/web/view/load", {"model": model, "view_id": view_id, "view_type": "form", context: context}, self.on_loaded) + }); + }, + on_loaded: function(result) { + var self = this; + var fields = result.fields; + var view_fields = result.arch.children; + var get_fields = this.get_fields(view_fields); + for (var j = 0; j < view_fields.length; j++) { + if (view_fields[j].tag == 'notebook') { + var notebooks = view_fields[j]; + } + } + self.$element.html(self.render({'get_fields': get_fields, 'notebooks': notebooks || false, 'fields' : fields, 'values' : self.datarecord ,'temp_flag':'1'})); + self.formatdata(get_fields, fields, result, self.datarecord,self.element_id,'element'); + self.$element.find("[data-role=header]").find('h1').html(self.head_title); + self.$element.find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + self.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ + if(!$('#oe_shortcuts').html().length){ + this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); + this.shortcuts.start(); + }else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); + } + }); + self.$element.find("[data-role=footer]").find('#preference').click(function(){ + if(!$('#oe_options').html().length){ + this.options = new openerp.web_mobile.Options(self, "oe_options"); + this.options.start(); + }else{ + $.mobile.changePage("#oe_options", "slide", false, true); + } + }); + self.$element.find('#formbutton').click(function(){ + var head = $(this).prev().find('select').find("option:selected").text(); + var selected_id = $(this).prev().find('select').val(); + var select_model = $(this).prev().find('select').attr('for'); + if(selected_id!="false"){ + if(!$('[id^="oe_form_'+selected_id+select_model+'"]').html()){ + $('
      ').appendTo('#moe'); + this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); + this.formview.start(); + }else{ + $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); } - self.$element.html(QWeb.render("FormView", {'get_fields': get_fields, 'notebooks': notebooks || false, 'fields' : fields, 'values' : data })); - - self.$element.find("#header").find('h1').html(self.action.name); - self.$element.find('select').change(function(ev){ - selection.on_select_option(ev); - }); - self.$element.find('a').click(function(){ - for (var k = 0; k < notebooks.children.length; k++) { - var text = $(this).find('.ui-btn-text').text(); - var next = $(this).next(); - var span = $(this).find('span .ui-icon'); - if (notebooks.children[k].attrs.string == $.trim(text)) { - get_fields = self.get_fields(notebooks.children[k].children); - $(this).parents().find('form').find('div').each( function() { - var prev = $(this).prev(); - var trim_class = $.trim($(this).attr('class')); - if (trim_class == self.content_expanded_class || trim_class == self.content_collapsed_class) { - prev.removeClass('ui-btn-active'); - if ($.trim(prev.find('.ui-btn-text').text()) != notebooks.children[k].attrs.string) { - self.expanded($(this),prev.find('span .ui-icon')); - } - } - }); - if (next.hasClass(self.content_collapsed_class)) { - self.collapsed(next,span); - } - else if (next.hasClass(self.content_expanded_class)) { - self.expanded(next,span); - } - if (!next.find('.detail').html().length) { - for (var i = 0; i < get_fields.length; i++) { - if (fields[get_fields[i].attrs.name].type == 'one2many'){ - if(fields[get_fields[i].attrs.name].views.form){ - var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); - var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; - var notebook=fields[get_fields[i].attrs.name].views.form.arch; - } - var relational = get_fields[i].attrs.name; - } - } - if(notebook){ - next.find('.detail').append(QWeb.render("FormView", {'get_fields': get_fields,'fields' : result.fields, 'values' : data,'til': notebook.attrs.string })); - }else{ - next.find('.detail').append(QWeb.render("FormView", {'get_fields': get_fields,'fields' : result.fields, 'values' : data })); - } - } - - //$.mobile.changePage($("#oe_form"), "slide", true, true); - /*next.find('.detail').find('li').click(function(){ - if(data[relational]){ - var dataset = new openerp.web.DataSetStatic(self, result.fields[relational].relation, result.fields[relational].context); - dataset.domain=[['id', 'in', data[relational]]]; - dataset.name_search('', dataset.domain, 'in',false ,function(res){ - for(var i=0;i

      ').appendTo('#moe'); + this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); + this.formview.start(); + }else{ + $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); + } + } }); - $.mobile.changePage($("#oe_form"), "slide", true, true); - //$("#oe_header").find("h1").html(result.arch.attrs.string); + } }); + self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').find('div#page_content').find('[data-role=content]').find('ul').find('li').click(function(ev){ + ev.preventDefault(); + ev.stopPropagation(); + var latid,lastid; + $(this).parents().each(function(){ + latid = $(this).attr('id'); + self.$element.find('[data-role=collapsible-set]').find('[data-role=collapsible]').each(function(){ + if(latid==$(this).attr('id')){ + lastid = $(this).attr('id'); + } + }); + }); + var relational = $(this).attr('for'); + if(result.fields[relational]){ + var head = $.trim($(this).text()); + var dataset = new openerp.web.DataSetStatic(self, result.fields[relational].relation, result.fields[relational].context); + dataset.domain=[['id', 'in', self.datarecord[relational]]]; + dataset.name_search('', dataset.domain, 'in',false ,function(res){ + for(var i=0;i ').appendTo('#moe'); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').html(openerp.web.qweb.render("ListView", {'records' : res})); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('h1').html(head); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=footer]").find('#shrotcuts').click(function(){ + if(!$('#oe_shortcuts').html().length){ + this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); + this.shortcuts.start(); + }else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); + } + }); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("[data-role=footer]").find('#preference').click(function(){ + if(!$('#oe_options').html().length){ + this.options = new openerp.web_mobile.Options(self, "oe_options"); + this.options.start(); + }else{ + $.mobile.changePage("#oe_options", "slide", false, true); + } + }); + $('[id^="oe_list_'+relational+'_'+self.element_id+'"]').find("a#list-id").click(function(ev){ + ev.preventDefault(); + ev.stopPropagation(); + var head_title = $(this).text(); + var listid = $(ev.currentTarget).data('id'); + dataset = new openerp.web.DataSetSearch(self, dataset.model, null, null); + dataset.read_slice([],{}, function (result_relational) { + for (var i = 0; i < result_relational.length; i++) { + if (result_relational[i].id == listid) { + var data_relational = result_relational[i]; + } + } + if(!$('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html()){ + $('
      ').appendTo('#moe'); + for (var k = 0; k < notebooks.children.length; k++) { + if (notebooks.children[k].attrs.string == lastid) { + get_fields = self.get_fields(notebooks.children[k].children); + for (var i = 0; i < get_fields.length; i++) { + if (fields[get_fields[i].attrs.name].type == 'one2many'){ + self.relational_fields = get_fields[i].attrs.name; + if(fields[get_fields[i].attrs.name].views.form){ + var get_fields_test = self.get_fields(fields[get_fields[i].attrs.name].views.form.arch.children); + var fields_test = fields[get_fields[i].attrs.name]['views'].form.fields; + var notebook=fields[get_fields[i].attrs.name].views.form.arch; + } + } + } + } + } + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').html(self.render({'get_fields': get_fields_test, 'notebooks': false, 'fields' : fields_test, 'values' : data_relational, 'temp_flag':'1' })); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('h1').html(head_title); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=footer]").find('#shrotcuts').click(function(){ + if(!$('#oe_shortcuts').html().length){ + this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); + this.shortcuts.start(); + }else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); + } + }); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find("[data-role=footer]").find('#preference').click(function(){ + if(!$('#oe_options').html().length){ + this.options = new openerp.web_mobile.Options(self, "oe_options"); + this.options.start(); + }else{ + $.mobile.changePage("#oe_options", "slide", false, true); + } + }); + $('[id^="oe_form_'+listid+result.fields[relational].relation+'"]').find('#formbutton').click(function(){ + var head = $(this).prev().find('select').find("option:selected").text(); + var selected_id = $(this).prev().find('select').val(); + var select_model = $(this).prev().find('select').attr('for'); + if(selected_id!="false"){ + if(!$('[id^="oe_form_'+selected_id+select_model+'"]').html()){ + $('
      ').appendTo('#moe'); + this.formview = new openerp.web_mobile.FormView(self, "oe_form_"+selected_id+select_model, selected_id, '', head, select_model, false); + this.formview.start(); + }else{ + $.mobile.changePage('#oe_form_'+selected_id+select_model, "slide", false, true); + } + } + }); + self.formatdata(get_fields_test, fields_test, result, data_relational,'oe_form_'+listid+result.fields[relational].relation,'element'); + $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); + self.formatdata('', '', '', '','oe_form_'+listid+result.fields[relational].relation,'slider'); + }else{ + $.mobile.changePage('#oe_form_'+listid+result.fields[relational].relation, "slide", false, true); + } + }); + }); + $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); + }else{ + $.mobile.changePage("#oe_list_"+relational+"_"+self.element_id, "slide", false, true); + } + }); + } + }); + $.mobile.changePage("#"+self.element_id, "slide", false, true); + self.formatdata('', '', '', '',self.element_id,'slider'); }, get_fields: function(view_fields, fields) { this.fields = fields || []; @@ -138,17 +259,46 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ } return this.fields; }, - collapsed: function(next,span) { - span.removeClass(this.plus_class); - span.addClass(this.minus_class); - next.removeClass(this.collapsed_class); - next.addClass(this.expanded_class); - }, - expanded: function(next,span) { - span.removeClass(this.minus_class); - span.addClass(this.plus_class); - next.removeClass(this.expanded_class); - next.addClass(this.collapsed_class); + formatdata: function(getfields, fields, result, data, id, flag){ + if(flag == "element") { + for(var i = 0; i < getfields.length; i++) { + if (getfields[i].attrs.widget == "progressbar") { + $("#progress").progressbar({value: data[getfields[i].attrs.name]}) + } + $('[id^="'+id+'"]').find('input').each(function() { + // Set Date and Datetime field for main form + if($(this).attr('id') == getfields[i].attrs.name) { + if(fields[getfields[i].attrs.name].type == "date") { + $("#"+getfields[i].attrs.name).datepicker(); + }else if(fields[getfields[i].attrs.name].type == "datetime" || fields[getfields[i].attrs.name].type == "time") { + $("#"+getfields[i].attrs.name).datetimepicker(); + } + // Temp: Set as disabled + $("#"+getfields[i].attrs.name).attr('disabled', 'true'); + if(result.fields[getfields[i].attrs.name]){ + var dateresult = openerp.web.format_value(data[getfields[i].attrs.name], {"widget": result.fields[getfields[i].attrs.name].type}); + $(this).val(dateresult); + } + } + }); + // Temp: Selection set as disabled + $('[id^="'+id+'"]').find('select').each(function() { + $(this).find('option').attr('disabled', 'true') + }); + } + } + if(flag == "slider") { + $('[id^="'+id+'"]').find('#slider').each(function() { + $(this).slider({ disabled: "true" }); + }); + $('[id^="'+id+'"]').find('.ui-selectmenu').each(function(){ + $(this).click(function() { + $(this).css('top', '-9999px'); + $(this).css('left', '-9999px'); + }); + }); + } } }); + }; diff --git a/addons/web_mobile/static/src/js/list_mobile.js b/addons/web_mobile/static/src/js/list_mobile.js index 1d4e0d72ca2..ec6de48e941 100644 --- a/addons/web_mobile/static/src/js/list_mobile.js +++ b/addons/web_mobile/static/src/js/list_mobile.js @@ -5,13 +5,15 @@ openerp.web_mobile.list_mobile = function (openerp) { openerp.web_mobile.ListView = openerp.web.Widget.extend({ + + template: 'ListView', + init: function(session, element_id, list_id) { this._super(session, element_id); this.list_id = list_id; }, start: function() { - this.rpc('/web/menu/action', {'menu_id': this.list_id}, - this.on_menu_action_loaded); + this.rpc('/web/menu/action', {'menu_id': this.list_id}, this.on_menu_action_loaded); }, on_menu_action_loaded: function(data) { var self = this; @@ -23,48 +25,46 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({ on_search_data: function(ev){ var self = this; var dataset = new openerp.web.DataSetStatic(this, this.action.res_model, this.action.context); - dataset.name_search('', [], 'ilike',false ,function(result){ - if(self.$element.html().length){ - self.$element.find('[data-role="listview"]').find('li').remove(); - for(var i=0;i' + result[i][1] + ''; // Create New List Item - self.$element.find('[data-role="listview"]').append(newli); - } - self.$element.find('[data-role="listview"]').listview('refresh'); - }else{ - self.$element.html(QWeb.render("ListView", {'records' : result})); - self.$element.find("#header").find('h1').html(self.action.name); - self.$element.find("#footer").find('#shortcuts').click(function(){ - if(!$('#oe_shortcuts').html().length){ - this.shortcut = new openerp.web_mobile.Options(self, "oe_shortcuts"); - this.options.start(); - } - else{ - self.$element.find("#footer").find('#shrotcuts').attr('href','#oe_shortcuts'); + dataset.name_search('', this.action.domain, 'ilike', false, function(result){ + self.$element.html(self.render({'records' : result})); + self.$element.find("[data-role=header]").find('h1').html(self.action.name); + self.$element.find("[data-role=header]").find('#home').click(function(){ + $.mobile.changePage("#oe_menu", "slide", false, true); + }); + self.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){ + if (!$('#oe_shortcuts').html().length) { + this.shortcuts = new openerp.web_mobile.Shortcuts(self, "oe_shortcuts"); + this.shortcuts.start(); + }else{ + $.mobile.changePage("#oe_shortcuts", "slide", false, true); } }); - self.$element.find("#footer").find('#preference').click(function(){ + self.$element.find("[data-role=footer]").find('#preference').click(function(){ if(!$('#oe_options').html().length){ this.options = new openerp.web_mobile.Options(self, "oe_options"); this.options.start(); - } - else{ - self.$element.find("#footer").find('#preference').attr('href','#oe_options'); + }else{ + $.mobile.changePage("#oe_options", "slide", false, true); } }); - } self.$element.find("a#list-id").click(self.on_list_click); - $.mobile.changePage($("#oe_list"), "slide", true, true); + $.mobile.changePage("#"+self.element_id, "slide", false, true); }); }, on_list_click: function(ev) { var $record = $(ev.currentTarget); var self = this; + ev.preventDefault(); + ev.stopPropagation(); id = $record.data('id'); -// this.header = new openerp.web_mobile.Header(this, "oe_header"); - this.formview = new openerp.web_mobile.FormView(this, "oe_form", id, this.action); -// this.header.start(); - this.formview.start(); + head_title = $.trim($record.text()); + if(!$('[id^="oe_form_'+id+this.action.res_model+'"]').html()){ + $('
      ').appendTo('#moe'); + this.formview = new openerp.web_mobile.FormView(this, "oe_form_"+id+this.action.res_model, id, this.action, head_title, '' ,''); + this.formview.start(); + }else{ + $.mobile.changePage('#oe_form_'+id+this.action.res_model, "slide", false, true); + } } }); }; diff --git a/addons/web_mobile/static/src/web_mobile.html b/addons/web_mobile/static/src/web_mobile.html index 9a17ff49dbb..2afa79dcb5e 100755 --- a/addons/web_mobile/static/src/web_mobile.html +++ b/addons/web_mobile/static/src/web_mobile.html @@ -3,7 +3,8 @@ OpenERP Web Mobile - + + @@ -12,14 +13,23 @@ - + + + + + + + + + - + + @@ -29,7 +39,6 @@