diff --git a/addons/web/__init__.py b/addons/web/__init__.py index 06e7fa1f0e3..b09c8c213bc 100644 --- a/addons/web/__init__.py +++ b/addons/web/__init__.py @@ -12,11 +12,16 @@ def wsgi_postload(): import openerp import os import tempfile + import getpass _logger.info("embedded mode") o = Options() o.dbfilter = openerp.tools.config['dbfilter'] o.server_wide_modules = openerp.conf.server_wide_modules or ['web'] - o.session_storage = os.path.join(tempfile.gettempdir(), "oe-sessions") + try: + username = getpass.getuser() + except Exception: + username = "unknown" + o.session_storage = os.path.join(tempfile.gettempdir(), "oe-sessions-" + username) o.addons_path = openerp.modules.module.ad_paths o.serve_static = True o.backend = 'local' diff --git a/addons/web/common/http.py b/addons/web/common/http.py index f3ac8d0bcd9..17ccfb63d8a 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -10,6 +10,7 @@ import os import pprint import sys import threading +import time import traceback import urllib import uuid @@ -331,8 +332,9 @@ def session_context(request, storage_path, session_cookie='sessionid'): if (isinstance(value, session.OpenERPSession) and not value._uid and not value.jsonp_requests + and value._creation_time + (60*5) < time.time() # FIXME do not use a fixed value ): - _logger.info('remove session %s: %r', key, value.jsonp_requests) + _logger.debug('remove session %s', key) del request.session[key] with session_lock: diff --git a/addons/web/common/openerplib/main.py b/addons/web/common/openerplib/main.py index 2cbf9692063..93c2d1da69d 100644 --- a/addons/web/common/openerplib/main.py +++ b/addons/web/common/openerplib/main.py @@ -50,15 +50,6 @@ class Connector(object): __logger = _getChildLogger(_logger, 'connector') - def __init__(self, hostname, port): - """ - Initilize by specifying an hostname and a port. - :param hostname: Host name of the server. - :param port: Port for the connection to the server. - """ - self.hostname = hostname - self.port = port - def get_service(self, service_name): """ Returns a Service instance to allow easy manipulation of one of the services offered by the remote server. @@ -81,8 +72,7 @@ class XmlRPCConnector(Connector): :param hostname: The hostname of the computer holding the instance of OpenERP. :param port: The port used by the OpenERP instance for XMLRPC (default to 8069). """ - Connector.__init__(self, hostname, port) - self.url = 'http://%s:%d/xmlrpc' % (self.hostname, self.port) + self.url = 'http://%s:%d/xmlrpc' % (hostname, port) def send(self, service_name, method, *args): url = '%s/%s' % (self.url, service_name) @@ -97,9 +87,9 @@ class XmlRPCSConnector(XmlRPCConnector): __logger = _getChildLogger(_logger, 'connector.xmlrpcs') - def __init__(self, hostname, port=8071): + def __init__(self, hostname, port=8069): super(XmlRPCSConnector, self).__init__(hostname, port) - self.url = 'https://%s:%d/xmlrpc' % (self.hostname, self.port) + self.url = 'https://%s:%d/xmlrpc' % (hostname, port) class Service(object): """ @@ -294,7 +284,7 @@ def get_connector(hostname=None, protocol="xmlrpc", port="auto"): :param port: The number of the port. Defaults to auto. """ if port == 'auto': - port = 8069 if protocol=="xmlrpc" else 8071 + port = 8069 if protocol == "xmlrpc": return XmlRPCConnector(hostname, port) elif protocol == "xmlrpcs": diff --git a/addons/web/common/release.py b/addons/web/common/release.py index 47570c032bb..fdc30ee33d7 100644 --- a/addons/web/common/release.py +++ b/addons/web/common/release.py @@ -1,5 +1,5 @@ name = 'openerp-web' -version = '6.1.0 alpha' +version = '6.1rc1' description = "Web Client of OpenERP, the Enterprise Management Software" long_description = "OpenERP Web is the web client of the OpenERP, a free enterprise management software" author = "OpenERP SA" diff --git a/addons/web/common/session.py b/addons/web/common/session.py index ac0489b2ff3..ca23a08da4a 100644 --- a/addons/web/common/session.py +++ b/addons/web/common/session.py @@ -29,6 +29,7 @@ class OpenERPSession(object): round-tripped to the client browser. """ def __init__(self): + self._creation_time = time.time() self.config = None self._db = False self._uid = False diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index e8760eca203..3a23556794a 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -18,6 +18,10 @@ from cStringIO import StringIO import babel.messages.pofile import werkzeug.utils +try: + import xlwt +except ImportError: + xlwt = None from .. import common openerpweb = common.http @@ -33,6 +37,9 @@ def concat_xml(file_list): concat: concatenation of file content timestamp: max(os.path.getmtime of file_list) """ + if not file_list: + return '', None + root = None files_timestamp = 0 for fname in file_list: @@ -52,12 +59,15 @@ def concat_xml(file_list): return ElementTree.tostring(root, 'utf-8'), files_timestamp -def concat_files(file_list, reader=None): +def concat_files(file_list, reader=None, intersperse=""): """ Concatenate file content return (concat,timestamp) concat: concatenation of file content, read by `reader` timestamp: max(os.path.getmtime of file_list) """ + if not file_list: + return '', None + if reader is None: def reader(f): with open(f) as fp: @@ -71,7 +81,7 @@ def concat_files(file_list, reader=None): files_timestamp = ftime files_content.append(reader(fname)) - files_concat = "".join(files_content) + files_concat = intersperse.join(files_content) return files_concat,files_timestamp html_template = """ @@ -176,7 +186,7 @@ class WebClient(openerpweb.Controller): @openerpweb.httprequest def js(self, req, mods=None): files = [f[0] for f in self.manifest_glob(req, mods, 'js')] - content,timestamp = concat_files(files) + content, timestamp = concat_files(files, intersperse=';') # TODO use timestamp to set Last mofified date and E-tag return req.make_response(content, [('Content-Type', 'application/javascript')]) @@ -427,7 +437,7 @@ class Session(openerpweb.Controller): @openerpweb.jsonrequest def modules(self, req): # Compute available candidates module - loadable = openerpweb.addons_manifest.iterkeys() + loadable = openerpweb.addons_manifest loaded = req.config.server_wide_modules candidates = [mod for mod in loadable if mod not in loaded] @@ -1184,23 +1194,40 @@ class Binary(openerpweb.Controller): return open(os.path.join(addons_path, 'web', 'static', 'src', 'img', 'placeholder.png'), 'rb').read() @openerpweb.httprequest - def saveas(self, req, model, id, field, fieldname, **kw): + def saveas(self, req, model, field, id=None, filename_field=None, **kw): + """ Download link for files stored as binary fields. + + If the ``id`` parameter is omitted, fetches the default value for the + binary field (via ``default_get``), otherwise fetches the field for + that precise record. + + :param req: OpenERP request + :type req: :class:`web.common.http.HttpRequest` + :param str model: name of the model to fetch the binary from + :param str field: binary field + :param str id: id of the record from which to fetch the binary + :param str filename_field: field holding the file's name, if any + :returns: :class:`werkzeug.wrappers.Response` + """ Model = req.session.model(model) context = req.session.eval_context(req.context) + fields = [field] + if filename_field: + fields.append(filename_field) if id: - res = Model.read([int(id)], [field, fieldname], context)[0] + res = Model.read([int(id)], fields, context)[0] else: - res = Model.default_get([field, fieldname], context) + res = Model.default_get(fields, context) filecontent = base64.b64decode(res.get(field, '')) if not filecontent: return req.not_found() else: filename = '%s_%s' % (model.replace('.', '_'), id) - if fieldname: - filename = res.get(fieldname, '') or filename + if filename_field: + filename = res.get(filename_field, '') or filename return req.make_response(filecontent, [('Content-Type', 'application/octet-stream'), - ('Content-Disposition', 'attachment; filename=' + filename)]) + ('Content-Disposition', 'attachment; filename="%s"' % filename)]) @openerpweb.httprequest def upload(self, req, callback, ufile): @@ -1240,6 +1267,7 @@ class Binary(openerpweb.Controller): attachment_id = Model.create({ 'name': ufile.filename, 'datas': base64.encodestring(ufile.read()), + 'datas_fname': ufile.filename, 'res_model': model, 'res_id': int(id) }, context) @@ -1290,7 +1318,7 @@ class Export(View): for path, controller in openerpweb.controllers_path.iteritems() if path.startswith(self._cp_path) if hasattr(controller, 'fmt') - ], key=operator.itemgetter(1)) + ], key=operator.itemgetter("label")) def fields_get(self, req, model): Model = req.session.model(model) @@ -1466,7 +1494,7 @@ class Export(View): class CSVExport(Export): _cp_path = '/web/export/csv' - fmt = ('csv', 'CSV') + fmt = {'tag': 'csv', 'label': 'CSV'} @property def content_type(self): @@ -1501,7 +1529,11 @@ class CSVExport(Export): class ExcelExport(Export): _cp_path = '/web/export/xls' - fmt = ('xls', 'Excel') + fmt = { + 'tag': 'xls', + 'label': 'Excel', + 'error': None if xlwt else "XLWT required" + } @property def content_type(self): @@ -1511,8 +1543,6 @@ class ExcelExport(Export): return base + '.xls' def from_data(self, fields, rows): - import xlwt - workbook = xlwt.Workbook() worksheet = workbook.add_sheet('Sheet 1') diff --git a/addons/web/po/ar.po b/addons/web/po/ar.po index dba4f6ffb8b..e52b58ca375 100644 --- a/addons/web/po/ar.po +++ b/addons/web/po/ar.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2012-01-08 20:20+0000\n" +"PO-Revision-Date: 2012-01-13 21:31+0000\n" "Last-Translator: kifcaliph \n" "Language-Team: Arabic \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-09 05:08+0000\n" -"X-Generator: Launchpad (build 14640)\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web/static/src/js/chrome.js:162 #: addons/web/static/src/js/chrome.js:175 @@ -727,11 +727,11 @@ msgstr "خيار:" #: addons/web/static/src/xml/base.xml:0 msgid "[" -msgstr "]" +msgstr "[" #: addons/web/static/src/xml/base.xml:0 msgid "]" -msgstr "[" +msgstr "]" #: addons/web/static/src/xml/base.xml:0 msgid "-" diff --git a/addons/web/po/de.po b/addons/web/po/de.po index 18f69022ef8..bfbb97fa7dc 100644 --- a/addons/web/po/de.po +++ b/addons/web/po/de.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2011-12-26 13:55+0000\n" +"PO-Revision-Date: 2012-01-12 17:29+0000\n" "Last-Translator: Ferdinand @ Camptocamp \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-13 05:01+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web/static/src/js/chrome.js:162 #: addons/web/static/src/js/chrome.js:175 @@ -666,7 +666,7 @@ msgstr "/" #: addons/web/static/src/xml/base.xml:0 msgid "Duplicate" -msgstr "Kopieren" +msgstr "Duplizieren" #: addons/web/static/src/xml/base.xml:0 msgid "Unhandled widget" diff --git a/addons/web/po/pt_BR.po b/addons/web/po/pt_BR.po index 5246b219971..4be0c66826c 100644 --- a/addons/web/po/pt_BR.po +++ b/addons/web/po/pt_BR.po @@ -8,14 +8,15 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2011-11-12 18:57+0000\n" -"Last-Translator: Cristiano Gavião \n" +"PO-Revision-Date: 2012-01-15 02:47+0000\n" +"Last-Translator: Renato Lima - http://www.akretion.com " +"\n" "Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-16 05:27+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web/static/src/js/chrome.js:162 #: addons/web/static/src/js/chrome.js:175 @@ -28,15 +29,15 @@ msgstr "Ok" #: addons/web/static/src/js/chrome.js:668 msgid "About" -msgstr "" +msgstr "Sobre" #: addons/web/static/src/js/chrome.js:748 msgid "Preferences" -msgstr "" +msgstr "Preferências" #: addons/web/static/src/js/chrome.js:752 msgid "Change password" -msgstr "" +msgstr "Alterar Senha" #: addons/web/static/src/js/chrome.js:753 #: addons/web/static/src/js/search.js:235 @@ -53,15 +54,15 @@ msgstr "Cancelar" #: addons/web/static/src/js/view_editor.js:75 #: addons/web/static/src/js/views.js:871 addons/web/static/src/xml/base.xml:0 msgid "Save" -msgstr "" +msgstr "Salvar" #: addons/web/static/src/js/chrome.js:774 addons/web/static/src/xml/base.xml:0 msgid "Change Password" -msgstr "" +msgstr "Alterar Senha" #: addons/web/static/src/js/data_export.js:6 msgid "Export Data" -msgstr "" +msgstr "Exportar Dados" #: addons/web/static/src/js/data_export.js:23 #: addons/web/static/src/js/data_import.js:73 @@ -74,36 +75,36 @@ msgstr "Fechar" #: addons/web/static/src/js/data_export.js:24 msgid "Export To File" -msgstr "" +msgstr "Exportar para Arquivo" #: addons/web/static/src/js/data_import.js:34 msgid "Import Data" -msgstr "" +msgstr "Importar Dados" #: addons/web/static/src/js/data_import.js:74 msgid "Import File" -msgstr "" +msgstr "Importar Arquivo" #: addons/web/static/src/js/data_import.js:109 msgid "External ID" -msgstr "" +msgstr "ID Externo" #: addons/web/static/src/js/search.js:233 msgid "Filter Entry" -msgstr "" +msgstr "Filtrar Entrada" #: addons/web/static/src/js/search.js:238 #: addons/web/static/src/js/search.js:279 msgid "OK" -msgstr "" +msgstr "OK" #: addons/web/static/src/js/search.js:274 addons/web/static/src/xml/base.xml:0 msgid "Add to Dashboard" -msgstr "" +msgstr "Adicionar ao Dashboard" #: addons/web/static/src/js/search.js:403 msgid "Invalid Search" -msgstr "" +msgstr "Pesquisa Inválida" #: addons/web/static/src/js/search.js:403 msgid "triggered from search view" @@ -112,31 +113,31 @@ msgstr "" #: addons/web/static/src/js/search.js:490 #, python-format msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s" -msgstr "" +msgstr "Valor incorreto para campo %(fieldname)s: [%(value)s] é %(message)s" #: addons/web/static/src/js/search.js:822 msgid "not a valid integer" -msgstr "" +msgstr "Não é um número inteiro" #: addons/web/static/src/js/search.js:836 msgid "not a valid number" -msgstr "" +msgstr "Não é um número válido" #: addons/web/static/src/js/search.js:898 msgid "Yes" -msgstr "" +msgstr "Sim" #: addons/web/static/src/js/search.js:899 msgid "No" -msgstr "" +msgstr "Não" #: addons/web/static/src/js/search.js:1252 msgid "contains" -msgstr "" +msgstr "Contém" #: addons/web/static/src/js/search.js:1253 msgid "doesn't contain" -msgstr "" +msgstr "Não contém" #: addons/web/static/src/js/search.js:1254 #: addons/web/static/src/js/search.js:1269 @@ -144,7 +145,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1309 #: addons/web/static/src/js/search.js:1331 msgid "is equal to" -msgstr "" +msgstr "É igual a" #: addons/web/static/src/js/search.js:1255 #: addons/web/static/src/js/search.js:1270 @@ -152,7 +153,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1310 #: addons/web/static/src/js/search.js:1332 msgid "is not equal to" -msgstr "" +msgstr "É diferente de" #: addons/web/static/src/js/search.js:1256 #: addons/web/static/src/js/search.js:1271 @@ -160,7 +161,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1311 #: addons/web/static/src/js/search.js:1333 msgid "greater than" -msgstr "" +msgstr "Maior que" #: addons/web/static/src/js/search.js:1257 #: addons/web/static/src/js/search.js:1272 @@ -168,7 +169,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1312 #: addons/web/static/src/js/search.js:1334 msgid "less than" -msgstr "" +msgstr "Menor que" #: addons/web/static/src/js/search.js:1258 #: addons/web/static/src/js/search.js:1273 @@ -176,7 +177,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1313 #: addons/web/static/src/js/search.js:1335 msgid "greater or equal than" -msgstr "" +msgstr "Maior ou igual que" #: addons/web/static/src/js/search.js:1259 #: addons/web/static/src/js/search.js:1274 @@ -184,28 +185,28 @@ msgstr "" #: addons/web/static/src/js/search.js:1314 #: addons/web/static/src/js/search.js:1336 msgid "less or equal than" -msgstr "" +msgstr "Menor ou igual que" #: addons/web/static/src/js/search.js:1325 #: addons/web/static/src/js/search.js:1350 msgid "is" -msgstr "" +msgstr "É" #: addons/web/static/src/js/search.js:1351 msgid "is not" -msgstr "" +msgstr "Não é" #: addons/web/static/src/js/search.js:1364 msgid "is true" -msgstr "" +msgstr "Verdadeiro" #: addons/web/static/src/js/search.js:1365 msgid "is false" -msgstr "" +msgstr "Falso" #: addons/web/static/src/js/view_editor.js:42 msgid "ViewEditor" -msgstr "" +msgstr "Editor de Visão" #: addons/web/static/src/js/view_editor.js:46 #: addons/web/static/src/js/view_list.js:17 @@ -216,7 +217,7 @@ msgstr "Criar" #: addons/web/static/src/js/view_editor.js:47 #: addons/web/static/src/xml/base.xml:0 msgid "Edit" -msgstr "" +msgstr "Editar" #: addons/web/static/src/js/view_editor.js:48 #: addons/web/static/src/xml/base.xml:0 @@ -226,38 +227,38 @@ msgstr "Remover" #: addons/web/static/src/js/view_editor.js:71 #, python-format msgid "Create a view (%s)" -msgstr "" +msgstr "Criar a visão (%s)" #: addons/web/static/src/js/view_editor.js:170 msgid "Do you really want to remove this view?" -msgstr "" +msgstr "Deseja remover essa visão?" #: addons/web/static/src/js/view_editor.js:367 #, python-format msgid "View Editor %d - %s" -msgstr "" +msgstr "Editar Visão %d - %s" #: addons/web/static/src/js/view_editor.js:371 msgid "Preview" -msgstr "" +msgstr "Pré-visualizar" #: addons/web/static/src/js/view_editor.js:442 msgid "Do you really want to remove this node?" -msgstr "" +msgstr "Deseja remover esse nó?" #: addons/web/static/src/js/view_editor.js:756 #: addons/web/static/src/js/view_editor.js:883 msgid "Properties" -msgstr "" +msgstr "Propriedades" #: addons/web/static/src/js/view_editor.js:760 #: addons/web/static/src/js/view_editor.js:887 msgid "Update" -msgstr "" +msgstr "Atualizar" #: addons/web/static/src/js/view_form.js:17 msgid "Form" -msgstr "" +msgstr "Formulário" #: addons/web/static/src/js/view_form.js:401 msgid "" @@ -266,16 +267,16 @@ msgstr "Aviso, o registro foi modificado, suas alterações serão descartadas." #: addons/web/static/src/js/view_form.js:612 msgid "Attachments" -msgstr "" +msgstr "Anexos" #: addons/web/static/src/js/view_form.js:650 #, python-format msgid "Do you really want to delete the attachment %s?" -msgstr "" +msgstr "Deseja remover esse anexo %s?" #: addons/web/static/src/js/view_form.js:1075 msgid "Confirm" -msgstr "" +msgstr "Confirmar" #: addons/web/static/src/js/view_form.js:1838 msgid "   Search More..." @@ -284,11 +285,11 @@ msgstr "   Procurar Mais..." #: addons/web/static/src/js/view_form.js:1851 #, python-format msgid "   Create \"%s\"" -msgstr "" +msgstr "   Criar \"%s\"" #: addons/web/static/src/js/view_form.js:1857 msgid "   Create and Edit..." -msgstr "" +msgstr "   Criar e Editar..." #: addons/web/static/src/js/view_form.js:2404 #: addons/web/static/src/xml/base.xml:0 @@ -297,72 +298,72 @@ msgstr "Adicionar" #: addons/web/static/src/js/view_list.js:8 msgid "List" -msgstr "" +msgstr "Lista" #: addons/web/static/src/js/view_list.js:269 msgid "Unlimited" -msgstr "" +msgstr "Ilimitado" #: addons/web/static/src/js/view_list.js:516 msgid "Do you really want to remove these records?" -msgstr "" +msgstr "Deseja remover esse registro?" #: addons/web/static/src/js/view_list.js:1202 msgid "Undefined" -msgstr "" +msgstr "Indefinida" #: addons/web/static/src/js/view_page.js:8 msgid "Page" -msgstr "" +msgstr "Página" #: addons/web/static/src/js/view_page.js:52 msgid "Do you really want to delete this record?" -msgstr "" +msgstr "Deseja remover esse registro?" #: addons/web/static/src/js/view_page.js:227 msgid "Download" -msgstr "" +msgstr "Download" #: addons/web/static/src/js/view_tree.js:11 msgid "Tree" -msgstr "" +msgstr "Árvore" #: addons/web/static/src/js/views.js:590 msgid "Search: " -msgstr "" +msgstr "Pesquisar: " #: addons/web/static/src/js/views.js:710 msgid "Customize" -msgstr "" +msgstr "Customizar" #: addons/web/static/src/js/views.js:713 msgid "Manage Views" -msgstr "" +msgstr "Administrar Visões" #: addons/web/static/src/js/views.js:715 addons/web/static/src/js/views.js:719 #: addons/web/static/src/js/views.js:724 msgid "Manage views of the current object" -msgstr "" +msgstr "Adminsitrar visões do objeto atual" #: addons/web/static/src/js/views.js:717 msgid "Edit Workflow" -msgstr "" +msgstr "Editar Workflow" #: addons/web/static/src/js/views.js:722 msgid "Customize Object" -msgstr "" +msgstr "Customizar Objeto" #: addons/web/static/src/js/views.js:726 msgid "Translate" -msgstr "" +msgstr "Traduzir" #: addons/web/static/src/js/views.js:728 msgid "Technical translation" -msgstr "" +msgstr "Tradução Técnica" #: addons/web/static/src/js/views.js:733 msgid "Other Options" -msgstr "" +msgstr "Outras Opções" #: addons/web/static/src/js/views.js:736 addons/web/static/src/xml/base.xml:0 msgid "Import" @@ -374,55 +375,55 @@ msgstr "Exportar" #: addons/web/static/src/js/views.js:742 msgid "View Log" -msgstr "" +msgstr "Vizualizar Log" #: addons/web/static/src/js/views.js:751 msgid "Reports" -msgstr "" +msgstr "Relatórios" #: addons/web/static/src/js/views.js:751 msgid "Actions" -msgstr "" +msgstr "Ações" #: addons/web/static/src/js/views.js:751 msgid "Links" -msgstr "" +msgstr "Links" #: addons/web/static/src/js/views.js:831 msgid "You must choose at least one record." -msgstr "" +msgstr "Você deve escolher pelo menos um registro." #: addons/web/static/src/js/views.js:832 msgid "Warning" -msgstr "" +msgstr "Atenção" #: addons/web/static/src/js/views.js:866 msgid "Translations" -msgstr "" +msgstr "Traduções" #: addons/web/static/src/xml/base.xml:0 msgid "x" -msgstr "" +msgstr "x" #: addons/web/static/src/xml/base.xml:0 msgid "#{title}" -msgstr "" +msgstr "#{title}" #: addons/web/static/src/xml/base.xml:0 msgid "#{text}" -msgstr "" +msgstr "#{text}" #: addons/web/static/src/xml/base.xml:0 msgid "Powered by" -msgstr "" +msgstr "Desenvolvido Por" #: addons/web/static/src/xml/base.xml:0 msgid "openerp.com" -msgstr "" +msgstr "openerp.com" #: addons/web/static/src/xml/base.xml:0 msgid "." -msgstr "" +msgstr "." #: addons/web/static/src/xml/base.xml:0 msgid "Loading..." @@ -450,15 +451,15 @@ msgstr "Voltar ao Login" #: addons/web/static/src/xml/base.xml:0 msgid "CREATE DATABASE" -msgstr "" +msgstr "CRIAR BANCO DE DADOS" #: addons/web/static/src/xml/base.xml:0 msgid "Master password:" -msgstr "Senha mestre" +msgstr "Senha Super Admin:" #: addons/web/static/src/xml/base.xml:0 msgid "New database name:" -msgstr "Nome da nova base de dados:" +msgstr "Nome do Novo banco de dados:" #: addons/web/static/src/xml/base.xml:0 msgid "Load Demonstration data:" @@ -470,31 +471,31 @@ msgstr "Idioma padrão:" #: addons/web/static/src/xml/base.xml:0 msgid "Admin password:" -msgstr "Senha de Administrador" +msgstr "Senha do Administrador" #: addons/web/static/src/xml/base.xml:0 msgid "Confirm password:" -msgstr "Confirme a senha:" +msgstr "Confirmar Senha:" #: addons/web/static/src/xml/base.xml:0 msgid "DROP DATABASE" -msgstr "" +msgstr "EXCLUIR BANCO DE DADOS" #: addons/web/static/src/xml/base.xml:0 msgid "Database:" -msgstr "Base de dados:" +msgstr "Banco de Dados:" #: addons/web/static/src/xml/base.xml:0 msgid "Master Password:" -msgstr "Senha Mestre" +msgstr "Senha do Super Admin" #: addons/web/static/src/xml/base.xml:0 msgid "BACKUP DATABASE" -msgstr "" +msgstr "BACKUP" #: addons/web/static/src/xml/base.xml:0 msgid "RESTORE DATABASE" -msgstr "" +msgstr "RESTAURAR BANCO DE DADOS" #: addons/web/static/src/xml/base.xml:0 msgid "File:" @@ -502,15 +503,15 @@ msgstr "Arquivo:" #: addons/web/static/src/xml/base.xml:0 msgid "CHANGE MASTER PASSWORD" -msgstr "" +msgstr "ALTERAR SENHA DO SUPER ADMIN" #: addons/web/static/src/xml/base.xml:0 msgid "New master password:" -msgstr "Nova senha mestre:" +msgstr "Nova Senha do Super Admin:" #: addons/web/static/src/xml/base.xml:0 msgid "Confirm new master password:" -msgstr "Confirme nova senha mestre" +msgstr "Confirme a Senha do Super Admin:" #: addons/web/static/src/xml/base.xml:0 msgid "User:" @@ -522,7 +523,7 @@ msgstr "Senha:" #: addons/web/static/src/xml/base.xml:0 msgid "Database" -msgstr "Base de dados" +msgstr "Bando de Dados" #: addons/web/static/src/xml/base.xml:0 msgid "Login" @@ -542,11 +543,11 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "OpenERP's vision to be:" -msgstr "OpenERP vislumbra ser:" +msgstr "Visão do OpenERP" #: addons/web/static/src/xml/base.xml:0 msgid "Full featured" -msgstr "" +msgstr "Todos os recursos" #: addons/web/static/src/xml/base.xml:0 msgid "" @@ -576,14 +577,16 @@ msgstr "Uso Amigável" msgid "" "In order to be productive, people need clean and easy to use interface." msgstr "" +"Para serem produtivas, as pessoas precisam de uma interface limpa e fácil de " +"usar." #: addons/web/static/src/xml/base.xml:0 msgid "(" -msgstr "" +msgstr "(" #: addons/web/static/src/xml/base.xml:0 msgid ")" -msgstr "" +msgstr ")" #: addons/web/static/src/xml/base.xml:0 msgid "LOGOUT" @@ -591,35 +594,35 @@ msgstr "DESCONECTAR" #: addons/web/static/src/xml/base.xml:0 msgid "«" -msgstr "" +msgstr "«" #: addons/web/static/src/xml/base.xml:0 msgid "»" -msgstr "" +msgstr "»" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_menu_item" -msgstr "" +msgstr "oe_secondary_menu_item" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_submenu_item" -msgstr "" +msgstr "oe_secondary_submenu_item" #: addons/web/static/src/xml/base.xml:0 msgid "Hide this tip" -msgstr "Esconder dica" +msgstr "Desativar esta dica" #: addons/web/static/src/xml/base.xml:0 msgid "Disable all tips" -msgstr "Desligar todas as dicas" +msgstr "Desativar todas as dicas" #: addons/web/static/src/xml/base.xml:0 msgid "More…" -msgstr "" +msgstr "Mais..." #: addons/web/static/src/xml/base.xml:0 msgid "Debug View#" -msgstr "" +msgstr "Visão de Depuração#" #: addons/web/static/src/xml/base.xml:0 msgid "- Fields View Get" @@ -627,27 +630,27 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "- Edit" -msgstr "" +msgstr "Editar" #: addons/web/static/src/xml/base.xml:0 msgid "View" -msgstr "" +msgstr "Visão" #: addons/web/static/src/xml/base.xml:0 msgid "- Edit SearchView" -msgstr "" +msgstr "- Editar Visão de Busca" #: addons/web/static/src/xml/base.xml:0 msgid "- Edit Action" -msgstr "" +msgstr "- Editar Ação" #: addons/web/static/src/xml/base.xml:0 msgid "Field" -msgstr "" +msgstr "Campo" #: addons/web/static/src/xml/base.xml:0 msgid ":" -msgstr "" +msgstr ":" #: addons/web/static/src/xml/base.xml:0 msgid "Delete" @@ -655,11 +658,11 @@ msgstr "Excluir" #: addons/web/static/src/xml/base.xml:0 msgid "0" -msgstr "" +msgstr "0" #: addons/web/static/src/xml/base.xml:0 msgid "/" -msgstr "" +msgstr "/" #: addons/web/static/src/xml/base.xml:0 msgid "Duplicate" @@ -675,75 +678,75 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "\"" -msgstr "" +msgstr "\"" #: addons/web/static/src/xml/base.xml:0 msgid "Modifiers:" -msgstr "" +msgstr "Modificadores:" #: addons/web/static/src/xml/base.xml:0 msgid "?" -msgstr "" +msgstr "?" #: addons/web/static/src/xml/base.xml:0 msgid "(nolabel)" -msgstr "" +msgstr "(nolabel)" #: addons/web/static/src/xml/base.xml:0 msgid "Field:" -msgstr "" +msgstr "Campo:" #: addons/web/static/src/xml/base.xml:0 msgid "Object:" -msgstr "" +msgstr "Objeto:" #: addons/web/static/src/xml/base.xml:0 msgid "Type:" -msgstr "" +msgstr "Tipo:" #: addons/web/static/src/xml/base.xml:0 msgid "Widget:" -msgstr "" +msgstr "Componente:" #: addons/web/static/src/xml/base.xml:0 msgid "Size:" -msgstr "" +msgstr "Tamanho:" #: addons/web/static/src/xml/base.xml:0 msgid "Context:" -msgstr "" +msgstr "Contexto:" #: addons/web/static/src/xml/base.xml:0 msgid "Domain:" -msgstr "" +msgstr "Domínio:" #: addons/web/static/src/xml/base.xml:0 msgid "On change:" -msgstr "" +msgstr "Ao alterar:" #: addons/web/static/src/xml/base.xml:0 msgid "Relation:" -msgstr "" +msgstr "Relação:" #: addons/web/static/src/xml/base.xml:0 msgid "Selection:" -msgstr "" +msgstr "Seleção:" #: addons/web/static/src/xml/base.xml:0 msgid "[" -msgstr "" +msgstr "[" #: addons/web/static/src/xml/base.xml:0 msgid "]" -msgstr "" +msgstr "]" #: addons/web/static/src/xml/base.xml:0 msgid "-" -msgstr "" +msgstr "-" #: addons/web/static/src/xml/base.xml:0 msgid "#" -msgstr "" +msgstr "#" #: addons/web/static/src/xml/base.xml:0 msgid "Open..." @@ -763,7 +766,7 @@ msgstr "..." #: addons/web/static/src/xml/base.xml:0 msgid "Uploading ..." -msgstr "Transferindo ..." +msgstr "Tranferindo..." #: addons/web/static/src/xml/base.xml:0 msgid "Select" @@ -771,7 +774,7 @@ msgstr "Selecionar" #: addons/web/static/src/xml/base.xml:0 msgid "Save As" -msgstr "Salvar como" +msgstr "Salvar Como" #: addons/web/static/src/xml/base.xml:0 msgid "Clear" @@ -779,7 +782,7 @@ msgstr "Limpar" #: addons/web/static/src/xml/base.xml:0 msgid "Button" -msgstr "" +msgstr "Botão" #: addons/web/static/src/xml/base.xml:0 msgid "(no string)" @@ -787,23 +790,23 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "Special:" -msgstr "" +msgstr "Especial:" #: addons/web/static/src/xml/base.xml:0 msgid "Button Type:" -msgstr "" +msgstr "Tipo do Botão:" #: addons/web/static/src/xml/base.xml:0 msgid "Method:" -msgstr "" +msgstr "Método:" #: addons/web/static/src/xml/base.xml:0 msgid "Action ID:" -msgstr "" +msgstr "ID da Ação:" #: addons/web/static/src/xml/base.xml:0 msgid "Search" -msgstr "" +msgstr "Pesquisar" #: addons/web/static/src/xml/base.xml:0 msgid "Advanced Filter" @@ -811,7 +814,7 @@ msgstr "Filtro Avançado" #: addons/web/static/src/xml/base.xml:0 msgid "Save Filter" -msgstr "Salvar filtro" +msgstr "Salvar Filtro" #: addons/web/static/src/xml/base.xml:0 msgid "Manage Filters" @@ -827,15 +830,15 @@ msgstr "(Qualquer filtro existente com o mesmo nome será substituído)" #: addons/web/static/src/xml/base.xml:0 msgid "Select Dashboard to add this filter to:" -msgstr "" +msgstr "Selecione o Dashboard para adicionar esse filtro para:" #: addons/web/static/src/xml/base.xml:0 msgid "Title of new Dashboard item:" -msgstr "" +msgstr "Título do novo Dashboard:" #: addons/web/static/src/xml/base.xml:0 msgid "Advanced Filters" -msgstr "" +msgstr "Filtros Avançados" #: addons/web/static/src/xml/base.xml:0 msgid "Any of the following conditions must match" @@ -919,19 +922,19 @@ msgstr "Salvar como:" #: addons/web/static/src/xml/base.xml:0 msgid "Saved exports:" -msgstr "" +msgstr "Exportações salvas" #: addons/web/static/src/xml/base.xml:0 msgid "Old Password:" -msgstr "Senha antiga" +msgstr "Senha Anterior" #: addons/web/static/src/xml/base.xml:0 msgid "New Password:" -msgstr "Nova Senha:" +msgstr "Nova Senha" #: addons/web/static/src/xml/base.xml:0 msgid "Confirm Password:" -msgstr "" +msgstr "Confirmar Senha:" #: addons/web/static/src/xml/base.xml:0 msgid "1. Import a .CSV file" @@ -945,7 +948,7 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "CSV File:" -msgstr "Arquivo CSV." +msgstr "Arquivo CSV:" #: addons/web/static/src/xml/base.xml:0 msgid "2. Check your file format" @@ -953,11 +956,11 @@ msgstr "Verifique seu formato de arquivo" #: addons/web/static/src/xml/base.xml:0 msgid "Import Options" -msgstr "" +msgstr "Opções de importação" #: addons/web/static/src/xml/base.xml:0 msgid "Does your file have titles?" -msgstr "" +msgstr "O seu arquivo tem títulos?" #: addons/web/static/src/xml/base.xml:0 msgid "Separator:" @@ -985,11 +988,11 @@ msgstr "Linhas para ignorar" #: addons/web/static/src/xml/base.xml:0 msgid "The import failed due to:" -msgstr "" +msgstr "A importação falhou devido a:" #: addons/web/static/src/xml/base.xml:0 msgid "Here is a preview of the file we could not import:" -msgstr "" +msgstr "Aqui está uma visualização do arquivo que não pode ser importado:" #: addons/web/static/src/xml/base.xml:0 msgid "OpenERP Web" @@ -1001,7 +1004,7 @@ msgstr "Versão" #: addons/web/static/src/xml/base.xml:0 msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved." -msgstr "" +msgstr "Copyright © 2011-TODAY OpenERP SA. Todos Direitos Reservados." #: addons/web/static/src/xml/base.xml:0 msgid "OpenERP is a trademark of the" @@ -1009,7 +1012,7 @@ msgstr "OpenERP é uma marca de" #: addons/web/static/src/xml/base.xml:0 msgid "OpenERP SA Company" -msgstr "" +msgstr "Empresa OpenERP SA" #: addons/web/static/src/xml/base.xml:0 msgid "Licenced under the terms of" @@ -1017,7 +1020,7 @@ msgstr "Licenciado sobre os termos de" #: addons/web/static/src/xml/base.xml:0 msgid "GNU Affero General Public License" -msgstr "" +msgstr "Licença Pública Geral GNU Affero" #: addons/web/static/src/xml/base.xml:0 msgid "About OpenERP" @@ -1054,3 +1057,5 @@ msgid "" "Depending on your needs, OpenERP is available through a web or application " "client." msgstr "" +"Dependendo de suas necessidades, OpenERP está disponível através da web ou " +"de uma aplicação cliente." diff --git a/addons/web/po/ru.po b/addons/web/po/ru.po index beecb0203c1..f218d259876 100644 --- a/addons/web/po/ru.po +++ b/addons/web/po/ru.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2011-12-06 08:05+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2012-01-13 12:50+0000\n" +"Last-Translator: Aleksei Motsik \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web/static/src/js/chrome.js:162 #: addons/web/static/src/js/chrome.js:175 @@ -24,19 +24,19 @@ msgstr "" #: addons/web/static/src/js/view_form.js:1078 #: addons/web/static/src/xml/base.xml:0 msgid "Ok" -msgstr "" +msgstr "Ок" #: addons/web/static/src/js/chrome.js:668 msgid "About" -msgstr "" +msgstr "О программе" #: addons/web/static/src/js/chrome.js:748 msgid "Preferences" -msgstr "" +msgstr "Настройки" #: addons/web/static/src/js/chrome.js:752 msgid "Change password" -msgstr "" +msgstr "Изменить пароль" #: addons/web/static/src/js/chrome.js:753 #: addons/web/static/src/js/search.js:235 @@ -47,21 +47,21 @@ msgstr "" #: addons/web/static/src/js/view_form.js:1085 #: addons/web/static/src/xml/base.xml:0 msgid "Cancel" -msgstr "" +msgstr "Отмена" #: addons/web/static/src/js/chrome.js:754 #: addons/web/static/src/js/view_editor.js:75 #: addons/web/static/src/js/views.js:871 addons/web/static/src/xml/base.xml:0 msgid "Save" -msgstr "" +msgstr "Сохранить" #: addons/web/static/src/js/chrome.js:774 addons/web/static/src/xml/base.xml:0 msgid "Change Password" -msgstr "" +msgstr "Изменить пароль" #: addons/web/static/src/js/data_export.js:6 msgid "Export Data" -msgstr "" +msgstr "Экспорт данных" #: addons/web/static/src/js/data_export.js:23 #: addons/web/static/src/js/data_import.js:73 @@ -70,40 +70,40 @@ msgstr "" #: addons/web/static/src/js/view_form.js:2775 #: addons/web/static/src/js/views.js:872 msgid "Close" -msgstr "" +msgstr "Закрыть" #: addons/web/static/src/js/data_export.js:24 msgid "Export To File" -msgstr "" +msgstr "Экспортировать в файл" #: addons/web/static/src/js/data_import.js:34 msgid "Import Data" -msgstr "" +msgstr "Импорт данных" #: addons/web/static/src/js/data_import.js:74 msgid "Import File" -msgstr "" +msgstr "Импортировать файл" #: addons/web/static/src/js/data_import.js:109 msgid "External ID" -msgstr "" +msgstr "Внешний идентификатор" #: addons/web/static/src/js/search.js:233 msgid "Filter Entry" -msgstr "" +msgstr "Входящий фильтр" #: addons/web/static/src/js/search.js:238 #: addons/web/static/src/js/search.js:279 msgid "OK" -msgstr "" +msgstr "OK" #: addons/web/static/src/js/search.js:274 addons/web/static/src/xml/base.xml:0 msgid "Add to Dashboard" -msgstr "" +msgstr "Добавить на Панель" #: addons/web/static/src/js/search.js:403 msgid "Invalid Search" -msgstr "" +msgstr "Ошибка поиска" #: addons/web/static/src/js/search.js:403 msgid "triggered from search view" @@ -113,30 +113,31 @@ msgstr "" #, python-format msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s" msgstr "" +"Некорректное значение для поля %(fieldname)s: [%(value)s] в %(message)s" #: addons/web/static/src/js/search.js:822 msgid "not a valid integer" -msgstr "" +msgstr "не является целым числом" #: addons/web/static/src/js/search.js:836 msgid "not a valid number" -msgstr "" +msgstr "не является числом" #: addons/web/static/src/js/search.js:898 msgid "Yes" -msgstr "" +msgstr "Да" #: addons/web/static/src/js/search.js:899 msgid "No" -msgstr "" +msgstr "Нет" #: addons/web/static/src/js/search.js:1252 msgid "contains" -msgstr "" +msgstr "содержит" #: addons/web/static/src/js/search.js:1253 msgid "doesn't contain" -msgstr "" +msgstr "не содержит" #: addons/web/static/src/js/search.js:1254 #: addons/web/static/src/js/search.js:1269 @@ -144,7 +145,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1309 #: addons/web/static/src/js/search.js:1331 msgid "is equal to" -msgstr "" +msgstr "соответствует" #: addons/web/static/src/js/search.js:1255 #: addons/web/static/src/js/search.js:1270 @@ -152,7 +153,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1310 #: addons/web/static/src/js/search.js:1332 msgid "is not equal to" -msgstr "" +msgstr "не соответствует" #: addons/web/static/src/js/search.js:1256 #: addons/web/static/src/js/search.js:1271 @@ -160,7 +161,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1311 #: addons/web/static/src/js/search.js:1333 msgid "greater than" -msgstr "" +msgstr "больше чем" #: addons/web/static/src/js/search.js:1257 #: addons/web/static/src/js/search.js:1272 @@ -168,7 +169,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1312 #: addons/web/static/src/js/search.js:1334 msgid "less than" -msgstr "" +msgstr "меньше чем" #: addons/web/static/src/js/search.js:1258 #: addons/web/static/src/js/search.js:1273 @@ -176,7 +177,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1313 #: addons/web/static/src/js/search.js:1335 msgid "greater or equal than" -msgstr "" +msgstr "больше или равен" #: addons/web/static/src/js/search.js:1259 #: addons/web/static/src/js/search.js:1274 @@ -184,432 +185,437 @@ msgstr "" #: addons/web/static/src/js/search.js:1314 #: addons/web/static/src/js/search.js:1336 msgid "less or equal than" -msgstr "" +msgstr "меньше или равен" #: addons/web/static/src/js/search.js:1325 #: addons/web/static/src/js/search.js:1350 msgid "is" -msgstr "" +msgstr "-" #: addons/web/static/src/js/search.js:1351 msgid "is not" -msgstr "" +msgstr "не" #: addons/web/static/src/js/search.js:1364 msgid "is true" -msgstr "" +msgstr "истинно" #: addons/web/static/src/js/search.js:1365 msgid "is false" -msgstr "" +msgstr "ложно" #: addons/web/static/src/js/view_editor.js:42 msgid "ViewEditor" -msgstr "" +msgstr "Редактор Видов" #: addons/web/static/src/js/view_editor.js:46 #: addons/web/static/src/js/view_list.js:17 #: addons/web/static/src/xml/base.xml:0 msgid "Create" -msgstr "" +msgstr "Создать" #: addons/web/static/src/js/view_editor.js:47 #: addons/web/static/src/xml/base.xml:0 msgid "Edit" -msgstr "" +msgstr "Изменить" #: addons/web/static/src/js/view_editor.js:48 #: addons/web/static/src/xml/base.xml:0 msgid "Remove" -msgstr "" +msgstr "Удалить" #: addons/web/static/src/js/view_editor.js:71 #, python-format msgid "Create a view (%s)" -msgstr "" +msgstr "Создать вид (%s)" #: addons/web/static/src/js/view_editor.js:170 msgid "Do you really want to remove this view?" -msgstr "" +msgstr "Вы действительно хотите удалить этот Вид?" #: addons/web/static/src/js/view_editor.js:367 #, python-format msgid "View Editor %d - %s" -msgstr "" +msgstr "Редактор Вида %d - %s" #: addons/web/static/src/js/view_editor.js:371 msgid "Preview" -msgstr "" +msgstr "Предпросмотр" #: addons/web/static/src/js/view_editor.js:442 msgid "Do you really want to remove this node?" -msgstr "" +msgstr "Вы действительно хотите удалить этот Узел?" #: addons/web/static/src/js/view_editor.js:756 #: addons/web/static/src/js/view_editor.js:883 msgid "Properties" -msgstr "" +msgstr "Свойства" #: addons/web/static/src/js/view_editor.js:760 #: addons/web/static/src/js/view_editor.js:887 msgid "Update" -msgstr "" +msgstr "Обновить" #: addons/web/static/src/js/view_form.js:17 msgid "Form" -msgstr "" +msgstr "Форма" #: addons/web/static/src/js/view_form.js:401 msgid "" "Warning, the record has been modified, your changes will be discarded." -msgstr "" +msgstr "Внимание. Эта запись была изменена. Ваши изменения будут потеряны." #: addons/web/static/src/js/view_form.js:612 msgid "Attachments" -msgstr "" +msgstr "Вложения" #: addons/web/static/src/js/view_form.js:650 #, python-format msgid "Do you really want to delete the attachment %s?" -msgstr "" +msgstr "Вы действительно хотите удалить вложение %s?" #: addons/web/static/src/js/view_form.js:1075 msgid "Confirm" -msgstr "" +msgstr "Подтвердить" #: addons/web/static/src/js/view_form.js:1838 msgid "   Search More..." -msgstr "" +msgstr "   Найти еще..." #: addons/web/static/src/js/view_form.js:1851 #, python-format msgid "   Create \"%s\"" -msgstr "" +msgstr "   Создать \"%s\"" #: addons/web/static/src/js/view_form.js:1857 msgid "   Create and Edit..." -msgstr "" +msgstr "   Создать и Изменить..." #: addons/web/static/src/js/view_form.js:2404 #: addons/web/static/src/xml/base.xml:0 msgid "Add" -msgstr "" +msgstr "Добавить" #: addons/web/static/src/js/view_list.js:8 msgid "List" -msgstr "" +msgstr "Список" #: addons/web/static/src/js/view_list.js:269 msgid "Unlimited" -msgstr "" +msgstr "Неограниченно" #: addons/web/static/src/js/view_list.js:516 msgid "Do you really want to remove these records?" -msgstr "" +msgstr "Вы действительно хотите удалить эту Запись?" #: addons/web/static/src/js/view_list.js:1202 msgid "Undefined" -msgstr "" +msgstr "Не определено" #: addons/web/static/src/js/view_page.js:8 msgid "Page" -msgstr "" +msgstr "Страница" #: addons/web/static/src/js/view_page.js:52 msgid "Do you really want to delete this record?" -msgstr "" +msgstr "Вы действительно хотите удалить эту Запись?" #: addons/web/static/src/js/view_page.js:227 msgid "Download" -msgstr "" +msgstr "Загрузить" #: addons/web/static/src/js/view_tree.js:11 msgid "Tree" -msgstr "" +msgstr "Дерево" #: addons/web/static/src/js/views.js:590 msgid "Search: " -msgstr "" +msgstr "Найти: " #: addons/web/static/src/js/views.js:710 msgid "Customize" -msgstr "" +msgstr "Настроить" #: addons/web/static/src/js/views.js:713 msgid "Manage Views" -msgstr "" +msgstr "Управление Видами" #: addons/web/static/src/js/views.js:715 addons/web/static/src/js/views.js:719 #: addons/web/static/src/js/views.js:724 msgid "Manage views of the current object" -msgstr "" +msgstr "Управление Видами текущего объекта" #: addons/web/static/src/js/views.js:717 msgid "Edit Workflow" -msgstr "" +msgstr "Редактировать Процесс" #: addons/web/static/src/js/views.js:722 msgid "Customize Object" -msgstr "" +msgstr "Настроить Объект" #: addons/web/static/src/js/views.js:726 msgid "Translate" -msgstr "" +msgstr "Перевести" #: addons/web/static/src/js/views.js:728 msgid "Technical translation" -msgstr "" +msgstr "Технический перевод" #: addons/web/static/src/js/views.js:733 msgid "Other Options" -msgstr "" +msgstr "Прочие Настройки" #: addons/web/static/src/js/views.js:736 addons/web/static/src/xml/base.xml:0 msgid "Import" -msgstr "" +msgstr "Импорт" #: addons/web/static/src/js/views.js:739 addons/web/static/src/xml/base.xml:0 msgid "Export" -msgstr "" +msgstr "Экспорт" #: addons/web/static/src/js/views.js:742 msgid "View Log" -msgstr "" +msgstr "Просмотреть журнал" #: addons/web/static/src/js/views.js:751 msgid "Reports" -msgstr "" +msgstr "Отчёты" #: addons/web/static/src/js/views.js:751 msgid "Actions" -msgstr "" +msgstr "Действия" #: addons/web/static/src/js/views.js:751 msgid "Links" -msgstr "" +msgstr "Связи" #: addons/web/static/src/js/views.js:831 msgid "You must choose at least one record." -msgstr "" +msgstr "Вы должны выбрать хотя-бы одну запись." #: addons/web/static/src/js/views.js:832 msgid "Warning" -msgstr "" +msgstr "Внимание" #: addons/web/static/src/js/views.js:866 msgid "Translations" -msgstr "" +msgstr "Переводы" #: addons/web/static/src/xml/base.xml:0 msgid "x" -msgstr "" +msgstr "x" #: addons/web/static/src/xml/base.xml:0 msgid "#{title}" -msgstr "" +msgstr "#{title}" #: addons/web/static/src/xml/base.xml:0 msgid "#{text}" -msgstr "" +msgstr "#{text}" #: addons/web/static/src/xml/base.xml:0 msgid "Powered by" -msgstr "" +msgstr "На базе" #: addons/web/static/src/xml/base.xml:0 msgid "openerp.com" -msgstr "" +msgstr "openerp.com" #: addons/web/static/src/xml/base.xml:0 msgid "." -msgstr "" +msgstr "." #: addons/web/static/src/xml/base.xml:0 msgid "Loading..." -msgstr "" +msgstr "Загрузка..." #: addons/web/static/src/xml/base.xml:0 msgid "Drop" -msgstr "" +msgstr "Удалить" #: addons/web/static/src/xml/base.xml:0 msgid "Backup" -msgstr "" +msgstr "Создать Резервную Копию" #: addons/web/static/src/xml/base.xml:0 msgid "Restore" -msgstr "" +msgstr "Востановить" #: addons/web/static/src/xml/base.xml:0 msgid "Password" -msgstr "" +msgstr "Пароль" #: addons/web/static/src/xml/base.xml:0 msgid "Back to Login" -msgstr "" +msgstr "Вернутся к Авторизации" #: addons/web/static/src/xml/base.xml:0 msgid "CREATE DATABASE" -msgstr "" +msgstr "СОЗДАТЬ БАЗУ ДАННЫХ" #: addons/web/static/src/xml/base.xml:0 msgid "Master password:" -msgstr "" +msgstr "Мастер пароль:" #: addons/web/static/src/xml/base.xml:0 msgid "New database name:" -msgstr "" +msgstr "Название новой базы данных:" #: addons/web/static/src/xml/base.xml:0 msgid "Load Demonstration data:" -msgstr "" +msgstr "Загрузить Демонстрационные данные:" #: addons/web/static/src/xml/base.xml:0 msgid "Default language:" -msgstr "" +msgstr "Язык по умолчанию:" #: addons/web/static/src/xml/base.xml:0 msgid "Admin password:" -msgstr "" +msgstr "Пароль Администратора:" #: addons/web/static/src/xml/base.xml:0 msgid "Confirm password:" -msgstr "" +msgstr "Подтверждение пароля:" #: addons/web/static/src/xml/base.xml:0 msgid "DROP DATABASE" -msgstr "" +msgstr "УДАЛИТЬ БАЗУ ДАННЫХ" #: addons/web/static/src/xml/base.xml:0 msgid "Database:" -msgstr "" +msgstr "База данных:" #: addons/web/static/src/xml/base.xml:0 msgid "Master Password:" -msgstr "" +msgstr "Мастер Пароль:" #: addons/web/static/src/xml/base.xml:0 msgid "BACKUP DATABASE" -msgstr "" +msgstr "РЕЗЕРВНАЯ КОПИЯ БД" #: addons/web/static/src/xml/base.xml:0 msgid "RESTORE DATABASE" -msgstr "" +msgstr "ВОССТАНОВИТЬ БД" #: addons/web/static/src/xml/base.xml:0 msgid "File:" -msgstr "" +msgstr "Файл:" #: addons/web/static/src/xml/base.xml:0 msgid "CHANGE MASTER PASSWORD" -msgstr "" +msgstr "ИЗМЕНИТЬ МАСТЕР ПАРОЛЬ" #: addons/web/static/src/xml/base.xml:0 msgid "New master password:" -msgstr "" +msgstr "Новый Мастер Пароль:" #: addons/web/static/src/xml/base.xml:0 msgid "Confirm new master password:" -msgstr "" +msgstr "Подтверждение Мастер Пароля:" #: addons/web/static/src/xml/base.xml:0 msgid "User:" -msgstr "" +msgstr "Пользователь:" #: addons/web/static/src/xml/base.xml:0 msgid "Password:" -msgstr "" +msgstr "Пароль:" #: addons/web/static/src/xml/base.xml:0 msgid "Database" -msgstr "" +msgstr "База данных" #: addons/web/static/src/xml/base.xml:0 msgid "Login" -msgstr "" +msgstr "Авторизация" #: addons/web/static/src/xml/base.xml:0 msgid "Bad username or password" -msgstr "" +msgstr "Неверное имя пользователя или пароль" #: 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 "" +msgstr "OpenERP's видение" #: addons/web/static/src/xml/base.xml:0 msgid "Full featured" -msgstr "" +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 "" +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 "" +msgstr "Дружественный" #: addons/web/static/src/xml/base.xml:0 msgid "" "In order to be productive, people need clean and easy to use interface." -msgstr "" +msgstr "Для продуктивной работы, людям необходим легкий и простой интерфейс." #: addons/web/static/src/xml/base.xml:0 msgid "(" -msgstr "" +msgstr "(" #: addons/web/static/src/xml/base.xml:0 msgid ")" -msgstr "" +msgstr ")" #: addons/web/static/src/xml/base.xml:0 msgid "LOGOUT" -msgstr "" +msgstr "ВЫЙТИ" #: addons/web/static/src/xml/base.xml:0 msgid "«" -msgstr "" +msgstr "«" #: addons/web/static/src/xml/base.xml:0 msgid "»" -msgstr "" +msgstr "»" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_menu_item" -msgstr "" +msgstr "oe_secondary_menu_item" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_submenu_item" -msgstr "" +msgstr "oe_secondary_submenu_item" #: addons/web/static/src/xml/base.xml:0 msgid "Hide this tip" -msgstr "" +msgstr "Скрыть подсказку" #: addons/web/static/src/xml/base.xml:0 msgid "Disable all tips" -msgstr "" +msgstr "Отключить все подсказки" #: addons/web/static/src/xml/base.xml:0 msgid "More…" -msgstr "" +msgstr "Больше..." #: addons/web/static/src/xml/base.xml:0 msgid "Debug View#" diff --git a/addons/web/po/zh_CN.po b/addons/web/po/zh_CN.po index 536a3761360..087c66bd3b3 100644 --- a/addons/web/po/zh_CN.po +++ b/addons/web/po/zh_CN.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2012-01-07 15:30+0000\n" +"PO-Revision-Date: 2012-01-12 05:44+0000\n" "Last-Translator: Wei \"oldrev\" Li \n" "Language-Team: Chinese (Simplified) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-08 05:27+0000\n" -"X-Generator: Launchpad (build 14640)\n" +"X-Launchpad-Export-Date: 2012-01-13 05:01+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web/static/src/js/chrome.js:162 #: addons/web/static/src/js/chrome.js:175 @@ -358,7 +358,7 @@ msgstr "翻译" #: addons/web/static/src/js/views.js:728 msgid "Technical translation" -msgstr "" +msgstr "技术翻译" #: addons/web/static/src/js/views.js:733 msgid "Other Options" @@ -585,19 +585,19 @@ msgstr "注销" #: addons/web/static/src/xml/base.xml:0 msgid "«" -msgstr "" +msgstr "«" #: addons/web/static/src/xml/base.xml:0 msgid "»" -msgstr "" +msgstr "»" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_menu_item" -msgstr "" +msgstr "oe_secondary_menu_item" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_submenu_item" -msgstr "" +msgstr "oe_secondary_submenu_item" #: addons/web/static/src/xml/base.xml:0 msgid "Hide this tip" @@ -661,7 +661,7 @@ msgstr "复制" #: addons/web/static/src/xml/base.xml:0 msgid "Unhandled widget" -msgstr "" +msgstr "未处理的窗口部件" #: addons/web/static/src/xml/base.xml:0 msgid "Notebook Page \"" @@ -725,19 +725,19 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "[" -msgstr "" +msgstr "[" #: addons/web/static/src/xml/base.xml:0 msgid "]" -msgstr "" +msgstr "]" #: addons/web/static/src/xml/base.xml:0 msgid "-" -msgstr "" +msgstr "-" #: addons/web/static/src/xml/base.xml:0 msgid "#" -msgstr "" +msgstr "#" #: addons/web/static/src/xml/base.xml:0 msgid "Open..." @@ -817,7 +817,7 @@ msgstr "过滤器名称:" #: addons/web/static/src/xml/base.xml:0 msgid "(Any existing filter with the same name will be replaced)" -msgstr "" +msgstr "(任何已存在的同名过滤器都会被替换)" #: addons/web/static/src/xml/base.xml:0 msgid "Select Dashboard to add this filter to:" @@ -866,6 +866,8 @@ msgid "" " You can export all data or only the fields that can be " "reimported after modification." msgstr "" +"此向导将导出所有符合当前搜索条件的数据到 CSV 文件。\n" +" 您也可以导出所有数据或选择在修改了 CSV 文件以后还能够重新导入的那些字段。" #: addons/web/static/src/xml/base.xml:0 msgid "Export Type:" @@ -1007,7 +1009,7 @@ msgstr "OpenERP SA 公司" #: addons/web/static/src/xml/base.xml:0 msgid "Licenced under the terms of" -msgstr "" +msgstr "采用的授权协议" #: addons/web/static/src/xml/base.xml:0 msgid "GNU Affero General Public License" diff --git a/addons/web/static/lib/jquery.contextmenu/jquery.contextmenu.r2.packed.js b/addons/web/static/lib/jquery.contextmenu/jquery.contextmenu.r2.packed.js index 2356f3b606b..47f542e5d39 100644 --- a/addons/web/static/lib/jquery.contextmenu/jquery.contextmenu.r2.packed.js +++ b/addons/web/static/lib/jquery.contextmenu/jquery.contextmenu.r2.packed.js @@ -65,8 +65,10 @@ display(index,this,e,options); return false; }; - $(this).bind('contextmenu', callback); - if(options.leftClickToo) { + if (!options.noRightClick) { + $(this).bind('contextmenu', callback); + } + if (options.leftClickToo || options.noRightClick) { $(this).click(callback); } return this @@ -123,4 +125,4 @@ })(jQuery); $( function() { $('div.contextMenu').hide() -}); \ No newline at end of file +}); diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index df6d78e8aa5..d4bd7a6ff1b 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -437,6 +437,7 @@ label.error { position: absolute; cursor: pointer; border-left: 1px solid #282828; + border-bottom: 1px solid #282828; width: 21px; height: 21px; z-index: 10; @@ -518,6 +519,11 @@ label.error { .openerp a.oe_secondary_submenu_item { padding: 0 5px 2px 10px; } +.openerp a.oe_secondary_submenu_item, +.openerp a.oe_secondary_menu_item { + overflow: hidden; + text-overflow: ellipsis; +} .openerp a.oe_secondary_submenu_item:hover, .openerp a.oe_secondary_submenu_item.leaf.active { display: block; @@ -2033,6 +2039,7 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { .openerp .oe_vm_switch_form, .openerp .oe_vm_switch_page, +.openerp .oe_vm_switch_tree, .openerp .oe_vm_switch_list, .openerp .oe_vm_switch_graph, .openerp .oe_vm_switch_gantt, @@ -2049,6 +2056,7 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { .openerp .oe_vm_switch_form span, .openerp .oe_vm_switch_page span, +.openerp .oe_vm_switch_tree span, .openerp .oe_vm_switch_list span, .openerp .oe_vm_switch_graph span, .openerp .oe_vm_switch_gantt span, @@ -2068,6 +2076,16 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { background-position: 0px -21px; } +.openerp .oe_vm_switch_tree { + background-position: 0px 0px; +} +.openerp .oe_vm_switch_tree:active, +.openerp .oe_vm_switch_tree:hover, +.openerp .oe_vm_switch_tree:focus, +.openerp .oe_vm_switch_tree[disabled="disabled"] { + background-position: 0px -21px; +} + .openerp .oe_vm_switch_form { background-position: -22px 0px; } @@ -2078,6 +2096,15 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { background-position: -22px -21px; } +.openerp .oe_vm_switch_page { + background-position: -22px 0px; +} +.openerp .oe_vm_switch_page:active, +.openerp .oe_vm_switch_page:hover, +.openerp .oe_vm_switch_page:focus, +.openerp .oe_vm_switch_page[disabled="disabled"] { + background-position: -22px -21px; +} .openerp .oe_vm_switch_graph { background-position: -44px 0px; } diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 34b413526f0..39bc0181e16 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -36,7 +36,7 @@ openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Not }); -openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# */{ +openerp.web.Dialog = openerp.web.Widget.extend(/** @lends openerp.web.Dialog# */{ dialog_title: "", identifier_prefix: 'dialog', /** @@ -44,11 +44,14 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# * @extends openerp.web.OldWidget * * @param parent - * @param dialog_options + * @param options */ - init: function (parent, dialog_options) { + init: function (parent, options, content) { var self = this; this._super(parent); + if (content) { + this.$element = content instanceof $ ? content : $(content); + } this.dialog_options = { modal: true, destroy_on_close: true, @@ -57,10 +60,9 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# max_width: '95%', height: 'auto', min_height: 0, - max_height: '95%', + max_height: this.get_height('100%') - 140, autoOpen: false, position: [false, 50], - autoResize : 'auto', buttons: {}, beforeClose: function () { self.on_close(); }, resizeStop: this.on_resized @@ -70,31 +72,29 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# this.dialog_options.buttons[f.substr(10)] = this[f]; } } - if (dialog_options) { - this.set_options(dialog_options); + if (options) { + _.extend(this.dialog_options, options); + } + if (this.dialog_options.autoOpen) { + this.open(); + } else { + this.$element.dialog(this.get_options()); } }, - set_options: function(options) { - options = options || {}; - options.width = this.get_width(options.width || this.dialog_options.width); - options.min_width = this.get_width(options.min_width || this.dialog_options.min_width); - options.max_width = this.get_width(options.max_width || this.dialog_options.max_width); - options.height = this.get_height(options.height || this.dialog_options.height); - options.min_height = this.get_height(options.min_height || this.dialog_options.min_height); - options.max_height = this.get_height(options.max_height || this.dialog_options.max_height); - - if (options.width !== 'auto') { - if (options.width > options.max_width) options.width = options.max_width; - if (options.width < options.min_width) options.width = options.min_width; + get_options: function(options) { + var self = this, + o = _.extend({}, this.dialog_options, options || {}); + _.each(['width', 'height'], function(unit) { + o[unit] = self['get_' + unit](o[unit]); + o['min_' + unit] = self['get_' + unit](o['min_' + unit] || 0); + o['max_' + unit] = self['get_' + unit](o['max_' + unit] || 0); + if (o[unit] !== 'auto' && o['min_' + unit] && o[unit] < o['min_' + unit]) o[unit] = o['min_' + unit]; + if (o[unit] !== 'auto' && o['max_' + unit] && o[unit] > o['max_' + unit]) o[unit] = o['max_' + unit]; + }); + if (!o.title && this.dialog_title) { + o.title = this.dialog_title; } - if (options.height !== 'auto') { - if (options.height > options.max_height) options.height = options.max_height; - if (options.height < options.min_height) options.height = options.min_height; - } - if (!options.title && this.dialog_title) { - options.title = this.dialog_title; - } - _.extend(this.dialog_options, options); + return o; }, get_width: function(val) { return this.get_size(val.toString(), $(window.top).width()); @@ -111,18 +111,16 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# return parseInt(val, 10); } }, - start: function () { - this.$element.dialog(this.dialog_options); - this._super(); - return this; - }, - open: function(dialog_options) { + open: function(options) { // TODO fme: bind window on resize if (this.template) { this.$element.html(this.render()); } - this.set_options(dialog_options); - this.$element.dialog(this.dialog_options).dialog('open'); + var o = this.get_options(options); + this.$element.dialog(o).dialog('open'); + if (o.height === 'auto' && o.max_height) { + this.$element.css({ 'max-height': o.max_height, 'overflow-y': 'auto' }); + } return this; }, close: function() { @@ -134,9 +132,7 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# } }, on_resized: function() { - if (openerp.connection.debug) { - console.log("Dialog resized to %d x %d", this.$element.width(), this.$element.height()); - } + //openerp.log("Dialog resized to %d x %d", this.$element.width(), this.$element.height()); }, stop: function () { // Destroy widget @@ -179,7 +175,7 @@ openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({ var buttons = {}; if (openerp.connection.openerp_entreprise) { buttons[_t("Send OpenERP Enterprise Report")] = function() { - $this = $(this); + var $this = $(this); var issuename = $('#issuename').val(); var explanation = $('#explanation').val(); var remark = $('#remark').val(); @@ -202,13 +198,12 @@ openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({ } var dialog = new openerp.web.Dialog(this, { title: "OpenERP " + _.str.capitalize(this.error.type), - autoOpen: true, width: '80%', height: '50%', min_width: '800px', min_height: '600px', buttons: buttons - }).start(); + }).open(); dialog.$element.html(QWeb.render('CrashManagerError', {session: openerp.connection, error: error})); }, }); @@ -481,7 +476,10 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database error: error[1] }); }, - complete: $.proxy(self, 'unblockUI') + complete: function() { + self.unblockUI(); + self.do_notify(_t("Backed"), _t("Database backed up successfully")); + } }); } }); @@ -517,7 +515,10 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database }) } }, - complete: $.proxy(self, 'unblockUI') + complete: function() { + self.unblockUI(); + self.do_notify(_t("Restored"), _t("Database restored successfully")); + } }); } }); @@ -688,6 +689,11 @@ openerp.web.Header = openerp.web.Widget.extend(/** @lends openerp.web.Header# * var self = this; self.rpc("/web/webclient/version_info", {}).then(function(res) { var $help = $(QWeb.render("About-Page", {version_info: res})); + $help.find('a.oe_activate_debug_mode').click(function (e) { + e.preventDefault(); + window.location = $.param.querystring( + window.location.href, 'debug'); + }); $help.dialog({autoOpen: true, modal: true, width: 960, title: _t("About")}); }); @@ -771,20 +777,20 @@ openerp.web.Header = openerp.web.Widget.extend(/** @lends openerp.web.Header# * title: _t("Preferences"), width: '700px', buttons: [ - {text: _t("Change password"), click: function(){ self.change_password(); }}, {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, + {text: _t("Change password"), click: function(){ self.change_password(); }}, {text: _t("Save"), click: function(){ var inner_viewmanager = action_manager.inner_viewmanager; inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save() .then(function() { self.dialog.stop(); + // needs to refresh interface in case language changed window.location.reload(); }); } } ] - }); - this.dialog.start().open(); + }).open(); action_manager.appendTo(this.dialog); action_manager.render(this.dialog); }, @@ -794,8 +800,7 @@ openerp.web.Header = openerp.web.Widget.extend(/** @lends openerp.web.Header# * this.dialog = new openerp.web.Dialog(this, { title: _t("Change Password"), width : 'auto' - }); - this.dialog.start().open(); + }).open(); this.dialog.$element.html(QWeb.render("Change_Pwd", self)); this.dialog.$element.find("form[name=change_password_form]").validate({ submitHandler: function (form) { @@ -1102,11 +1107,11 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie self.$table = $(QWeb.render("Interface", {})); self.$element.append(self.$table); self.header = new openerp.web.Header(self); - self.header.on_logout.add(self.on_logout); - self.header.on_action.add(self.on_menu_action); + self.header.on_logout.add(this.proxy('on_logout')); + self.header.on_action.add(this.proxy('on_menu_action')); self.header.appendTo($("#oe_header")); self.menu = new openerp.web.Menu(self, "oe_menu", "oe_secondary_menu"); - self.menu.on_action.add(self.on_menu_action); + self.menu.on_action.add(this.proxy('on_menu_action')); self.menu.start(); }, show_common: function() { @@ -1124,7 +1129,11 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie this.$element.children().remove(); }, do_reload: function() { - return this.session.session_init().pipe(_.bind(function() {this.menu.do_reload();}, this)); + var self = this; + return this.session.session_reload().pipe(function () { + openerp.connection.load_modules(true).pipe( + self.menu.proxy('do_reload')); }); + }, do_notify: function() { var n = this.notification; @@ -1175,7 +1184,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie self.menu.on_menu_click(null, action.menu_id); }); } - }, + } }); openerp.web.EmbeddedClient = openerp.web.Widget.extend({ diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 819385288a7..b36e576ae47 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -348,6 +348,31 @@ openerp.web.CallbackEnabled = openerp.web.Class.extend(/** @lends openerp.web.Ca } } } + }, + /** + * Proxies a method of the object, in order to keep the right ``this`` on + * method invocations. + * + * This method is similar to ``Function.prototype.bind`` or ``_.bind``, and + * even more so to ``jQuery.proxy`` with a fundamental difference: its + * resolution of the method being called is lazy, meaning it will use the + * method as it is when the proxy is called, not when the proxy is created. + * + * Other methods will fix the bound method to what it is when creating the + * binding/proxy, which is fine in most javascript code but problematic in + * OpenERP Web where developers may want to replace existing callbacks with + * theirs. + * + * The semantics of this precisely replace closing over the method call. + * + * @param {String} method_name name of the method to invoke + * @returns {Function} proxied method + */ + proxy: function (method_name) { + var self = this; + return function () { + return self[method_name].apply(self, arguments); + } } }); @@ -547,7 +572,24 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. var self = this; // TODO: session store in cookie should be optional this.session_id = this.get_cookie('session_id'); - return this.rpc("/web/session/get_session_info", {}).pipe(function(result) { + return this.session_reload().pipe(function(result) { + var modules = openerp._modules.join(','); + var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).pipe(self.do_load_qweb); + if(self.session_is_valid()) { + return deferred.pipe(function() { return self.load_modules(); }); + } + return deferred; + }); + }, + /** + * (re)loads the content of a session: db name, username, user id, session + * context and status of the support contract + * + * @returns {$.Deferred} deferred indicating the session is done reloading + */ + session_reload: function () { + var self = this; + return this.rpc("/web/session/get_session_info", {}).then(function(result) { // If immediately follows a login (triggered by trying to restore // an invalid session or no session at all), refresh session data // (should not change, but just in case...) @@ -558,12 +600,6 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. user_context: result.context, openerp_entreprise: result.openerp_entreprise }); - var modules = openerp._modules.join(','); - var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).pipe(self.do_load_qweb); - if(self.session_is_valid()) { - return deferred.pipe(function() { self.load_modules(); }); - } - return deferred; }); }, session_is_valid: function() { @@ -640,26 +676,31 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. }, /** * Load additional web addons of that instance and init them + * + * @param {Boolean} [no_session_valid_signal=false] prevents load_module from triggering ``on_session_valid``. */ - load_modules: function() { + load_modules: function(no_session_valid_signal) { var self = this; return this.rpc('/web/session/modules', {}).pipe(function(result) { - self.module_list = result; var lang = self.user_context.lang; var params = { mods: ["web"].concat(result), lang: lang}; - var modules = self.module_list.join(','); + var to_load = _.difference(result, self.module_list).join(','); + self.module_list = result; return $.when( - self.rpc('/web/webclient/csslist', {mods: modules}, self.do_load_css), - self.rpc('/web/webclient/qweblist', {mods: modules}).pipe(self.do_load_qweb), + self.rpc('/web/webclient/csslist', {mods: to_load}, self.do_load_css), + self.rpc('/web/webclient/qweblist', {mods: to_load}).pipe(self.do_load_qweb), self.rpc('/web/webclient/translations', params).pipe(function(trans) { openerp.web._t.database.set_bundle(trans); var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; - return self.rpc('/web/webclient/jslist', {mods: modules}).pipe(function(files) { + return self.rpc('/web/webclient/jslist', {mods: to_load}).pipe(function(files) { return self.do_load_js(file_list.concat(files)); }); }) ).then(function() { - self.on_session_valid(); + self.on_modules_loaded(); + if (!no_session_valid_signal) { + self.on_session_valid(); + } }); }); }, @@ -692,7 +733,6 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. var head = document.head || document.getElementsByTagName('head')[0]; head.appendChild(tag); } else { - self.on_modules_loaded(); d.resolve(); } return d; @@ -702,6 +742,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. _.each(files, function(file) { self.qweb_mutex.exec(function() { return self.rpc('/web/proxy/load', {path: file}).pipe(function(xml) { + if (!xml) { return; } openerp.web.qweb.add_template(_.str.trim(xml)); }); }); diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index c24325a9327..447b95d17cf 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -293,16 +293,16 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet * * @param {Array} ids identifiers of the records to read * @param {Array} fields fields to read and return, by default all fields are returned - * @param {Function} callback function called with read result * @returns {$.Deferred} */ - read_ids: function (ids, fields, callback) { + read_ids: function (ids, fields, options) { + var options = options || {}; return this.rpc('/web/dataset/get', { model: this.model, ids: ids, fields: fields, - context: this.get_context() - }, callback); + context: this.get_context(options.context) + }); }, /** * Read a slice of the records represented by this DataSet, based on its @@ -312,26 +312,25 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet * @params {Object} options * @param {Number} [options.offset=0] The index from which selected records should be returned * @param {Number} [options.limit=null] The maximum number of records to return - * @param {Function} callback function called with read_slice result * @returns {$.Deferred} */ - read_slice: function (fields, options, callback) { - return null; + read_slice: function (fields, options) { + return null; }, /** * Reads the current dataset record (from its index) * * @params {Array} [fields] fields to read and return, by default all fields are returned - * @params {Function} callback function called with read_index result + * @param {Object} [options.context] context data to add to the request payload, on top of the DataSet's own context * @returns {$.Deferred} */ - read_index: function (fields, callback) { - var def = $.Deferred().then(callback); + read_index: function (fields, options) { + var def = $.Deferred(); if (_.isEmpty(this.ids)) { def.reject(); } else { fields = fields || false; - this.read_ids([this.ids[this.index]], fields).then(function(records) { + this.read_ids([this.ids[this.index]], fields, options).then(function(records) { def.resolve(records[0]); }, function() { def.reject.apply(def, arguments); @@ -343,15 +342,16 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet * Reads default values for the current model * * @param {Array} [fields] fields to get default values for, by default all defaults are read - * @param {Function} callback function called with default_get result + * @param {Object} [options.context] context data to add to the request payload, on top of the DataSet's own context * @returns {$.Deferred} */ - default_get: function(fields, callback) { + default_get: function(fields, options) { + var options = options || {}; return this.rpc('/web/dataset/default_get', { model: this.model, fields: fields, - context: this.get_context() - }, callback); + context: this.get_context(options.context) + }); }, /** * Creates a new record in db @@ -422,7 +422,7 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet * @param {Number} [domain_index] index of a domain to evaluate in the args array * @param {Number} [context_index] index of a context to evaluate in the args array * @param {Function} callback - * @param {Function }error_callback + * @param {Function} error_callback * @returns {$.Deferred} */ call_and_eval: function (method, args, domain_index, context_index, callback, error_callback) { @@ -503,14 +503,14 @@ openerp.web.DataSetStatic = openerp.web.DataSet.extend({ // all local records this.ids = ids || []; }, - read_slice: function (fields, options, callback) { + read_slice: function (fields, options) { // TODO remove fields from options var self = this, offset = options.offset || 0, limit = options.limit || false, fields = fields || false; var end_pos = limit && limit !== -1 ? offset + limit : this.ids.length; - return this.read_ids(this.ids.slice(offset, end_pos), fields, callback); + return this.read_ids(this.ids.slice(offset, end_pos), fields); }, set_ids: function (ids) { this.ids = ids; @@ -557,10 +557,9 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D * @param {Array} [options.domain] domain data to add to the request payload, ANDed with the dataset's domain * @param {Number} [options.offset=0] The index from which selected records should be returned * @param {Number} [options.limit=null] The maximum number of records to return - * @param {Function} callback function called with read_slice result * @returns {$.Deferred} */ - read_slice: function (fields, options, callback) { + read_slice: function (fields, options) { var self = this; var options = options || {}; var offset = options.offset || 0; @@ -576,7 +575,7 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D self.ids = result.ids; self.offset = offset; return result.records; - }).then(callback); + }); }, get_domain: function (other_domain) { if (other_domain) { @@ -630,8 +629,8 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ this.reset_ids([]); this.last_default_get = {}; }, - default_get: function(fields, callback) { - return this._super(fields).then(this.on_default_get).then(callback); + default_get: function(fields, options) { + return this._super(fields, options).then(this.on_default_get); }, on_default_get: function(res) { this.last_default_get = res; @@ -699,7 +698,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ this.delete_all = false; }, on_change: function() {}, - read_ids: function (ids, fields, callback) { + read_ids: function (ids, fields, options) { var self = this; var to_get = []; _.each(ids, function(id) { @@ -713,7 +712,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ to_get.push(id); } }); - var completion = $.Deferred().then(callback); + var completion = $.Deferred(); var return_records = function() { var records = _.map(ids, function(id) { return _.extend({}, _.detect(self.cache, function(c) {return c.id === id;}).values, {"id": id}); @@ -726,7 +725,7 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ completion.resolve(records); }; if(to_get.length > 0) { - var rpc_promise = this._super(to_get, fields, function(records) { + var rpc_promise = this._super(to_get, fields, options).then(function(records) { _.each(records, function(record, index) { var id = to_get[index]; var cached = _.detect(self.cache, function(x) {return x.id === id;}); @@ -775,8 +774,8 @@ openerp.web.ProxyDataSet = openerp.web.DataSetSearch.extend({ return this._super.apply(this, arguments); } }, - default_get: function(fields, callback) { - return this._super(fields, callback).then(this.on_default_get); + default_get: function(fields, options) { + return this._super(fields, options).then(this.on_default_get); }, on_default_get: function(result) {}, create: function(data, callback, error_callback) { diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js index 78dc3bef1f9..78be735edc7 100644 --- a/addons/web/static/src/js/data_export.js +++ b/addons/web/static/src/js/data_export.js @@ -63,7 +63,15 @@ openerp.web.DataExport = openerp.web.Dialog.extend({ do_setup_export_formats: function (formats) { var $fmts = this.$element.find('#export_format'); _(formats).each(function (format) { - $fmts.append(new Option(format[1], format[0])); + var opt = new Option(format.label, format.tag); + if (format.error) { + opt.disabled = true; + opt.replaceChild( + document.createTextNode( + _.str.sprintf("%s — %s", format.label, format.error)), + opt.childNodes[0]) + } + $fmts.append(opt); }); }, show_exports_list: function() { @@ -74,7 +82,7 @@ openerp.web.DataExport = openerp.web.Dialog.extend({ } return this.exports.read_slice(['name'], { domain: [['resource', '=', this.dataset.model]] - }, function (export_list) { + }).then(function (export_list) { if (!export_list.length) { return; } @@ -114,7 +122,7 @@ openerp.web.DataExport = openerp.web.Dialog.extend({ if (value) { self.do_save_export_list(value); } else { - alert("Pleae Enter Save Field List Name"); + alert(_t("Please enter save field list name")); } }); } else { @@ -349,24 +357,27 @@ openerp.web.DataExport = openerp.web.Dialog.extend({ export_field.push($(this).val()); }); if (!export_field.length) { - alert('Please select fields to save export list...'); + alert(_t("Please select fields to save export list...")); } return export_field; }, on_click_export_data: function() { - $.blockUI(this.$element); - var exported_fields = [], self = this; - this.$element.find("#fields_list option").each(function() { - var fieldname = self.records[$(this).val()]; - exported_fields.push({name: fieldname, label: $(this).text()}); - }); + var self = this; + var exported_fields = this.$element.find('#fields_list option').map(function () { + var name = self.records[this.value] || this.value + // DOM property is textContent, but IE8 only knows innerText + return {name: this.value, + label: this.textContent || this.innerText}; + }).get(); + if (_.isEmpty(exported_fields)) { - alert('Please select fields to export...'); + alert(_t("Please select fields to export...")); return; } exported_fields.unshift({name: 'id', label: 'External ID'}); var export_format = this.$element.find("#export_format").val(); + $.blockUI(); this.session.get_file({ url: '/web/export/' + export_format, data: {data: JSON.stringify({ @@ -375,7 +386,7 @@ openerp.web.DataExport = openerp.web.Dialog.extend({ ids: this.dataset.ids, domain: this.dataset.domain, import_compat: Boolean( - this.$element.find("#import_compat").val()) + this.$element.find("#import_compat").val()) })}, complete: $.unblockUI }); diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 2b252454869..18870ca2157 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -83,7 +83,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ '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) { + .default_get(_.pluck(self.fields, 'id')).then(function (fields) { _.each(fields, function(val, key) { if (val) { self.fields_with_defaults.push(key); diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 37d1e4cf7b5..7f220d0aa54 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -102,10 +102,6 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) { return _.str.sprintf("%02d:%02d", Math.floor(value), Math.round((value % 1) * 60)); - case 'progressbar': - return _.str.sprintf( - '%.2f%%', - value, value); case 'many2one': // name_get value format return value[1]; @@ -237,7 +233,15 @@ openerp.web.auto_date_to_str = function(value, type) { }; /** - * Formats a provided cell based on its field type + * Formats a provided cell based on its field type. Most of the field types + * return a correctly formatted value, but some tags and fields are + * special-cased in their handling: + * + * * buttons will return an actual `` - - - - - @@ -1644,7 +1646,7 @@
- +

1. Import a .CSV file

Select a .CSV file to import. If you need a sample of file to import, you should use the export tool with the "Import Compatible" option. @@ -1715,6 +1717,7 @@

+ Debug mode

OpenERP Web

Version

diff --git a/addons/web/static/test/formats.js b/addons/web/static/test/formats.js index 69557e98d5e..b841d12a6b2 100644 --- a/addons/web/static/test/formats.js +++ b/addons/web/static/test/formats.js @@ -61,6 +61,17 @@ $(document).ready(function () { var str = openerp.web.format_value(date, {type:"time"}); equal(str, date.toString("HH:mm:ss")); }); + test("format_float_time", function () { + strictEqual( + openerp.web.format_value(1.0, {type:'float', widget:'float_time'}), + '01:00'); + strictEqual( + openerp.web.format_value(0.9853, {type:'float', widget:'float_time'}), + '00:59'); + strictEqual( + openerp.web.format_value(0.0085, {type:'float', widget:'float_time'}), + '00:01'); + }); test("format_float", function () { var fl = 12.1234; var str = openerp.web.format_value(fl, {type:"float"}); diff --git a/addons/web/static/test/list-utils.js b/addons/web/static/test/list-utils.js index f71da82a560..8cc34454cd5 100644 --- a/addons/web/static/test/list-utils.js +++ b/addons/web/static/test/list-utils.js @@ -170,6 +170,16 @@ $(document).ready(function () { equal(c.get(2), undefined); strictEqual(c.at(1).get('value'), 20); }); + test('Remove unbind', function () { + var changed = false, + c = new openerp.web.list.Collection([ {id: 1, value: 5} ]); + c.bind('change', function () { changed = true; }); + var record = c.get(1); + c.remove(record); + record.set('value', 42); + ok(!changed, 'removed records should not trigger events in their ' + + 'parent collection'); + }); test('Reset', function () { var event, obj, c = new openerp.web.list.Collection([ {id: 1, value: 5}, @@ -190,6 +200,16 @@ $(document).ready(function () { strictEqual(c.length, 1); strictEqual(c.get(42).get('value'), 55); }); + test('Reset unbind', function () { + var changed = false, + c = new openerp.web.list.Collection([ {id: 1, value: 5} ]); + c.bind('change', function () { changed = true; }); + var record = c.get(1); + c.reset(); + record.set('value', 42); + ok(!changed, 'removed records should not trigger events in their ' + + 'parent collection'); + }); test('Events propagation', function () { var values = []; diff --git a/addons/web/static/test/test.html b/addons/web/static/test/test.html index b1018bc00ca..da06aba2364 100644 --- a/addons/web/static/test/test.html +++ b/addons/web/static/test/test.html @@ -14,6 +14,7 @@ + diff --git a/addons/web_calendar/po/pt_BR.po b/addons/web_calendar/po/pt_BR.po new file mode 100644 index 00000000000..6b532681251 --- /dev/null +++ b/addons/web_calendar/po/pt_BR.po @@ -0,0 +1,34 @@ +# Brazilian Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-14 15:42+0000\n" +"Last-Translator: Rafael Sales \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-15 05:35+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_calendar/static/src/js/calendar.js:11 +msgid "Calendar" +msgstr "Calendário" + +#: addons/web_calendar/static/src/js/calendar.js:446 +msgid "Responsible" +msgstr "Responsável" + +#: addons/web_calendar/static/src/js/calendar.js:475 +msgid "Navigator" +msgstr "Navegador" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr " " diff --git a/addons/web_calendar/po/ru.po b/addons/web_calendar/po/ru.po index 546a8a5dd0c..c4762dfb8c7 100644 --- a/addons/web_calendar/po/ru.po +++ b/addons/web_calendar/po/ru.po @@ -8,27 +8,27 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2011-12-02 07:07+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2012-01-13 11:40+0000\n" +"Last-Translator: Aleksei Motsik \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web_calendar/static/src/js/calendar.js:11 msgid "Calendar" -msgstr "" +msgstr "Календарь" #: addons/web_calendar/static/src/js/calendar.js:446 msgid "Responsible" -msgstr "" +msgstr "Ответственный" #: addons/web_calendar/static/src/js/calendar.js:475 msgid "Navigator" -msgstr "" +msgstr "Навигатор" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " -msgstr "" +msgstr " " diff --git a/addons/web_calendar/static/src/css/web_calendar.css b/addons/web_calendar/static/src/css/web_calendar.css index 26828b8e25d..a5de6648f82 100644 --- a/addons/web_calendar/static/src/css/web_calendar.css +++ b/addons/web_calendar/static/src/css/web_calendar.css @@ -106,7 +106,6 @@ float:right; } .openerp .dhx_cal_prev_button:hover, .openerp .dhx_cal_prev_button:active, .openerp .dhx_cal_today_button:hover, .openerp .dhx_cal_today_button:active, .openerp .dhx_cal_next_button:hover, .openerp .dhx_cal_next_button:active { - } .openerp .dhx_mini_calendar .dhx_cal_prev_button, .openerp .dhx_mini_calendar .dhx_cal_next_button, .openerp .dhx_mini_calendar .dhx_cal_today_button { diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index c9b5ab8f597..8e03208e276 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -36,6 +36,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ this.range_start = null; this.range_stop = null; this.update_range_dates(Date.today()); + this.selected_filters = []; }, start: function() { this._super(); @@ -63,11 +64,17 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ this.date_delay = this.fields_view.arch.attrs.date_delay; this.date_stop = this.fields_view.arch.attrs.date_stop; - this.colors = this.fields_view.arch.attrs.colors; this.day_length = this.fields_view.arch.attrs.day_length || 8; this.color_field = this.fields_view.arch.attrs.color; + + if (this.color_field && this.selected_filters.length === 0) { + var default_filter; + if (default_filter = this.dataset.context['calendar_default_' + this.color_field]) { + this.selected_filters.push(default_filter + ''); + } + } this.fields = this.fields_view.fields; - + if (!this.date_start) { throw new Error("Calendar view has not defined 'date_start' attribute."); } @@ -171,7 +178,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ } }, reload_event: function(id) { - this.dataset.read_ids([id], _.keys(this.fields), this.on_events_loaded); + this.dataset.read_ids([id], _.keys(this.fields)).then(this.on_events_loaded); }, get_color: function(key) { if (this.color_map[key]) { @@ -289,36 +296,25 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ var self = this, data = this.get_event_data(event_obj), form = self.form_dialog.form, - fields_to_fetch = _(form.fields_view.fields).keys(), - set_values = [], - fields_names = []; + fields_to_fetch = _(form.fields_view.fields).keys(); this.dataset.index = null; self.creating_event_id = event_id; this.form_dialog.form.do_show().then(function() { form.show_invalid = false; - _.each(['date_start', 'date_stop', 'date_delay'], function(field) { + _.each(['date_start', 'date_delay', 'date_stop'], function(field) { var field_name = self[field]; if (field_name && form.fields[field_name]) { var ffield = form.fields[field_name]; ffield.reset(); - var result = ffield.set_value(data[field_name]); - set_values.push(result); - fields_names.push(field_name); - $.when(result).then(function() { + $.when(ffield.set_value(data[field_name])).then(function() { ffield.validate(); + ffield.dirty = true; + form.do_onchange(ffield); }); } }); - - $.when(set_values).then(function() { - _.each(fields_names, function(fn) { - var field = form.fields[fn]; - field.dirty = true; - form.do_onchange(field); - }); - form.show_invalid = true; - self.form_dialog.open(); - }); + form.show_invalid = true; + self.form_dialog.open(); }); }, do_save_event: function(event_id, event_obj) { @@ -355,6 +351,8 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ event_obj['start_date'].addHours(8); event_obj['end_date'] = new Date(event_obj['start_date']); event_obj['end_date'].addHours(1); + } else { + event_obj['end_date'].addSeconds(-1); } this.do_create_event_with_formdialog(event_id, event_obj); // return false; @@ -392,7 +390,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ offset: 0, domain: self.get_range_domain(), context: self.last_search[1] - }, function(events) { + }).then(function(events) { self.dataset_events = events; self.on_events_loaded(events); }); @@ -475,13 +473,22 @@ openerp.web_calendar.SidebarResponsible = openerp.web.Widget.extend({ this.$element.delegate('input:checkbox', 'change', this.on_filter_click); }, on_events_loaded: function(filters) { + var selected_filters = this.view.selected_filters.slice(0); this.$div.html(QWeb.render('CalendarView.sidebar.responsible', { filters: filters })); + this.$element.find('div.oe_calendar_responsible input').each(function() { + if (_.indexOf(selected_filters, $(this).val()) > -1) { + $(this).click(); + } + }); }, on_filter_click: function(e) { - var responsibles = [], + var self = this, + responsibles = [], $e = $(e.target); + this.view.selected_filters = []; this.$element.find('div.oe_calendar_responsible input:checked').each(function() { responsibles.push($(this).val()); + self.view.selected_filters.push($(this).val()); }); scheduler.clearAll(); if (responsibles.length) { diff --git a/addons/web_dashboard/po/pt_BR.po b/addons/web_dashboard/po/pt_BR.po new file mode 100644 index 00000000000..2d089f77849 --- /dev/null +++ b/addons/web_dashboard/po/pt_BR.po @@ -0,0 +1,76 @@ +# Brazilian Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-14 15:57+0000\n" +"Last-Translator: Rafael Sales \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-15 05:35+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_dashboard/static/src/js/dashboard.js:63 +msgid "Edit Layout" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +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 " " +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Create" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose dashboard layout" +msgstr "Escolha o Layout do Painel" + +#: 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 "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "" +"Click on the functionalites listed below to launch them and configure your " +"system" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Welcome to OpenERP" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Remember to bookmark this page." +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Remember your login:" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Please choose the first application to install." +msgstr "" diff --git a/addons/web_dashboard/po/ru.po b/addons/web_dashboard/po/ru.po index d16affb20d6..71028c2f0db 100644 --- a/addons/web_dashboard/po/ru.po +++ b/addons/web_dashboard/po/ru.po @@ -8,69 +8,70 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2011-12-02 07:09+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2012-01-13 12:28+0000\n" +"Last-Translator: Aleksei Motsik \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web_dashboard/static/src/js/dashboard.js:63 msgid "Edit Layout" -msgstr "" +msgstr "Редактировать макет" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Reset" -msgstr "" +msgstr "Сбросить" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Change layout" -msgstr "" +msgstr "Изменить внешний вид" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid " " -msgstr "" +msgstr " " #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Create" -msgstr "" +msgstr "Создать" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Choose dashboard layout" -msgstr "" +msgstr "Выбрать внешний вид" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "progress:" -msgstr "" +msgstr "прогресс:" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "%" -msgstr "" +msgstr "%" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "" "Click on the functionalites listed below to launch them and configure your " "system" msgstr "" +"Нажмите на списке функций ниже для их запуска и конфигурации вашей системы" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Welcome to OpenERP" -msgstr "" +msgstr "Добро пожаловать в OpenERP" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Remember to bookmark this page." -msgstr "" +msgstr "Не забудьте добавить эту страницу в закладки." #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Remember your login:" -msgstr "" +msgstr "Запомните ваш логин:" #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Choose the first OpenERP Application you want to install.." -msgstr "" +msgstr "Выберите первое приложение которое Вы хотите установить в OpenERP." #: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 msgid "Please choose the first application to install." -msgstr "" +msgstr "Пожалуйста, выберите первое приложение для установки." diff --git a/addons/web_dashboard/po/zh_CN.po b/addons/web_dashboard/po/zh_CN.po new file mode 100644 index 00000000000..c8701dd375e --- /dev/null +++ b/addons/web_dashboard/po/zh_CN.po @@ -0,0 +1,76 @@ +# Chinese (Simplified) translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-12 05:35+0000\n" +"Last-Translator: Wei \"oldrev\" Li \n" +"Language-Team: Chinese (Simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-13 05:01+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_dashboard/static/src/js/dashboard.js:63 +msgid "Edit Layout" +msgstr "编辑布局" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Reset" +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 " " +msgstr " " + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Create" +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 "%" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "" +"Click on the functionalites listed below to launch them and configure your " +"system" +msgstr "" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Welcome to OpenERP" +msgstr "欢迎使用 OpenERP" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Remember to bookmark this page." +msgstr "请记住收藏此页" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Remember your login:" +msgstr "记住您的用户名:" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "选择您想安装的第一个 OpenERP 应用:" + +#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0 +msgid "Please choose the first application to install." +msgstr "请选择第一个要安装的应用。" diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 28ea12796d2..ac5b15b5c5a 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -290,14 +290,16 @@ openerp.web_dashboard.ConfigOverview = openerp.web.View.extend({ start: function () { this._super(); var self = this; - return this.user.read_index(['groups_id']).pipe(function (record) { + return this.user.read_index(['groups_id']).pipe(function(record) { var todos_filter = [ ['type', '!=', 'automatic'], '|', ['groups_id', '=', false], ['groups_id', 'in', record['groups_id']]]; return $.when( - self.dataset.read_slice(['state', 'action_id', 'category_id'],{ - domain: todos_filter }), + self.dataset.read_slice( + ['state', 'action_id', 'category_id'], + { domain: todos_filter } + ), self.dataset.call('progress').pipe( function (arg) { return arg; }, null)) }, null).then(this.on_records_loaded); @@ -373,8 +375,8 @@ openerp.web_dashboard.Widget = openerp.web.View.extend(/** @lends openerp.web_da }, start: function () { this._super(); - return new openerp.web.DataSet(this, 'res.widget').read_ids( - [this.widget_id], ['title'], this.on_widget_loaded); + var ds = new openerp.web.DataSet(this, 'res.widget'); + return ds.read_ids([this.widget_id], ['title']).then(this.on_widget_loaded); }, on_widget_loaded: function (widgets) { var widget = widgets[0]; @@ -403,7 +405,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({ openerp.webclient.menu.do_hide_secondary(); var domain = [['application','=',true], ['state','=','installed'], ['name', '!=', 'base']]; var ds = new openerp.web.DataSetSearch(this, 'ir.module.module',{},domain); - ds.read_slice(['id'], {}, function(result) { + ds.read_slice(['id']).then(function(result) { if(result.length) { self.on_installed_database(); } else { @@ -418,7 +420,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({ on_installed_database: function() { var self = this; var ds = new openerp.web.DataSetSearch(this, 'ir.ui.menu', null, [['parent_id', '=', false]]); - var r = ds.read_slice( ['name', 'web_icon_data', 'web_icon_hover_data', 'module'], {}, function (applications) { + var r = ds.read_slice( ['name', 'web_icon_data', 'web_icon_hover_data', 'module']).then(function (applications) { //// Create a matrix of 3*x applications //var rows = []; //while (applications.length) { diff --git a/addons/web_dashboard/static/src/xml/web_dashboard.xml b/addons/web_dashboard/static/src/xml/web_dashboard.xml index 5d503d94f1e..4db96d5ebbe 100644 --- a/addons/web_dashboard/static/src/xml/web_dashboard.xml +++ b/addons/web_dashboard/static/src/xml/web_dashboard.xml @@ -73,10 +73,10 @@ t-att-class="todo.done ? 'oe-done' : undefined" t-att-data-id="todo.id" t-att-title="!todo.done ? 'Execute task \'' + todo.name + '\'' : undefined"> + - diff --git a/addons/web_default_home/po/pt.po b/addons/web_default_home/po/pt.po new file mode 100644 index 00000000000..87246cf0bbe --- /dev/null +++ b/addons/web_default_home/po/pt.po @@ -0,0 +1,38 @@ +# Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +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: 2012-01-14 23:15+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-15 05:35+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "" diff --git a/addons/web_default_home/po/pt_BR.po b/addons/web_default_home/po/pt_BR.po new file mode 100644 index 00000000000..286fdf4f1e0 --- /dev/null +++ b/addons/web_default_home/po/pt_BR.po @@ -0,0 +1,38 @@ +# Brazilian Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +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: 2012-01-16 02:08+0000\n" +"Last-Translator: Rafael Sales \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-16 05:27+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "Bem-vindo à sua nova instância OpenERP." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "Lembre-se de adicionar esta página as seus favoritos." + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "Lembre-se de seu login:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "Escolha a primeira Aplicação OpenERP que você deseja 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/ru.po b/addons/web_default_home/po/ru.po index 763545e2c86..14e4e28b370 100644 --- a/addons/web_default_home/po/ru.po +++ b/addons/web_default_home/po/ru.po @@ -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-12-02 07:13+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2012-01-13 12:25+0000\n" +"Last-Translator: Aleksei Motsik \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Welcome to your new OpenERP instance." -msgstr "" +msgstr "Приветствуем Вас в новом окружении OpenERP." #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Remember to bookmark this page." -msgstr "" +msgstr "Не забудьте добавить эту страницу в закладки." #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Remember your login:" -msgstr "" +msgstr "Запомните ваш логин:" #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Choose the first OpenERP Application you want to install.." -msgstr "" +msgstr "Выберите первое приложение которое Вы хотите установить в OpenERP." #: addons/web_default_home/static/src/xml/web_default_home.xml:0 msgid "Install" -msgstr "" +msgstr "Установить" diff --git a/addons/web_default_home/po/zh_CN.po b/addons/web_default_home/po/zh_CN.po new file mode 100644 index 00000000000..d1097082290 --- /dev/null +++ b/addons/web_default_home/po/zh_CN.po @@ -0,0 +1,38 @@ +# Chinese (Simplified) translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +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: 2012-01-12 05:34+0000\n" +"Last-Translator: Wei \"oldrev\" Li \n" +"Language-Team: Chinese (Simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-13 05:01+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Welcome to your new OpenERP instance." +msgstr "欢迎使用您的新 OpenERP 实例。" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember to bookmark this page." +msgstr "请记住收藏此页" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Remember your login:" +msgstr "记住您的用户名:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Choose the first OpenERP Application you want to install.." +msgstr "选择您想安装的第一个 OpenERP 应用:" + +#: addons/web_default_home/static/src/xml/web_default_home.xml:0 +msgid "Install" +msgstr "安装" diff --git a/addons/web_diagram/__openerp__.py b/addons/web_diagram/__openerp__.py index b301b149923..f46b17614b4 100644 --- a/addons/web_diagram/__openerp__.py +++ b/addons/web_diagram/__openerp__.py @@ -3,7 +3,7 @@ "category" : "Hidden", "description":'Openerp web Diagram view', "version" : "2.0", - "depends" : ["base"], + "depends" : ["web"], "js": [ 'static/lib/js/raphael-min.js', 'static/lib/js/dracula_graffle.js', diff --git a/addons/web_diagram/controllers/main.py b/addons/web_diagram/controllers/main.py index 55047804725..28f31ac0c19 100644 --- a/addons/web_diagram/controllers/main.py +++ b/addons/web_diagram/controllers/main.py @@ -10,7 +10,8 @@ class DiagramView(View): return {'fields_view': fields_view} @openerpweb.jsonrequest - def get_diagram_info(self, req, id, model, node, connector, src_node, des_node, **kw): + def get_diagram_info(self, req, id, model, node, connector, + src_node, des_node, label, **kw): visible_node_fields = kw.get('visible_node_fields',[]) invisible_node_fields = kw.get('invisible_node_fields',[]) @@ -36,8 +37,9 @@ class DiagramView(View): shapes[shape_colour] = shape_color_state ir_view = req.session.model('ir.ui.view') - graphs = ir_view.graph_get(int(id), model, node, connector, src_node, des_node, False, - (140, 180), req.session.context) + graphs = ir_view.graph_get( + int(id), model, node, connector, src_node, des_node, label, + (140, 180), req.session.context) nodes = graphs['nodes'] transitions = graphs['transitions'] isolate_nodes = {} @@ -62,15 +64,16 @@ class DiagramView(View): data_connectors =connector_tr.read(connector_ids, connector_fields, req.session.context) - for tr in data_connectors: - t = connectors.get(str(tr['id'])) - t.update({ - 'source': tr[src_node][1], - 'destination': tr[des_node][1], - 'options': {}, - 'signal': tr['signal'] - }) + transition_id = str(tr['id']) + _sourceid, label = graphs['label'][transition_id] + t = connectors[transition_id] + t.update( + source=tr[src_node][1], + destination=tr[des_node][1], + options={}, + signal=label + ) for i, fld in enumerate(connector_fields): t['options'][connector_fields_string[i]] = tr[fld] @@ -87,7 +90,7 @@ class DiagramView(View): if not n: n = isolate_nodes.get(act['id'], {}) y_max += 140 - n.update({'x': 20, 'y': y_max}) + n.update(x=20, y=y_max) nodes[act['id']] = n n.update( diff --git a/addons/web_diagram/po/pt_BR.po b/addons/web_diagram/po/pt_BR.po new file mode 100644 index 00000000000..cde28ccf8cd --- /dev/null +++ b/addons/web_diagram/po/pt_BR.po @@ -0,0 +1,59 @@ +# Brazilian Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-15 02:37+0000\n" +"Last-Translator: Renato Lima - http://www.akretion.com " +"\n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-16 05:27+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_diagram/static/src/js/diagram.js:11 +msgid "Diagram" +msgstr "Diagrama" + +#: addons/web_diagram/static/src/js/diagram.js:210 +msgid "Cancel" +msgstr "Cancelar" + +#: addons/web_diagram/static/src/js/diagram.js:211 +msgid "Save" +msgstr "Salvar" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Node" +msgstr "Novo Nó" + +#: 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/ru.po b/addons/web_diagram/po/ru.po index ab6df8c1736..2cafec8961d 100644 --- a/addons/web_diagram/po/ru.po +++ b/addons/web_diagram/po/ru.po @@ -8,51 +8,51 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2011-12-02 07:14+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2012-01-13 12:36+0000\n" +"Last-Translator: Aleksei Motsik \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:18+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" #: addons/web_diagram/static/src/js/diagram.js:11 msgid "Diagram" -msgstr "" +msgstr "Диаграмма" #: addons/web_diagram/static/src/js/diagram.js:210 msgid "Cancel" -msgstr "" +msgstr "Отмена" #: addons/web_diagram/static/src/js/diagram.js:211 msgid "Save" -msgstr "" +msgstr "Сохранить" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "New Node" -msgstr "" +msgstr "Новый узел" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "First" -msgstr "" +msgstr "Первый" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "<<" -msgstr "" +msgstr "<<" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "0" -msgstr "" +msgstr "0" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "/" -msgstr "" +msgstr "/" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid ">>" -msgstr "" +msgstr ">>" #: addons/web_diagram/static/src/xml/base_diagram.xml:0 msgid "Last" -msgstr "" +msgstr "Последний" diff --git a/addons/web_diagram/po/zh_CN.po b/addons/web_diagram/po/zh_CN.po new file mode 100644 index 00000000000..63d570efe65 --- /dev/null +++ b/addons/web_diagram/po/zh_CN.po @@ -0,0 +1,58 @@ +# Chinese (Simplified) translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-12 05:36+0000\n" +"Last-Translator: Wei \"oldrev\" Li \n" +"Language-Team: Chinese (Simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-13 05:01+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_diagram/static/src/js/diagram.js:11 +msgid "Diagram" +msgstr "" + +#: addons/web_diagram/static/src/js/diagram.js:210 +msgid "Cancel" +msgstr "取消" + +#: addons/web_diagram/static/src/js/diagram.js:211 +msgid "Save" +msgstr "保存" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "New Node" +msgstr "新建节点" + +#: addons/web_diagram/static/src/xml/base_diagram.xml:0 +msgid "First" +msgstr "第一个" + +#: 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 "最后一个" diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js index a92eb8c2895..ddc88d920de 100644 --- a/addons/web_diagram/static/src/js/diagram.js +++ b/addons/web_diagram/static/src/js/diagram.js @@ -74,6 +74,7 @@ openerp.web.DiagramView = openerp.web.View.extend({ 'shape': this.nodes.attrs.shape, 'src_node': this.connectors.attrs.source, 'des_node': this.connectors.attrs.destination, + 'label': this.connectors.attrs.label || false, 'visible_nodes': [], 'invisible_nodes': [], 'node_fields': [], @@ -202,38 +203,40 @@ openerp.web.DiagramView = openerp.web.View.extend({ model = self.node; if(id) id = parseInt(id, 10); - var action_manager = new openerp.web.ActionManager(this); - var dialog = new openerp.web.Dialog(this, { - width: 850, - buttons : [ - {text: _t("Cancel"), click: function() { $(this).dialog('destroy'); }}, - {text: _t("Save"), click: function() { - var form_view = action_manager.inner_viewmanager.views.form.controller; - - form_view.do_save(function() { - self.dataset.read_index(_.keys(self.fields_view.fields), self.on_diagram_loaded); - }); - $(this).dialog('destroy'); - } + + var pop, + title = model == self.node ? _t('Activity') : _t('Transition'); + if(!id) { + pop = new openerp.web.form.SelectCreatePopup(this); + pop.select_element( + model, + { + title: _t("Create:") + title, + initial_view: 'form', + disable_multiple_selection: true + }, + this.dataset.domain, + this.context || this.dataset.context + ); + pop.on_select_elements.add_last(function(element_ids) { + self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); + }); + } else { + pop = new openerp.web.form.FormOpenPopup(this); + pop.show_element( + model, + id, + this.context || this.dataset.context, + { + title: _t("Open: ") + title } - ] - }).start().open(); - action_manager.appendTo(dialog.$element); - action_manager.do_action({ - res_model : model, - res_id: id, - views : [[false, 'form']], - type : 'ir.actions.act_window', - flags : { - search_view: false, - sidebar : false, - views_switcher : false, - action_buttons : false, - pager: false - } - }); + ); + pop.on_write.add(function() { + self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); + }); + } - var form_controller = action_manager.inner_viewmanager.views.form.controller; + var form_controller = pop.view_form; var form_fields; @@ -270,6 +273,8 @@ openerp.web.DiagramView = openerp.web.View.extend({ }); }); } + + }, on_pager_action: function(action) { @@ -287,7 +292,7 @@ openerp.web.DiagramView = openerp.web.View.extend({ this.dataset.index = this.dataset.ids.length - 1; break; } - this.dataset.read_index(_.keys(this.fields_view.fields), this.on_diagram_loaded); + this.dataset.read_index(_.keys(this.fields_view.fields)).pipe(this.on_diagram_loaded); this.do_update_pager(); }, diff --git a/addons/web_gantt/po/pt_BR.po b/addons/web_gantt/po/pt_BR.po new file mode 100644 index 00000000000..73c64af6f46 --- /dev/null +++ b/addons/web_gantt/po/pt_BR.po @@ -0,0 +1,35 @@ +# Brazilian Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-15 02:42+0000\n" +"Last-Translator: Renato Lima - http://www.akretion.com " +"\n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-16 05:27+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_gantt/static/src/js/gantt.js:10 +msgid "Gantt" +msgstr "Gantt" + +#: addons/web_gantt/static/src/js/gantt.js:51 +msgid "date_start is not defined " +msgstr "data_inicial não definida " + +#: addons/web_gantt/static/src/js/gantt.js:110 +msgid "date_start is not defined" +msgstr "data_inicial não definida" + +#: addons/web_gantt/static/src/xml/web_gantt.xml:0 +msgid "Create" +msgstr "Criar" diff --git a/addons/web_gantt/po/ru.po b/addons/web_gantt/po/ru.po new file mode 100644 index 00000000000..f57a3664e11 --- /dev/null +++ b/addons/web_gantt/po/ru.po @@ -0,0 +1,34 @@ +# Russian translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-13 12:34+0000\n" +"Last-Translator: Aleksei Motsik \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_gantt/static/src/js/gantt.js:10 +msgid "Gantt" +msgstr "Диаграмма Ганта" + +#: addons/web_gantt/static/src/js/gantt.js:51 +msgid "date_start is not defined " +msgstr "date_start не задана " + +#: addons/web_gantt/static/src/js/gantt.js:110 +msgid "date_start is not defined" +msgstr "date_start не задана" + +#: addons/web_gantt/static/src/xml/web_gantt.xml:0 +msgid "Create" +msgstr "Создать" diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 2b84f18ac88..77bb6df4397 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -111,7 +111,7 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({ var name = started_projects[0][self.parent]; self.name = name instanceof Array? name[name.length - 1] : name; } - this.$element.find('#add_task').click(function(){ + this.$element.find('#add_task').click(function() { self.editTask(); }); @@ -364,19 +364,38 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({ } if(event_id) event_id = parseInt(event_id, 10); - var pop = new openerp.web.form.FormOpenPopup(this); - - pop.show_element(this.model, event_id, this.context || this.dataset.context, {}); - - pop.on_write.add(function(id, data) { - var get_project = _.find(self.database_projects, function(project){ return project.id == id}); - if (get_project) { - _.extend(get_project, data); - } else { - _.extend(self.database_projects, _.extend(data, {'id': id})); - } - self.reloadView(); - }); + if (!event_id) { + var pop = new openerp.web.form.SelectCreatePopup(this); + pop.select_element( + this.model, + { + title: _t("Create: ") + this.name, + initial_view: 'form', + disable_multiple_selection: true + }, + this.dataset.domain, + this.context || this.dataset.context + ) + pop.on_select_elements.add_last(function(element_ids) { + self.dataset.read_ids(element_ids,[]).done(function(projects) { + self.database_projects.concat(projects); + self.reloadView(); + }); + }); + } + else { + var pop = new openerp.web.form.FormOpenPopup(this); + pop.show_element(this.model, event_id, this.context || this.dataset.context, {'title' : _t("Open: ") + this.name}); + pop.on_write.add(function(id, data) { + var get_project = _.find(self.database_projects, function(project){ return project.id == id}); + if (get_project) { + _.extend(get_project, data); + } else { + _.extend(self.database_projects, _.extend(data, {'id': id})); + } + self.reloadView(); + }); + } }, set_width: function() { @@ -506,12 +525,17 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({ if (groupbys.length) { this.group_by = groupbys; } - + var fields = _.compact(_.map(this.fields_view.arch.attrs,function(value,key) { + if (key != 'string' && key != 'default_group_by') { + return value || ''; + } + })); + fields = _.uniq(fields.concat(_.keys(this.fields), this.text, this.group_by)); $.when(this.has_been_loaded).then(function() { - self.dataset.read_slice([], { + self.dataset.read_slice(fields, { domain: domains, context: contexts - }).done(function(projects){ + }).done(function(projects) { self.on_project_loaded(projects); }); }); diff --git a/addons/web_graph/po/pt.po b/addons/web_graph/po/pt.po new file mode 100644 index 00000000000..6ce12a881da --- /dev/null +++ b/addons/web_graph/po/pt.po @@ -0,0 +1,22 @@ +# Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-14 23:18+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-15 05:35+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "" diff --git a/addons/web_graph/po/pt_BR.po b/addons/web_graph/po/pt_BR.po new file mode 100644 index 00000000000..a75c7c9b6b4 --- /dev/null +++ b/addons/web_graph/po/pt_BR.po @@ -0,0 +1,22 @@ +# Brazilian Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-10 11:03+0000\n" +"Last-Translator: Rafael Sales \n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-11 04:55+0000\n" +"X-Generator: Launchpad (build 14640)\n" + +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "Gráfico" diff --git a/addons/web_graph/po/ru.po b/addons/web_graph/po/ru.po new file mode 100644 index 00000000000..ba41964bd03 --- /dev/null +++ b/addons/web_graph/po/ru.po @@ -0,0 +1,22 @@ +# Russian translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-13 11:41+0000\n" +"Last-Translator: Aleksei Motsik \n" +"Language-Team: Russian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\n" + +#: addons/web_graph/static/src/js/graph.js:19 +msgid "Graph" +msgstr "График" diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 30a10eee73a..b7eed2dcdc3 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -422,7 +422,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ } else { self.abscissa = self.first_field; } - return self.dataset.read_slice(self.list_fields(), {}, $.proxy(self, 'schedule_chart')); + return self.dataset.read_slice(self.list_fields()).then($.proxy(self, 'schedule_chart')); }); }, diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 00a63f82e1d..5e5abfb292b 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -162,7 +162,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ group_aggregates[value] = group.aggregates[key]; }); var dataset = new openerp.web.DataSetSearch(self, self.dataset.model, group.context, group.domain); - dataset.read_slice(self.fields_keys, {'domain': group.domain, 'context': group.context}, function(records) { + dataset.read_slice(self.fields_keys, {'domain': group.domain, 'context': group.context}).then(function(records) { self.dataset.ids.push.apply(self.dataset.ids, dataset.ids); groups_array[index] = new openerp.web_kanban.KanbanGroup(self, records, group_value, group_name, group_aggregates); if (!remaining--) { @@ -175,7 +175,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ do_process_dataset: function(dataset) { var self = this; this.do_clear_groups(); - this.dataset.read_slice(this.fields_keys, {}, function(records) { + this.dataset.read_slice(this.fields_keys).then(function(records) { var groups = []; while (records.length) { for (var i = 0; i < self.default_nr_columns; i++) { @@ -491,7 +491,7 @@ openerp.web_kanban.KanbanRecord = openerp.web.Widget.extend({ }, do_reload: function() { var self = this; - this.view.dataset.read_ids([this.id], this.view.fields_keys, function(records) { + this.view.dataset.read_ids([this.id], this.view.fields_keys).then(function(records) { if (records.length) { self.set_record(records[0]); self.do_render(); diff --git a/addons/web_mobile/po/pt_BR.po b/addons/web_mobile/po/pt_BR.po new file mode 100644 index 00000000000..2532c63ed24 --- /dev/null +++ b/addons/web_mobile/po/pt_BR.po @@ -0,0 +1,75 @@ +# Brazilian Portuguese translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-15 02:40+0000\n" +"Last-Translator: Renato Lima - http://www.akretion.com " +"\n" +"Language-Team: Brazilian Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-16 05:27+0000\n" +"X-Generator: Launchpad (build 14664)\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 "Banco de Dados:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login:" +msgstr "Login:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Password:" +msgstr "Senha:" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Login" +msgstr "Login" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Bad username or password" +msgstr "Nome de usuário ou senha inválido" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Powered by openerp.com" +msgstr "Desenvolvido por openerp.com" + +#: 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 "Preferências" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Logout" +msgstr "Sair" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "There are no records to show." +msgstr "Não há registro para visualizar." + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr ":" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "On" +msgstr "Ativo" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Off" +msgstr "Desativado" diff --git a/addons/web_mobile/po/ru.po b/addons/web_mobile/po/ru.po index 35530285323..9545e935e0e 100644 --- a/addons/web_mobile/po/ru.po +++ b/addons/web_mobile/po/ru.po @@ -8,67 +8,67 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-20 18:48+0100\n" -"PO-Revision-Date: 2011-12-02 07:20+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2012-01-13 11:44+0000\n" +"Last-Translator: Aleksei Motsik \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-01-04 05:18+0000\n" -"X-Generator: Launchpad (build 14616)\n" +"X-Launchpad-Export-Date: 2012-01-14 05:40+0000\n" +"X-Generator: Launchpad (build 14664)\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 "База данных:" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Login:" -msgstr "" +msgstr "Имя пользователя:" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Password:" -msgstr "" +msgstr "Пароль:" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Login" -msgstr "" +msgstr "Войти" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Bad username or password" -msgstr "" +msgstr "Неверное имя пользователя или пароль" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Powered by openerp.com" -msgstr "" +msgstr "На платформе openerp.com" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Favourite" -msgstr "" +msgstr "Закладки" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Preference" -msgstr "" +msgstr "Настройки" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Logout" -msgstr "" +msgstr "Завершить сеанс" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "There are no records to show." -msgstr "" +msgstr "Нечего показывать." #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid ":" -msgstr "" +msgstr ":" #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "On" -msgstr "" +msgstr "Вкл." #: addons/web_mobile/static/src/xml/web_mobile.xml:0 msgid "Off" -msgstr "" +msgstr "Откл." diff --git a/addons/web_mobile/po/zh_CN.po b/addons/web_mobile/po/zh_CN.po new file mode 100644 index 00000000000..fb44ad87bbd --- /dev/null +++ b/addons/web_mobile/po/zh_CN.po @@ -0,0 +1,74 @@ +# Chinese (Simplified) translation for openerp-web +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-20 18:48+0100\n" +"PO-Revision-Date: 2012-01-12 05:34+0000\n" +"Last-Translator: Wei \"oldrev\" Li \n" +"Language-Team: Chinese (Simplified) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-01-13 05:01+0000\n" +"X-Generator: Launchpad (build 14664)\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 "数据库:" + +#: 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 "Powered by openerp.com" +msgstr "由 openerp.com 驱动" + +#: 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 "Logout" +msgstr "注销" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "There are no records to show." +msgstr "无可用数据。" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid ":" +msgstr ":" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "On" +msgstr "开" + +#: addons/web_mobile/static/src/xml/web_mobile.xml:0 +msgid "Off" +msgstr "关" diff --git a/addons/web_mobile/static/src/js/form_mobile.js b/addons/web_mobile/static/src/js/form_mobile.js index 56754491c95..84eccd41dc5 100644 --- a/addons/web_mobile/static/src/js/form_mobile.js +++ b/addons/web_mobile/static/src/js/form_mobile.js @@ -27,7 +27,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ } 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) { + this.dataset.read_slice([]).then(function (result) { for (var i = 0; i < result.length; i++) { if (result[i].id == id) { self.datarecord = result[i]; @@ -73,7 +73,7 @@ openerp.web_mobile.FormView = openerp.web.Widget.extend({ var list_ids = []; var datasearch = new openerp.web.DataSetSearch(self, rel_field.relation, rel_field.context); datasearch.domain=[['id', 'in', rel_ids]]; - datasearch.read_slice(['name'], {context:rel_field.context, domain: datasearch.domain, limit:80}, function(listrec){ + datasearch.read_slice(['name'], {context:rel_field.context, domain: datasearch.domain, limit:80}).then(function(listrec){ _.each(listrec, function(i) { list_ids.push(i.id); }); diff --git a/addons/web_mobile/static/src/js/list_mobile.js b/addons/web_mobile/static/src/js/list_mobile.js index e6bbfb12f48..7c7b7b33c15 100644 --- a/addons/web_mobile/static/src/js/list_mobile.js +++ b/addons/web_mobile/static/src/js/list_mobile.js @@ -33,7 +33,7 @@ openerp.web_mobile.ListView = openerp.web.Widget.extend({ var list_ids = []; var datasearch = new openerp.web.DataSetSearch(self, self.action.res_model,self.action.context); datasearch.domain = self.action.domain; - datasearch.read_slice(['name'], {context:datasearch.context, domain: datasearch.domain, limit:80}, function(listresult){ + datasearch.read_slice(['name'], {context:datasearch.context, domain: datasearch.domain, limit:80}).then(function(listresult){ _.each(listresult, function(i) { list_ids.push(i.id); }); diff --git a/addons/web_process/static/src/js/process.js b/addons/web_process/static/src/js/process.js index 8d4396ba403..601973d4cb5 100644 --- a/addons/web_process/static/src/js/process.js +++ b/addons/web_process/static/src/js/process.js @@ -28,8 +28,7 @@ openerp.web_process = function (openerp) { }, initialize_process_view: function() { var self = this; - $.when(this.fields_get(), this.help(), this.get_process_object()).pipe(function(fields, help, process) { - self.process_fields = fields; + $.when(this.help(), this.get_process_object()).pipe(function(help, process) { self.process_help = help; if(process && process.length) { if(process.length > 1) { @@ -46,9 +45,9 @@ openerp.web_process = function (openerp) { self.graph_get().done(function(res) { self.process_notes = res.notes; self.process_title = res.name; - self.process_subflows = _.filter(res.nodes, function(x) { - return x.subflow != false; - }); + self.process_subflows = _(res.nodes).chain() + .filter(function (node) { return node['subflow'] !== false; }) + .uniq(false, function (node) { return node['subflow'][0]; }).value(); self.process_related = res.related; def.resolve(res); }); @@ -78,17 +77,6 @@ openerp.web_process = function (openerp) { }); return def.promise(); }, - fields_get : function() { - var self = this, - def = $.Deferred(), - dataset = new openerp.web.DataSetStatic(this, this.model || this.dataset.model, this.session.context); - dataset - .call('fields_get',[]) - .done(function(fields) { - def.resolve(fields); - }).fail(def.reject); - return def.promise(); - }, help : function() { var self = this, def = $.Deferred(); @@ -145,11 +133,6 @@ openerp.web_process = function (openerp) { self.initialize_process_view(); }); - this.$element.find(".toggle_fields").click(function() { - $(this).children().toggle(); - self.$element.find('.process_fields').toggle(); - }); - this.$element.find(".process_subflow").click(function() { self.process_id = this.id; self.initialize_process_view(); @@ -286,7 +269,7 @@ openerp.web_process = function (openerp) { $(this).dialog('destroy'); }} ] - }).start().open(); + }).open(); action_manager.appendTo(dialog.$element); action_manager.do_action({ diff --git a/addons/web_process/static/src/xml/web_process.xml b/addons/web_process/static/src/xml/web_process.xml index e1e2e7a6e8d..d6d2e73715b 100644 --- a/addons/web_process/static/src/xml/web_process.xml +++ b/addons/web_process/static/src/xml/web_process.xml @@ -107,37 +107,6 @@ - - - - - - - - - - - - -
- - - - - - - - - -
- : - - -
-