diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 314ac8ce717..e23a0431a7c 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -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) #---------------------------------------------------------- @@ -438,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..42dbe9cfd4f 100644 --- a/addons/web/common/nonliterals.py +++ b/addons/web/common/nonliterals.py @@ -131,7 +131,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 +179,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..55e23aae979 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' @@ -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 diff --git a/addons/web/po/es.po b/addons/web/po/es.po new file mode 100644 index 00000000000..5302560f867 --- /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 01:06+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/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/gl.po b/addons/web/po/gl.po new file mode 100644 index 00000000000..a090482293e --- /dev/null +++ b/addons/web/po/gl.po @@ -0,0 +1,685 @@ +# 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 01:05+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-19 06:05+0000\n" +"X-Generator: Launchpad (build 14157)\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 "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "♻" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Save & Edit" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create & Edit" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "New" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Duplicate" +msgstr "" + +#: 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 "" + +#: 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 "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Open..." +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "Create..." +msgstr "" + +#: 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/static/src/css/base.css b/addons/web/static/src/css/base.css index 6e38d16d26e..6872b921435 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; @@ -222,6 +225,7 @@ label.error { background: #f0eeee; } .openerp .oe-application-container { + width: 100%; height: 100%; } @@ -1369,19 +1373,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,16 +1395,16 @@ 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; } diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 588c065b03b..bdb8e23c20b 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -136,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) { @@ -161,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})); } }); @@ -198,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'); } } }); @@ -466,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-', @@ -484,7 +492,7 @@ 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) { @@ -550,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) { @@ -946,7 +954,6 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie 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(); this.header = new openerp.web.Header(this); this.login = new openerp.web.Login(this); diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index bed5f199157..8dfbd68e6de 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -384,6 +384,8 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web var self = this; // Construct a JSON-RPC2 request, method is currently unused params.session_id = this.session_id; + if (this.debug) + params.debug = 1; // Call using the rpc_mode var deferred = $.Deferred(); @@ -566,15 +568,11 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web var file_list = ["/web/static/lib/datejs/globalization/" + self.user_context.lang.replace("_", "-") + ".js" ]; - if(self.debug) { - self.rpc('/web/webclient/csslist', {"mods": modules}, self.do_load_css); - self.rpc('/web/webclient/jslist', {"mods": modules}, function(files) { - self.do_load_js(file_list.concat(files)); - }); - } else { - self.do_load_css(["/web/webclient/css?mods="+modules]); - self.do_load_js(file_list.concat(["/web/webclient/js?mods="+modules])); - } + + self.rpc('/web/webclient/csslist', {"mods": modules}, self.do_load_css); + self.rpc('/web/webclient/jslist', {"mods": modules}, function(files) { + self.do_load_js(file_list.concat(files)); + }); openerp._modules_loaded = true; }); }); @@ -583,7 +581,7 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web var self = this; _.each(files, function (file) { $('head').append($('', { - 'href': file + (self.debug ? '?debug=' + (new Date().getTime()) : ''), + 'href': file, 'rel': 'stylesheet', 'type': 'text/css' })); @@ -595,14 +593,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); }; - document.head.appendChild(tag); + var head = document.head || document.getElementsByTagName('head')[0]; + head.appendChild(tag); } else { this.on_modules_loaded(); } diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 1eaffcd0e30..ea0824fb1df 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -610,120 +610,44 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ on_default_get: function(res) { this.last_default_get = res; }, - /** - * Makes sure this dataset has the fields_get for its model stored locally, - * so create/write methods are able to determine if written fields are m2os - * and can name_get those fields if that's the case (in order to cache a - * correct m2o value for them) - * - * @returns {$.Deferred} whether the fields_get is done executing, provides the fields_get value to its callbacks - */ - ensure_has_fields: function () { - var self = this; - - if (this.fields_get) { - var d = $.Deferred(); - setTimeout(function () { d.resolve(self.fields_get, true); }, 0); - return d.promise(); - } else { - return self.call('fields_get', [], function (fields_get) { - self.fields_get = fields_get; - }); - } - }, - /** - * Relational fields may not be written in the same format they are read. - * - * Since the BufferedDataSet is a bit dumb, it returns what it's got stored - * in its cache, which for modified value is what it was given. This breaks - * some basic contracts of openerp such as m2o read being in the - * ``name_get`` format. - * - * Because create & write are supposed to be asynchronous, though, it - * should be easy to just name_get all incorrect values. - * - * @param {Object} data form-data to write to the cache - * @returns {$.Deferred} resolved with a fixed data dictionary - */ - fix_relational: function (data) { - var self = this; - var results = $.Deferred(); - this.ensure_has_fields().then(function (fields) { - var fields_to_fix = _(fields).chain() - .map(function (d, k) { return {key: k, descriptor: d}; }) - .filter(function (field) { - // keep m2o fields which are in the data dict - return field.descriptor.type === 'many2one' && - data[field.key]; - }).pluck('key') - .value(); - var name_gets = _(fields_to_fix).map(function (field) { - return new openerp.web.DataSet(self, self.fields_get[field].relation) - .name_get([data[field]], null); - }); - // null-concat forces stupid bastard `when` to always return an - // array containing the Array-ified results of all the name_gets. - // otherwise, if there's a single field to fix it returns the - // results of the unique name_get directly. - $.when.apply(null, name_gets.concat([null])).then(function () { - var record = _.extend({}, data); - for(var i=0; i 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; } }); @@ -1019,7 +1025,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 { @@ -1893,6 +1899,7 @@ 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; @@ -1948,7 +1955,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() } @@ -1957,9 +1964,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; @@ -2036,6 +2045,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; @@ -2647,14 +2657,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.do_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) { @@ -2671,6 +2677,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); @@ -2750,7 +2757,7 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({ 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) { @@ -2769,12 +2776,32 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({ 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; } }); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 0ea1f7ec944..629dc12c780 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,16 +768,22 @@ 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) { + self.dataset.index = self.records.indexOf( + self.records.get(row_id)); + self.row_clicked(e); + } }); }, row_clicked: function () { @@ -785,6 +792,46 @@ openerp.web.ListView.List = openerp.web.Class.extend( /** @lends openerp.web.Lis [this.records.at(this.dataset.index).get('id'), 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 +839,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 +947,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 +1122,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/views.js b/addons/web/static/src/js/views.js index 3cc7d7eb4f8..9aecbd475af 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -431,10 +431,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) { @@ -848,33 +854,40 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{ return self.widget_parent.on_action_executed.apply(null, arguments); } }; + var context = new db.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 db.web.CompoundContext(context, action.context || {}); + if (record_id) { + ncontext.add({ + active_id: record_id, + active_ids: [record_id], active_model: dataset.model - }], + }); + } + 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); } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 8dbd3401b4c..7720ae2d38b 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -449,11 +449,11 @@ -

- - + +

+

@@ -636,7 +636,7 @@ - + @@ -649,15 +649,10 @@
- - - 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/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 459c44d699a..2cc0cae1392 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -19,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', @@ -183,10 +181,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)); } 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_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_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_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..dcd168536d8 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -226,13 +226,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; }); }, /** @@ -397,6 +398,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'); 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 ":"