diff --git a/Makefile b/Makefile index 9e84e356aaf..4beb20d3eed 100644 --- a/Makefile +++ b/Makefile @@ -29,3 +29,6 @@ doc: cloc: cloc addons/*/common/*.py addons/*/controllers/*.py addons/*/static/src/*.js addons/*/static/src/js/*.js addons/*/static/src/css/*.css addons/*/static/src/xml/*.xml +blamestat: + echo addons/*/common/*.py addons/*/controllers/*.py addons/*/static/src/js/*.js addons/*/static/src/css/*.css addons/*/static/src/xml/*.xml | xargs -t -n 1 bzr blame -v --long --all | awk '{print $2}' | sort | uniq -c | sort -n + diff --git a/addons/web/common/http.py b/addons/web/common/http.py index ac9b95dcb26..016aff3754e 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -145,21 +145,22 @@ class JsonRequest(WebRequest): jsonp = args.get('jsonp') requestf = None request = None + request_id = args.get('id') if jsonp and self.httprequest.method == 'POST': # jsonp 2 steps step1 POST: save call self.init(args) - req.session.jsonp_requests[args.get('id')] = self.httprequest.form['r'] + self.session.jsonp_requests[request_id] = self.httprequest.form['r'] headers=[('Content-Type', 'text/plain; charset=utf-8')] r = werkzeug.wrappers.Response(request_id, headers=headers) return r elif jsonp and args.get('r'): # jsonp method GET request = args.get('r') - elif jsonp and args.get('id'): + elif jsonp and request_id: # jsonp 2 steps step2 GET: run and return result self.init(args) - request = self.session.jsonp_requests.pop(args.get(id), "") + request = self.session.jsonp_requests.pop(request_id, "") else: # regular jsonrpc2 requestf = self.httprequest.stream @@ -354,7 +355,7 @@ def session_context(request, storage_path, session_cookie='sessionid'): # Remove all OpenERPSession instances with no uid, they're generated # either by login process or by HTTP requests without an OpenERP # session id, and are generally noise - removed_sessions = [] + removed_sessions = set() for key, value in request.session.items(): if (isinstance(value, session.OpenERPSession) and not value._uid @@ -362,7 +363,7 @@ def session_context(request, storage_path, session_cookie='sessionid'): and value._creation_time + (60*5) < time.time() # FIXME do not use a fixed value ): _logger.debug('remove session %s', key) - removed_sessions.append(key) + removed_sessions.add(key) del request.session[key] with session_lock: diff --git a/addons/web/controllers/main.html b/addons/web/controllers/main.html deleted file mode 100644 index fd0be5ba349..00000000000 --- a/addons/web/controllers/main.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - OpenERP - - %(css)s - %(js)s - - - - - - \ No newline at end of file diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 7f5b43ba671..26e7d6baba6 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -6,6 +6,7 @@ import csv import glob import itertools import operator +import datetime import os import re import simplejson @@ -84,9 +85,24 @@ def concat_files(file_list, reader=None, intersperse=""): files_concat = intersperse.join(files_content) return files_concat,files_timestamp -html_template = None -with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "main.html")) as html_file: - html_template = html_file.read() +html_template = """ + + + + OpenERP + + %(css)s + %(js)s + + + + +""" class WebClient(openerpweb.Controller): _cp_path = "/web/webclient" @@ -192,6 +208,7 @@ class WebClient(openerpweb.Controller): 'js': js, 'css': css, 'modules': simplejson.dumps(self.server_wide_modules(req)), + 'init': 'new s.web.WebClient().start();', } return r @@ -323,9 +340,14 @@ class Database(openerpweb.Controller): def backup(self, req, backup_db, backup_pwd, token): db_dump = base64.b64decode( req.session.proxy("db").dump(backup_pwd, backup_db)) + filename = "%(db)s_%(timestamp)s.dump" % { + 'db': backup_db, + 'timestamp': datetime.datetime.utcnow().strftime( + "%Y-%m-%d_%H-%M-%SZ") + } return req.make_response(db_dump, [('Content-Type', 'application/octet-stream; charset=binary'), - ('Content-Disposition', 'attachment; filename="' + backup_db + '.dump"')], + ('Content-Disposition', 'attachment; filename="' + filename + '"')], {'fileToken': int(token)} ) @@ -858,7 +880,7 @@ class DataSet(openerpweb.Controller): :return: result of the onchange call with all domains parsed """ result = self.call_common(req, model, method, args, context_id=context_id) - if 'domain' not in result: + if not result or 'domain' not in result: return result result['domain'] = dict( diff --git a/addons/web/po/hr.po b/addons/web/po/hr.po index a7c2724ca1c..e9b35d6768d 100644 --- a/addons/web/po/hr.po +++ b/addons/web/po/hr.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-21 15:10+0000\n" -"Last-Translator: Goran Kliska \n" +"PO-Revision-Date: 2012-01-23 17:37+0000\n" +"Last-Translator: Goran Cvijanović \n" "Language-Team: Croatian \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-24 05:44+0000\n" +"X-Generator: Launchpad (build 14713)\n" #: addons/web/static/src/js/chrome.js:162 #: addons/web/static/src/js/chrome.js:175 @@ -107,7 +107,7 @@ msgstr "Neispravno traženje" #: addons/web/static/src/js/search.js:403 msgid "triggered from search view" -msgstr "" +msgstr "pokrenuto iz ekrana za pretraživanje" #: addons/web/static/src/js/search.js:490 #, python-format @@ -206,7 +206,7 @@ msgstr "je laž" #: addons/web/static/src/js/view_editor.js:42 msgid "ViewEditor" -msgstr "" +msgstr "Uređivač" #: addons/web/static/src/js/view_editor.js:46 #: addons/web/static/src/js/view_list.js:17 @@ -538,20 +538,23 @@ msgid "" "We think that daily job activities can be more intuitive, efficient, " "automated, .. and even fun." msgstr "" +"Mi smatramo da dnevne poslovne aktivnosti mogu biti intuitivnije, " +"efikasnije, automatizirane, .. i zabavne." #: addons/web/static/src/xml/base.xml:0 msgid "OpenERP's vision to be:" -msgstr "" +msgstr "Vizija OpenERP-a da postane:" #: addons/web/static/src/xml/base.xml:0 msgid "Full featured" -msgstr "" +msgstr "Pune funkcionalnosti" #: addons/web/static/src/xml/base.xml:0 msgid "" "Today's enterprise challenges are multiple. We provide one module for each " "need." msgstr "" +"Mnoštvo je izazova danas pred tvrtkama. Mi imamo modul za svaku od potreba." #: addons/web/static/src/xml/base.xml:0 msgid "Open Source" @@ -562,15 +565,18 @@ msgid "" "To Build a great product, we rely on the knowledge of thousands of " "contributors." msgstr "" +"Za izgradnju vrhunskog rješenja, osanjamo se na znanja tisuće kontributora." #: addons/web/static/src/xml/base.xml:0 msgid "User Friendly" -msgstr "" +msgstr "prilagođen korisniku" #: addons/web/static/src/xml/base.xml:0 msgid "" "In order to be productive, people need clean and easy to use interface." msgstr "" +"Da bi bili produktivni, ljudi trebaju uredno i jednostavno korisničko " +"sučelje." #: addons/web/static/src/xml/base.xml:0 msgid "(" @@ -618,7 +624,7 @@ msgstr "Debug pogled#" #: addons/web/static/src/xml/base.xml:0 msgid "- Fields View Get" -msgstr "" +msgstr "Dohvat polja ekrana" #: addons/web/static/src/xml/base.xml:0 msgid "- Edit" @@ -630,11 +636,11 @@ msgstr "Pogled" #: addons/web/static/src/xml/base.xml:0 msgid "- Edit SearchView" -msgstr "" +msgstr "Uredi ekran za pretraživanje" #: addons/web/static/src/xml/base.xml:0 msgid "- Edit Action" -msgstr "" +msgstr "- Uredi akciju" #: addons/web/static/src/xml/base.xml:0 msgid "Field" @@ -662,11 +668,11 @@ msgstr "Dupliciraj" #: addons/web/static/src/xml/base.xml:0 msgid "Unhandled widget" -msgstr "" +msgstr "Nepodržani ekranski dodatak" #: addons/web/static/src/xml/base.xml:0 msgid "Notebook Page \"" -msgstr "" +msgstr "Stranica \"" #: addons/web/static/src/xml/base.xml:0 msgid "\"" @@ -674,7 +680,7 @@ msgstr "\"" #: addons/web/static/src/xml/base.xml:0 msgid "Modifiers:" -msgstr "" +msgstr "Izmjene:" #: addons/web/static/src/xml/base.xml:0 msgid "?" @@ -778,7 +784,7 @@ msgstr "Gumb" #: addons/web/static/src/xml/base.xml:0 msgid "(no string)" -msgstr "" +msgstr "(prazno)" #: addons/web/static/src/xml/base.xml:0 msgid "Special:" @@ -822,7 +828,7 @@ msgstr "(Zamjenit će postojeći filter istog naziva)" #: addons/web/static/src/xml/base.xml:0 msgid "Select Dashboard to add this filter to:" -msgstr "" +msgstr "Odaberite panel za dodati ovaj filter:" #: addons/web/static/src/xml/base.xml:0 msgid "Title of new Dashboard item:" @@ -867,6 +873,10 @@ msgid "" " You can export all data or only the fields that can be " "reimported after modification." msgstr "" +"Ovaj pomoćni program će izvesti u CSV datoteku sve podatke koji " +"zadovoljavaju postavljene uvjete.\n" +" Možete izvesti sve kolone ili samo one koje se mogu ponovno " +"učitati nakon izmjena." #: addons/web/static/src/xml/base.xml:0 msgid "Export Type:" @@ -937,6 +947,10 @@ msgid "" "Select a .CSV file to import. If you need a sample of file to import,\n" " you should use the export tool with the \"Import Compatible\" option." msgstr "" +"Odaberite .CSV datoteku za uvoz. Ukoliko trebate primjer za izgled " +"datoteke,\n" +" možete napraviti izvoz podataka koristeći \"Kompatibilnost za uvoz\" " +"opciju." #: addons/web/static/src/xml/base.xml:0 msgid "CSV File:" @@ -984,7 +998,7 @@ msgstr "Uvoz nije izvršen:" #: addons/web/static/src/xml/base.xml:0 msgid "Here is a preview of the file we could not import:" -msgstr "" +msgstr "Ovo je pregled datoteke koja se nije mogla uvesti:" #: addons/web/static/src/xml/base.xml:0 msgid "OpenERP Web" @@ -1031,6 +1045,12 @@ msgid "" "supply chain,\n" " project management, production, services, CRM, etc..." msgstr "" +"je slobodan poslovni softver dizajniran za unapređenje\n" +" produktivnost i profitabilnost kroz integraciju podataka. " +"Povezuje, unapređuje i\n" +" upravlja poslovnim procesima u područjima poput prodaje, " +"financija, nabave,\n" +" upravljanja projektima, proizvodnje, usluga, CRM, itd." #: addons/web/static/src/xml/base.xml:0 msgid "" @@ -1043,9 +1063,16 @@ msgid "" " production system and migration to a new version to be " "straightforward." msgstr "" +"Sustav je neovisan o platformi i može se instalirati na Windows, Mac OS X,\n" +" i različitim verzijama Linux i drugih Unix zasnovanih " +"distribucija. Arhitektura omogućava\n" +" brzo dodavanje novih funkcionalnosti, izmjene na produkcijskom " +"sustavu i,\n" +" olakšanu migraciju na nove verzije." #: addons/web/static/src/xml/base.xml:0 msgid "" "Depending on your needs, OpenERP is available through a web or application " "client." msgstr "" +"Ovisno o potrebama, OpenERP je dostupan kao web ili klasična aplikacija." diff --git a/addons/web/static/lib/qweb/qweb-test-extend.xml b/addons/web/static/lib/qweb/qweb-test-extend.xml index 44fda920e43..35181eb8ee9 100644 --- a/addons/web/static/lib/qweb/qweb-test-extend.xml +++ b/addons/web/static/lib/qweb/qweb-test-extend.xml @@ -22,11 +22,11 @@
- END + [[end]] -
  • CLONED TEMPLATE
  • +
  • [[cloned template]]
  • diff --git a/addons/web/static/lib/qweb/qweb-test-foreach.xml b/addons/web/static/lib/qweb/qweb-test-foreach.xml index 80749882aaf..8e335614c39 100644 --- a/addons/web/static/lib/qweb/qweb-test-foreach.xml +++ b/addons/web/static/lib/qweb/qweb-test-foreach.xml @@ -1,4 +1,4 @@ - + * diff --git a/addons/web/static/lib/qweb/qweb-test.js.html b/addons/web/static/lib/qweb/qweb-test.js.html index fda837497c4..02ec89c134c 100644 --- a/addons/web/static/lib/qweb/qweb-test.js.html +++ b/addons/web/static/lib/qweb/qweb-test.js.html @@ -5,7 +5,6 @@ -