diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 8683ef177bc..1bcdb7f54a9 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -32,6 +32,7 @@ except ImportError: import openerp import openerp.modules.registry from openerp.tools.translate import _ +from openerp.tools import config from .. import http openerpweb = http @@ -86,9 +87,9 @@ def rjsmin(script): ).strip() return result -def db_list(): +def db_list(force=False): proxy = req.session.proxy("db") - dbs = proxy.list() + dbs = proxy.list(force) h = req.httprequest.environ['HTTP_HOST'].split(':')[0] d = h.split('.')[0] r = openerp.tools.config['dbfilter'].replace('%h', h).replace('%d', d) @@ -104,25 +105,21 @@ def db_monodb_redirect(): if db_url: return (db_url, False) - try: - dbs = db_list() - except Exception: - # ignore access denied - dbs = [] + dbs = db_list(True) # 2 use the database from the cookie if it's listable and still listed cookie_db = req.httprequest.cookies.get('last_used_database') if cookie_db in dbs: db = cookie_db - # 3 use the first db - if dbs and not db: + # 3 use the first db if user can list databases + if dbs and not db and (config['list_db'] or len(dbs) == 1): db = dbs[0] # redirect to the chosen db if multiple are available if db and len(dbs) > 1: query = dict(urlparse.parse_qsl(req.httprequest.query_string, keep_blank_values=True)) - query.update({ 'db': db }) + query.update({'db': db}) redirect = req.httprequest.path + '?' + urllib.urlencode(query) return (db, redirect) @@ -283,8 +280,9 @@ def concat_files(file_list, reader=None, intersperse=""): if reader is None: def reader(f): - with open(f, 'rb') as fp: - return fp.read() + import codecs + with codecs.open(f, 'rb', "utf-8-sig") as fp: + return fp.read().encode("utf-8") files_content = [] for fname in file_list: @@ -766,7 +764,14 @@ class Database(openerpweb.Controller): @openerpweb.jsonrequest def get_list(self): - return db_list() + # TODO change js to avoid calling this method if in monodb mode + try: + return db_list() + except openerp.exceptions.AccessDenied: + monodb = db_monodb(req) + if monodb: + return [monodb] + raise @openerpweb.jsonrequest def create(self, fields): @@ -778,14 +783,6 @@ class Database(openerpweb.Controller): params['db_lang'], params['create_admin_pwd']) - @openerpweb.jsonrequest - def duplicate(self, fields): - params = dict(map(operator.itemgetter('name', 'value'), fields)) - return req.session.proxy("db").duplicate_database( - params['super_admin_pwd'], - params['db_original_name'], - params['db_name']) - @openerpweb.jsonrequest def duplicate(self, fields): params = dict(map(operator.itemgetter('name', 'value'), fields)) @@ -794,7 +791,6 @@ class Database(openerpweb.Controller): params['db_original_name'], params['db_name'], ) - return req.session.proxy("db").duplicate_database(*duplicate_attrs) @openerpweb.jsonrequest @@ -802,9 +798,9 @@ class Database(openerpweb.Controller): password, db = operator.itemgetter( 'drop_pwd', 'drop_db')( dict(map(operator.itemgetter('name', 'value'), fields))) - + try: - return req.session.proxy("db").drop(password, db) + if req.session.proxy("db").drop(password, db):return True except openerp.exceptions.AccessDenied: return {'error': 'AccessDenied', 'title': 'Drop Database'} except Exception: @@ -1380,7 +1376,7 @@ class Binary(openerpweb.Controller): else: try: # create an empty registry - registry = openerp.modules.registry.Registry(dbname.lower()) + registry = openerp.modules.registry.Registry(dbname) with registry.cursor() as cr: cr.execute("""SELECT c.logo_web FROM res_users u @@ -1490,6 +1486,8 @@ class Export(openerpweb.Controller): if all(dict(attrs).get('readonly', True) for attrs in field.get('states', {}).values()): continue + if not field.get('exportable', True): + continue id = prefix + (prefix and '/'or '') + field_name name = parent_name + (parent_name and '/' or '') + field['string'] diff --git a/addons/web/doc/_static/openerp.png b/addons/web/doc/_static/openerp.png index d6dbd9d83d1..caa1b21d8d7 100644 Binary files a/addons/web/doc/_static/openerp.png and b/addons/web/doc/_static/openerp.png differ diff --git a/addons/web/http.py b/addons/web/http.py index 2dc41c8cad9..5872e80685b 100644 --- a/addons/web/http.py +++ b/addons/web/http.py @@ -537,9 +537,13 @@ class DisableCacheMiddleware(object): def session_path(): try: - username = getpass.getuser() - except Exception: - username = "unknown" + import pwd + username = pwd.getpwuid(os.geteuid()).pw_name + except ImportError: + try: + username = getpass.getuser() + except Exception: + username = "unknown" path = os.path.join(tempfile.gettempdir(), "oe-sessions-" + username) try: os.mkdir(path, 0700) diff --git a/addons/web/session.py b/addons/web/session.py index 13c3bc7cb94..65f5fdc2a62 100644 --- a/addons/web/session.py +++ b/addons/web/session.py @@ -1,4 +1,3 @@ -#!/usr/bin/python import datetime import babel import dateutil.relativedelta diff --git a/addons/web/static/lib/cleditor/jquery.cleditor.js b/addons/web/static/lib/cleditor/jquery.cleditor.js index e3446991daf..3de9089443d 100644 --- a/addons/web/static/lib/cleditor/jquery.cleditor.js +++ b/addons/web/static/lib/cleditor/jquery.cleditor.js @@ -296,6 +296,11 @@ // Bind the window resize event when the width or height is auto or % if (/auto|%/.test("" + options.width + options.height)) $(window).resize(function() { + //Forcefully blurred iframe contentWindow, chrome, IE, safari doesn't trigger blur on window resize and due to which text disappears + var contentWindow = editor.$frame[0].contentWindow; + if(!$.browser.mozilla && contentWindow){ + $(contentWindow).trigger('blur'); + } // CHM Note MonkeyPatch: if the DOM is not remove, refresh the cleditor if(editor.$main.parent().parent().size()) { refresh(editor); diff --git a/addons/web/static/lib/datejs/date.js b/addons/web/static/lib/datejs/date.js index eda450113bb..96b96924da4 100644 --- a/addons/web/static/lib/datejs/date.js +++ b/addons/web/static/lib/datejs/date.js @@ -7,7 +7,7 @@ * date.js // English (United States) * date-en-US.js // English (United States) * date-de-DE.js // Deutsch (Deutschland) - * date-es-MX.js // français (France) + * date-es-MX.js // français (France) */ alert( @@ -17,5 +17,5 @@ alert( " date.js // English (United States)\n" + " date-en-US.js // English (United States)\n" + " date-de-DE.js // Deutsch (Deutschland)\n" + - " date-es-MX.js // français (France)\n" + " date-es-MX.js // français (France)\n" ); \ No newline at end of file diff --git a/addons/web/static/lib/jquery.placeholder/jquery.placeholder.js b/addons/web/static/lib/jquery.placeholder/jquery.placeholder.js old mode 100755 new mode 100644 diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png index 5b5dab2ab7b..e425e6e46eb 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png index ad3d6346e00..3b2914a2db9 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png index 42ccba269b6..e7d01fac6a7 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png index 5a46b47cb16..22641ccb51c 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png index 86c2baa655e..c0911d8cd44 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png index e65ca1297c7..d45b4160fa9 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png index 7c9fa6c6edc..3cd467e18ef 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png index 0e05810fffe..06a6708da17 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png index b273ff111d2..e913bce11f7 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png index 09d1cdc856c..34e38d1146e 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png index 59bd45b907c..1486b0cfc2e 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png index 6d02426c114..ae855c08a0e 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png index 2ab019b73ec..9e8939e38f8 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_f6cf3b_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_f6cf3b_256x240.png index c9869351a73..68d801e2563 100644 Binary files a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_f6cf3b_256x240.png and b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_f6cf3b_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png index 5b5dab2ab7b..e425e6e46eb 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png index ac8b229af95..72d4757363c 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png index b39a6fb27ff..e3fcd7c9898 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png index 42ccba269b6..e7d01fac6a7 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png index 5a46b47cb16..22641ccb51c 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png index 86c2baa655e..c0911d8cd44 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png index 4443fdc1a15..5fd6c50c715 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png index 7c9fa6c6edc..3cd467e18ef 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_222222_256x240.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_222222_256x240.png index b273ff111d2..e913bce11f7 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_222222_256x240.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_222222_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png index 84defe6e8ab..34e38d1146e 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_454545_256x240.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_454545_256x240.png index 59bd45b907c..1486b0cfc2e 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_454545_256x240.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_454545_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_888888_256x240.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_888888_256x240.png index 6d02426c114..ae855c08a0e 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_888888_256x240.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_888888_256x240.png differ diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png index 2ab019b73ec..9e8939e38f8 100644 Binary files a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png and b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png differ diff --git a/addons/web/static/lib/py.js/.hg_archival.txt b/addons/web/static/lib/py.js/.hg_archival.txt index 1d47dff4445..94f4a9ad6e8 100644 --- a/addons/web/static/lib/py.js/.hg_archival.txt +++ b/addons/web/static/lib/py.js/.hg_archival.txt @@ -1,5 +1,5 @@ repo: 076b192d0d8ab2b92d1dbcfa3da055382f30eaea -node: 142c22b230636674a0cee6bc29e6975f0f1600a5 +node: 7ee0bc7b4e9138f485cdc9ec791961d8ef452f17 branch: default latesttag: 0.7 -latesttagdistance: 9 +latesttagdistance: 11 diff --git a/addons/web/static/lib/py.js/lib/py.js b/addons/web/static/lib/py.js/lib/py.js index 8d6443b7753..2c738dc95d1 100644 --- a/addons/web/static/lib/py.js/lib/py.js +++ b/addons/web/static/lib/py.js/lib/py.js @@ -273,7 +273,7 @@ var py = {}; var Special = '[:;.,`@]'; var Funny = group(Operator, Bracket, Special); - var ContStr = group("[uU]?'([^']*)'", '[uU]?"([^"]*)"'); + var ContStr = group("([uU])?'([^']*)'", '([uU])?"([^"]*)"'); var PseudoToken = Whitespace + group(Number, Funny, ContStr, Name); @@ -311,7 +311,8 @@ var py = {}; } else if (string_pattern.test(token)) { var m = string_pattern.exec(token); tokens.push(create(symbols['(string)'], { - value: (m[2] !== undefined ? m[2] : m[3]) + unicode: !!(m[2] || m[4]), + value: (m[3] !== undefined ? m[3] : m[5]) })); } else if (token in symbols) { var symbol; @@ -393,13 +394,14 @@ var py = {}; switch(val.constructor) { case Object: - var out = py.PY_call(py.object); - for(var k in val) { - if (val.hasOwnProperty(k)) { - out[k] = val[k]; + // TODO: why py.object instead of py.dict? + var o = py.PY_call(py.object); + for (var prop in val) { + if (val.hasOwnProperty(prop)) { + o[prop] = val[prop]; } } - return out; + return o; case Array: return py.list.fromJSON(val); } @@ -521,7 +523,7 @@ var py = {}; } }; py.PY_getAttr = function (o, attr_name) { - return PY_ensurepy(o.__getattribute__(attr_name),attr_name); + return PY_ensurepy(o.__getattribute__(attr_name)); }; py.PY_str = function (o) { var v = o.__str__(); @@ -762,14 +764,7 @@ var py = {}; // Conversion toJSON: function () { - var out = {}; - for(var k in this) { - if (this.hasOwnProperty(k) && !/^__/.test(k)) { - var val = this[k]; - out[k] = val.toJSON ? val.toJSON() : val; - } - } - return out; + throw new Error(this.constructor.name + ' can not be converted to JSON'); } }); var NoneType = py.type('NoneType', null, { @@ -998,7 +993,7 @@ var py = {}; } var t = py.PY_call(py.tuple); for(var i=0; i textarea { width: 500px; } @@ -2509,6 +2512,10 @@ margin-bottom: 32px; text-align: justify; } +.openerp .oe_form .oe_form_field_html .oe_input_icon { + float: right; + margin: 4px 7px; +} .openerp .oe_form_editable .oe_form .oe_form_field_integer input { width: 6em; } @@ -2997,7 +3004,6 @@ position: relative; } .openerp .oe_list_content th.oe_sortable div:after { - float: right; margin-right: 6px; content: ""; margin-top: 7px; @@ -3007,6 +3013,7 @@ visibility: hidden; } .openerp .oe_list_content th.sortup div:after { + float: right; visibility: visible; filter: alpha(opacity=60); opacity: 0.6; @@ -3015,6 +3022,7 @@ min-width: 70px; } .openerp .oe_list_content th.sortdown div:after { + float: right; border-bottom: none; border-left: 4px solid transparent; border-right: 4px solid transparent; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 240dc912206..fc812729cd4 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -511,9 +511,11 @@ $sheet-padding: 16px width: 100% !important textarea width: 100% !important - .text-core .text-wrap .text-dropdown .text-list .text-suggestion em - font-style: italic - text-decoration: none + .text-core + min-height: 22px + .text-wrap .text-dropdown .text-list .text-suggestion em + font-style: italic + text-decoration: none margin-bottom: 1px // }}} // Tooltips {{{ @@ -605,7 +607,6 @@ $sheet-padding: 16px display: none position: absolute top: 26px - left: 0 z-index: 3 margin: 0 padding: 0 @@ -1358,13 +1359,13 @@ $sheet-padding: 16px top: 0 right: 18px width: 15px - height: 100% + height: 24px background: url(../img/search_reset.gif) center center no-repeat .oe_searchview_unfold_drawer position: absolute top: 0 right: 0 - height: 100% + height: 24px padding: 0 7px 0 4px color: #ccc cursor: pointer @@ -1397,13 +1398,12 @@ $sheet-padding: 16px .oe_searchview_facets min-height: 22px - margin-left: 15px + margin: 0 35px 0 15px * vertical-align: top display: inline-block line-height: 17px .oe_searchview_facet - height: 18px margin: 1px 0 font-size: 11px &:focus @@ -1425,7 +1425,7 @@ $sheet-padding: 16px border-color: $tag-border-selected @include box-shadow(0 0 3px 1px $tag-border-selected) .oe_facet_values - background: #f0f0fa + background: $tag-bg-light @include radius(0 3px 3px 0) .oe_facet_category, .oe_facet_value height: 18px @@ -1464,6 +1464,7 @@ $sheet-padding: 16px display: block .oe_searchview_drawer + cursor: default position: absolute z-index: 2 // detach drawer from field slightly @@ -1581,7 +1582,6 @@ $sheet-padding: 16px list-style: none padding: 0 li - cursor: pointer position: relative list-style: none margin: 0 @@ -1904,6 +1904,8 @@ $sheet-padding: 16px .oe_form_field_text textarea, .oe_form_field_selection select width: 100% + .oe_notebook_page .oe_form_field_text textarea + min-height: 96px .oe_form_field_text.oe_inline, .oe_form_field_text.oe_inline > textarea width: 500px h1, h2, h3, h4, h5, h6 @@ -1989,6 +1991,9 @@ $sheet-padding: 16px margin-top: 32px margin-bottom: 32px text-align: justify + .oe_form_field_html .oe_input_icon + float: right + margin: 4px 7px .oe_form_editable .oe_form @@ -2372,7 +2377,6 @@ $sheet-padding: 16px th.oe_sortable div position: relative th.oe_sortable div:after - float: right margin-right: 6px content: "" margin-top: 7px @@ -2381,11 +2385,13 @@ $sheet-padding: 16px border-color: #000 transparent visibility: hidden th.sortup div:after + float: right visibility: visible @include opacity(0.6) .oe_list_header_many2many_tags min-width: 70px th.sortdown div:after + float: right border-bottom: none border-left: 4px solid transparent border-right: 4px solid transparent diff --git a/addons/web/static/src/font/entypo-webfont.svg b/addons/web/static/src/font/entypo-webfont.svg old mode 100755 new mode 100644 diff --git a/addons/web/static/src/font/mnmliconsv21-webfont.svg b/addons/web/static/src/font/mnmliconsv21-webfont.svg old mode 100755 new mode 100644 diff --git a/addons/web/static/src/img/accessories-archiver.png b/addons/web/static/src/img/accessories-archiver.png index 8bcbe4566bc..0d6c249c652 100644 Binary files a/addons/web/static/src/img/accessories-archiver.png and b/addons/web/static/src/img/accessories-archiver.png differ diff --git a/addons/web/static/src/img/add-shortcut.png b/addons/web/static/src/img/add-shortcut.png index bcc0a09eb45..07b8ed40207 100644 Binary files a/addons/web/static/src/img/add-shortcut.png and b/addons/web/static/src/img/add-shortcut.png differ diff --git a/addons/web/static/src/img/attachments-close.png b/addons/web/static/src/img/attachments-close.png index 14d645534b8..2633d7142fe 100644 Binary files a/addons/web/static/src/img/attachments-close.png and b/addons/web/static/src/img/attachments-close.png differ diff --git a/addons/web/static/src/img/db.png b/addons/web/static/src/img/db.png index 83e42df26b3..d573d1d395b 100644 Binary files a/addons/web/static/src/img/db.png and b/addons/web/static/src/img/db.png differ diff --git a/addons/web/static/src/img/down-arrow.png b/addons/web/static/src/img/down-arrow.png index b1288e52682..0f473e13e84 100644 Binary files a/addons/web/static/src/img/down-arrow.png and b/addons/web/static/src/img/down-arrow.png differ diff --git a/addons/web/static/src/img/form_sheetbg.png b/addons/web/static/src/img/form_sheetbg.png index d54b6302d5a..f7eec72b0d6 100644 Binary files a/addons/web/static/src/img/form_sheetbg.png and b/addons/web/static/src/img/form_sheetbg.png differ diff --git a/addons/web/static/src/img/form_steps.png b/addons/web/static/src/img/form_steps.png index 0485c5977aa..84b1a0a459d 100644 Binary files a/addons/web/static/src/img/form_steps.png and b/addons/web/static/src/img/form_steps.png differ diff --git a/addons/web/static/src/img/graph_background.png b/addons/web/static/src/img/graph_background.png index 530312b20bb..0c7abf0faef 100644 Binary files a/addons/web/static/src/img/graph_background.png and b/addons/web/static/src/img/graph_background.png differ diff --git a/addons/web/static/src/img/icons/STOCK_ADD.png b/addons/web/static/src/img/icons/STOCK_ADD.png index 70612c181c6..00a001da01d 100644 Binary files a/addons/web/static/src/img/icons/STOCK_ADD.png and b/addons/web/static/src/img/icons/STOCK_ADD.png differ diff --git a/addons/web/static/src/img/icons/STOCK_APPLY.png b/addons/web/static/src/img/icons/STOCK_APPLY.png index 116f2e433bb..4859a588742 100644 Binary files a/addons/web/static/src/img/icons/STOCK_APPLY.png and b/addons/web/static/src/img/icons/STOCK_APPLY.png differ diff --git a/addons/web/static/src/img/icons/STOCK_CLOSE.png b/addons/web/static/src/img/icons/STOCK_CLOSE.png index 4966974e178..9776fd0ecf4 100644 Binary files a/addons/web/static/src/img/icons/STOCK_CLOSE.png and b/addons/web/static/src/img/icons/STOCK_CLOSE.png differ diff --git a/addons/web/static/src/img/icons/STOCK_COLOR_PICKER.png b/addons/web/static/src/img/icons/STOCK_COLOR_PICKER.png index 232d54f8f3b..3f813c47444 100644 Binary files a/addons/web/static/src/img/icons/STOCK_COLOR_PICKER.png and b/addons/web/static/src/img/icons/STOCK_COLOR_PICKER.png differ diff --git a/addons/web/static/src/img/icons/STOCK_DIRECTORY_MENU.png b/addons/web/static/src/img/icons/STOCK_DIRECTORY_MENU.png index 07f90537f82..13985d17782 100644 Binary files a/addons/web/static/src/img/icons/STOCK_DIRECTORY_MENU.png and b/addons/web/static/src/img/icons/STOCK_DIRECTORY_MENU.png differ diff --git a/addons/web/static/src/img/icons/STOCK_DND.png b/addons/web/static/src/img/icons/STOCK_DND.png index bf3b8068397..5f026f625aa 100644 Binary files a/addons/web/static/src/img/icons/STOCK_DND.png and b/addons/web/static/src/img/icons/STOCK_DND.png differ diff --git a/addons/web/static/src/img/icons/STOCK_FLOPPY.png b/addons/web/static/src/img/icons/STOCK_FLOPPY.png index 7d8209cfb6f..427a762c141 100644 Binary files a/addons/web/static/src/img/icons/STOCK_FLOPPY.png and b/addons/web/static/src/img/icons/STOCK_FLOPPY.png differ diff --git a/addons/web/static/src/img/icons/STOCK_GOTO_FIRST.png b/addons/web/static/src/img/icons/STOCK_GOTO_FIRST.png index 3d00e36d696..7b9c900ca3a 100644 Binary files a/addons/web/static/src/img/icons/STOCK_GOTO_FIRST.png and b/addons/web/static/src/img/icons/STOCK_GOTO_FIRST.png differ diff --git a/addons/web/static/src/img/icons/STOCK_GOTO_TOP.png b/addons/web/static/src/img/icons/STOCK_GOTO_TOP.png index 227a91e5157..2812a0f4b90 100644 Binary files a/addons/web/static/src/img/icons/STOCK_GOTO_TOP.png and b/addons/web/static/src/img/icons/STOCK_GOTO_TOP.png differ diff --git a/addons/web/static/src/img/icons/STOCK_GO_BACK.png b/addons/web/static/src/img/icons/STOCK_GO_BACK.png index 568117dc170..482ca6285f7 100644 Binary files a/addons/web/static/src/img/icons/STOCK_GO_BACK.png and b/addons/web/static/src/img/icons/STOCK_GO_BACK.png differ diff --git a/addons/web/static/src/img/icons/STOCK_GO_UP.png b/addons/web/static/src/img/icons/STOCK_GO_UP.png index 84f96fdfca2..e2e15b0b3da 100644 Binary files a/addons/web/static/src/img/icons/STOCK_GO_UP.png and b/addons/web/static/src/img/icons/STOCK_GO_UP.png differ diff --git a/addons/web/static/src/img/icons/STOCK_ITALIC.png b/addons/web/static/src/img/icons/STOCK_ITALIC.png index 26c57226a31..c7900917cea 100644 Binary files a/addons/web/static/src/img/icons/STOCK_ITALIC.png and b/addons/web/static/src/img/icons/STOCK_ITALIC.png differ diff --git a/addons/web/static/src/img/icons/STOCK_LEAVE_FULLSCREEN.png b/addons/web/static/src/img/icons/STOCK_LEAVE_FULLSCREEN.png index 15bc8ab7d7b..027fef93845 100644 Binary files a/addons/web/static/src/img/icons/STOCK_LEAVE_FULLSCREEN.png and b/addons/web/static/src/img/icons/STOCK_LEAVE_FULLSCREEN.png differ diff --git a/addons/web/static/src/img/icons/STOCK_MEDIA_FORWARD.png b/addons/web/static/src/img/icons/STOCK_MEDIA_FORWARD.png index e5e198fbb79..8eecedc7d31 100644 Binary files a/addons/web/static/src/img/icons/STOCK_MEDIA_FORWARD.png and b/addons/web/static/src/img/icons/STOCK_MEDIA_FORWARD.png differ diff --git a/addons/web/static/src/img/icons/STOCK_MEDIA_PAUSE.png b/addons/web/static/src/img/icons/STOCK_MEDIA_PAUSE.png index 6721994eb8d..f6194f3a83b 100644 Binary files a/addons/web/static/src/img/icons/STOCK_MEDIA_PAUSE.png and b/addons/web/static/src/img/icons/STOCK_MEDIA_PAUSE.png differ diff --git a/addons/web/static/src/img/icons/STOCK_MEDIA_PLAY.png b/addons/web/static/src/img/icons/STOCK_MEDIA_PLAY.png index b0832712c81..b316d2b3bcb 100644 Binary files a/addons/web/static/src/img/icons/STOCK_MEDIA_PLAY.png and b/addons/web/static/src/img/icons/STOCK_MEDIA_PLAY.png differ diff --git a/addons/web/static/src/img/icons/STOCK_MEDIA_REWIND.png b/addons/web/static/src/img/icons/STOCK_MEDIA_REWIND.png index 9c22d9e2778..127d1035b13 100644 Binary files a/addons/web/static/src/img/icons/STOCK_MEDIA_REWIND.png and b/addons/web/static/src/img/icons/STOCK_MEDIA_REWIND.png differ diff --git a/addons/web/static/src/img/icons/STOCK_MEDIA_STOP.png b/addons/web/static/src/img/icons/STOCK_MEDIA_STOP.png index 128cc2313ec..1ffe15c070f 100644 Binary files a/addons/web/static/src/img/icons/STOCK_MEDIA_STOP.png and b/addons/web/static/src/img/icons/STOCK_MEDIA_STOP.png differ diff --git a/addons/web/static/src/img/icons/STOCK_NO.png b/addons/web/static/src/img/icons/STOCK_NO.png index 047ddcd9289..77d48887cde 100644 Binary files a/addons/web/static/src/img/icons/STOCK_NO.png and b/addons/web/static/src/img/icons/STOCK_NO.png differ diff --git a/addons/web/static/src/img/icons/STOCK_OK.png b/addons/web/static/src/img/icons/STOCK_OK.png index 7755b8769f0..ad4451e3f11 100644 Binary files a/addons/web/static/src/img/icons/STOCK_OK.png and b/addons/web/static/src/img/icons/STOCK_OK.png differ diff --git a/addons/web/static/src/img/icons/STOCK_QUIT.png b/addons/web/static/src/img/icons/STOCK_QUIT.png index 50b5144660b..7556ae406fc 100644 Binary files a/addons/web/static/src/img/icons/STOCK_QUIT.png and b/addons/web/static/src/img/icons/STOCK_QUIT.png differ diff --git a/addons/web/static/src/img/icons/STOCK_REDO.png b/addons/web/static/src/img/icons/STOCK_REDO.png index 54055b3966d..da2138bb97b 100644 Binary files a/addons/web/static/src/img/icons/STOCK_REDO.png and b/addons/web/static/src/img/icons/STOCK_REDO.png differ diff --git a/addons/web/static/src/img/icons/STOCK_REMOVE.png b/addons/web/static/src/img/icons/STOCK_REMOVE.png index c2b6e915f77..fb95ab2361e 100644 Binary files a/addons/web/static/src/img/icons/STOCK_REMOVE.png and b/addons/web/static/src/img/icons/STOCK_REMOVE.png differ diff --git a/addons/web/static/src/img/icons/STOCK_STRIKETHROUGH.png b/addons/web/static/src/img/icons/STOCK_STRIKETHROUGH.png index 1c11f214622..a773530cdcb 100644 Binary files a/addons/web/static/src/img/icons/STOCK_STRIKETHROUGH.png and b/addons/web/static/src/img/icons/STOCK_STRIKETHROUGH.png differ diff --git a/addons/web/static/src/img/icons/STOCK_UNDERLINE.png b/addons/web/static/src/img/icons/STOCK_UNDERLINE.png index 7dbb5d7e60a..92b8c9ff153 100644 Binary files a/addons/web/static/src/img/icons/STOCK_UNDERLINE.png and b/addons/web/static/src/img/icons/STOCK_UNDERLINE.png differ diff --git a/addons/web/static/src/img/icons/STOCK_UNDO.png b/addons/web/static/src/img/icons/STOCK_UNDO.png index 7a50de0c61e..26d284e9ac8 100644 Binary files a/addons/web/static/src/img/icons/STOCK_UNDO.png and b/addons/web/static/src/img/icons/STOCK_UNDO.png differ diff --git a/addons/web/static/src/img/icons/STOCK_YES.png b/addons/web/static/src/img/icons/STOCK_YES.png index 01fb373c251..15e51054233 100644 Binary files a/addons/web/static/src/img/icons/STOCK_YES.png and b/addons/web/static/src/img/icons/STOCK_YES.png differ diff --git a/addons/web/static/src/img/icons/color-picker.png b/addons/web/static/src/img/icons/color-picker.png index 765294c6bdd..d22c393631e 100644 Binary files a/addons/web/static/src/img/icons/color-picker.png and b/addons/web/static/src/img/icons/color-picker.png differ diff --git a/addons/web/static/src/img/icons/gtk-add.png b/addons/web/static/src/img/icons/gtk-add.png index 70612c181c6..00a001da01d 100644 Binary files a/addons/web/static/src/img/icons/gtk-add.png and b/addons/web/static/src/img/icons/gtk-add.png differ diff --git a/addons/web/static/src/img/icons/gtk-apply.png b/addons/web/static/src/img/icons/gtk-apply.png index 116f2e433bb..4859a588742 100644 Binary files a/addons/web/static/src/img/icons/gtk-apply.png and b/addons/web/static/src/img/icons/gtk-apply.png differ diff --git a/addons/web/static/src/img/icons/gtk-close.png b/addons/web/static/src/img/icons/gtk-close.png index 4966974e178..9776fd0ecf4 100644 Binary files a/addons/web/static/src/img/icons/gtk-close.png and b/addons/web/static/src/img/icons/gtk-close.png differ diff --git a/addons/web/static/src/img/icons/gtk-color-picker.png b/addons/web/static/src/img/icons/gtk-color-picker.png index 232d54f8f3b..3f813c47444 100644 Binary files a/addons/web/static/src/img/icons/gtk-color-picker.png and b/addons/web/static/src/img/icons/gtk-color-picker.png differ diff --git a/addons/web/static/src/img/icons/gtk-dnd.png b/addons/web/static/src/img/icons/gtk-dnd.png index bf3b8068397..5f026f625aa 100644 Binary files a/addons/web/static/src/img/icons/gtk-dnd.png and b/addons/web/static/src/img/icons/gtk-dnd.png differ diff --git a/addons/web/static/src/img/icons/gtk-floppy.png b/addons/web/static/src/img/icons/gtk-floppy.png index 7d8209cfb6f..427a762c141 100644 Binary files a/addons/web/static/src/img/icons/gtk-floppy.png and b/addons/web/static/src/img/icons/gtk-floppy.png differ diff --git a/addons/web/static/src/img/icons/gtk-go-back.png b/addons/web/static/src/img/icons/gtk-go-back.png index 568117dc170..482ca6285f7 100644 Binary files a/addons/web/static/src/img/icons/gtk-go-back.png and b/addons/web/static/src/img/icons/gtk-go-back.png differ diff --git a/addons/web/static/src/img/icons/gtk-go-up.png b/addons/web/static/src/img/icons/gtk-go-up.png index 84f96fdfca2..e2e15b0b3da 100644 Binary files a/addons/web/static/src/img/icons/gtk-go-up.png and b/addons/web/static/src/img/icons/gtk-go-up.png differ diff --git a/addons/web/static/src/img/icons/gtk-goto-first.png b/addons/web/static/src/img/icons/gtk-goto-first.png index 3d00e36d696..7b9c900ca3a 100644 Binary files a/addons/web/static/src/img/icons/gtk-goto-first.png and b/addons/web/static/src/img/icons/gtk-goto-first.png differ diff --git a/addons/web/static/src/img/icons/gtk-goto-top.png b/addons/web/static/src/img/icons/gtk-goto-top.png index 227a91e5157..2812a0f4b90 100644 Binary files a/addons/web/static/src/img/icons/gtk-goto-top.png and b/addons/web/static/src/img/icons/gtk-goto-top.png differ diff --git a/addons/web/static/src/img/icons/gtk-italic.png b/addons/web/static/src/img/icons/gtk-italic.png index 26c57226a31..c7900917cea 100644 Binary files a/addons/web/static/src/img/icons/gtk-italic.png and b/addons/web/static/src/img/icons/gtk-italic.png differ diff --git a/addons/web/static/src/img/icons/gtk-leave-fullscreen.png b/addons/web/static/src/img/icons/gtk-leave-fullscreen.png index 15bc8ab7d7b..027fef93845 100644 Binary files a/addons/web/static/src/img/icons/gtk-leave-fullscreen.png and b/addons/web/static/src/img/icons/gtk-leave-fullscreen.png differ diff --git a/addons/web/static/src/img/icons/gtk-media-forward.png b/addons/web/static/src/img/icons/gtk-media-forward.png index e5e198fbb79..8eecedc7d31 100644 Binary files a/addons/web/static/src/img/icons/gtk-media-forward.png and b/addons/web/static/src/img/icons/gtk-media-forward.png differ diff --git a/addons/web/static/src/img/icons/gtk-media-pause.png b/addons/web/static/src/img/icons/gtk-media-pause.png index 6721994eb8d..f6194f3a83b 100644 Binary files a/addons/web/static/src/img/icons/gtk-media-pause.png and b/addons/web/static/src/img/icons/gtk-media-pause.png differ diff --git a/addons/web/static/src/img/icons/gtk-media-play.png b/addons/web/static/src/img/icons/gtk-media-play.png index b0832712c81..b316d2b3bcb 100644 Binary files a/addons/web/static/src/img/icons/gtk-media-play.png and b/addons/web/static/src/img/icons/gtk-media-play.png differ diff --git a/addons/web/static/src/img/icons/gtk-media-rewind.png b/addons/web/static/src/img/icons/gtk-media-rewind.png index 9c22d9e2778..127d1035b13 100644 Binary files a/addons/web/static/src/img/icons/gtk-media-rewind.png and b/addons/web/static/src/img/icons/gtk-media-rewind.png differ diff --git a/addons/web/static/src/img/icons/gtk-media-stop.png b/addons/web/static/src/img/icons/gtk-media-stop.png index 128cc2313ec..1ffe15c070f 100644 Binary files a/addons/web/static/src/img/icons/gtk-media-stop.png and b/addons/web/static/src/img/icons/gtk-media-stop.png differ diff --git a/addons/web/static/src/img/icons/gtk-no.png b/addons/web/static/src/img/icons/gtk-no.png index 047ddcd9289..77d48887cde 100644 Binary files a/addons/web/static/src/img/icons/gtk-no.png and b/addons/web/static/src/img/icons/gtk-no.png differ diff --git a/addons/web/static/src/img/icons/gtk-ok.png b/addons/web/static/src/img/icons/gtk-ok.png index 7755b8769f0..ad4451e3f11 100644 Binary files a/addons/web/static/src/img/icons/gtk-ok.png and b/addons/web/static/src/img/icons/gtk-ok.png differ diff --git a/addons/web/static/src/img/icons/gtk-quit.png b/addons/web/static/src/img/icons/gtk-quit.png index 50b5144660b..7556ae406fc 100644 Binary files a/addons/web/static/src/img/icons/gtk-quit.png and b/addons/web/static/src/img/icons/gtk-quit.png differ diff --git a/addons/web/static/src/img/icons/gtk-redo.png b/addons/web/static/src/img/icons/gtk-redo.png index 54055b3966d..da2138bb97b 100644 Binary files a/addons/web/static/src/img/icons/gtk-redo.png and b/addons/web/static/src/img/icons/gtk-redo.png differ diff --git a/addons/web/static/src/img/icons/gtk-remove.png b/addons/web/static/src/img/icons/gtk-remove.png index c2b6e915f77..fb95ab2361e 100644 Binary files a/addons/web/static/src/img/icons/gtk-remove.png and b/addons/web/static/src/img/icons/gtk-remove.png differ diff --git a/addons/web/static/src/img/icons/gtk-strikethrough.png b/addons/web/static/src/img/icons/gtk-strikethrough.png index 1c11f214622..a773530cdcb 100644 Binary files a/addons/web/static/src/img/icons/gtk-strikethrough.png and b/addons/web/static/src/img/icons/gtk-strikethrough.png differ diff --git a/addons/web/static/src/img/icons/gtk-underline.png b/addons/web/static/src/img/icons/gtk-underline.png index 7dbb5d7e60a..92b8c9ff153 100644 Binary files a/addons/web/static/src/img/icons/gtk-underline.png and b/addons/web/static/src/img/icons/gtk-underline.png differ diff --git a/addons/web/static/src/img/icons/gtk-undo.png b/addons/web/static/src/img/icons/gtk-undo.png index 7a50de0c61e..26d284e9ac8 100644 Binary files a/addons/web/static/src/img/icons/gtk-undo.png and b/addons/web/static/src/img/icons/gtk-undo.png differ diff --git a/addons/web/static/src/img/icons/gtk-yes.png b/addons/web/static/src/img/icons/gtk-yes.png index 01fb373c251..15e51054233 100644 Binary files a/addons/web/static/src/img/icons/gtk-yes.png and b/addons/web/static/src/img/icons/gtk-yes.png differ diff --git a/addons/web/static/src/img/icons/kanban-apply.png b/addons/web/static/src/img/icons/kanban-apply.png index 02effd5f14c..e5fe4ee5f78 100644 Binary files a/addons/web/static/src/img/icons/kanban-apply.png and b/addons/web/static/src/img/icons/kanban-apply.png differ diff --git a/addons/web/static/src/img/icons/kanban-pause.png b/addons/web/static/src/img/icons/kanban-pause.png index 9e9544ee178..ce2357ccfef 100644 Binary files a/addons/web/static/src/img/icons/kanban-pause.png and b/addons/web/static/src/img/icons/kanban-pause.png differ diff --git a/addons/web/static/src/img/icons/kanban-stop.png b/addons/web/static/src/img/icons/kanban-stop.png index e1f98a26b59..da6839f2f8f 100644 Binary files a/addons/web/static/src/img/icons/kanban-stop.png and b/addons/web/static/src/img/icons/kanban-stop.png differ diff --git a/addons/web/static/src/img/icons/save-document.png b/addons/web/static/src/img/icons/save-document.png index 8933ca0bed9..3e076aa91cb 100644 Binary files a/addons/web/static/src/img/icons/save-document.png and b/addons/web/static/src/img/icons/save-document.png differ diff --git a/addons/web/static/src/img/icons/star-off.png b/addons/web/static/src/img/icons/star-off.png index 7cd0afd4f03..b999fb2e02f 100644 Binary files a/addons/web/static/src/img/icons/star-off.png and b/addons/web/static/src/img/icons/star-off.png differ diff --git a/addons/web/static/src/img/icons/star-on.png b/addons/web/static/src/img/icons/star-on.png index 4f2295e1395..f6a9ec830d0 100644 Binary files a/addons/web/static/src/img/icons/star-on.png and b/addons/web/static/src/img/icons/star-on.png differ diff --git a/addons/web/static/src/img/icons/stock.png b/addons/web/static/src/img/icons/stock.png index ca38181db90..762491f1e71 100644 Binary files a/addons/web/static/src/img/icons/stock.png and b/addons/web/static/src/img/icons/stock.png differ diff --git a/addons/web/static/src/img/icons/stock_calendar.png b/addons/web/static/src/img/icons/stock_calendar.png index 99a1f3f9ef1..5fdccf561ba 100644 Binary files a/addons/web/static/src/img/icons/stock_calendar.png and b/addons/web/static/src/img/icons/stock_calendar.png differ diff --git a/addons/web/static/src/img/icons/terp-accessories-archiver+.png b/addons/web/static/src/img/icons/terp-accessories-archiver+.png index 14d6d02536e..899c6e54e83 100644 Binary files a/addons/web/static/src/img/icons/terp-accessories-archiver+.png and b/addons/web/static/src/img/icons/terp-accessories-archiver+.png differ diff --git a/addons/web/static/src/img/icons/terp-accessories-archiver-minus.png b/addons/web/static/src/img/icons/terp-accessories-archiver-minus.png index 024c8f692d8..173c6208133 100644 Binary files a/addons/web/static/src/img/icons/terp-accessories-archiver-minus.png and b/addons/web/static/src/img/icons/terp-accessories-archiver-minus.png differ diff --git a/addons/web/static/src/img/icons/terp-accessories-archiver.png b/addons/web/static/src/img/icons/terp-accessories-archiver.png index 8bcbe4566bc..0d6c249c652 100644 Binary files a/addons/web/static/src/img/icons/terp-accessories-archiver.png and b/addons/web/static/src/img/icons/terp-accessories-archiver.png differ diff --git a/addons/web/static/src/img/icons/terp-account.png b/addons/web/static/src/img/icons/terp-account.png index 30dea82a105..01cc0c4e8b9 100644 Binary files a/addons/web/static/src/img/icons/terp-account.png and b/addons/web/static/src/img/icons/terp-account.png differ diff --git a/addons/web/static/src/img/icons/terp-administration.png b/addons/web/static/src/img/icons/terp-administration.png index ab129b2e4b3..8ff707ede02 100644 Binary files a/addons/web/static/src/img/icons/terp-administration.png and b/addons/web/static/src/img/icons/terp-administration.png differ diff --git a/addons/web/static/src/img/icons/terp-calendar.png b/addons/web/static/src/img/icons/terp-calendar.png index 37206565792..222e22c78d1 100644 Binary files a/addons/web/static/src/img/icons/terp-calendar.png and b/addons/web/static/src/img/icons/terp-calendar.png differ diff --git a/addons/web/static/src/img/icons/terp-call-start.png b/addons/web/static/src/img/icons/terp-call-start.png index 602a1cdd4b8..2128555419e 100644 Binary files a/addons/web/static/src/img/icons/terp-call-start.png and b/addons/web/static/src/img/icons/terp-call-start.png differ diff --git a/addons/web/static/src/img/icons/terp-camera_test.png b/addons/web/static/src/img/icons/terp-camera_test.png index e97e0416de3..7a127e7d350 100644 Binary files a/addons/web/static/src/img/icons/terp-camera_test.png and b/addons/web/static/src/img/icons/terp-camera_test.png differ diff --git a/addons/web/static/src/img/icons/terp-crm.png b/addons/web/static/src/img/icons/terp-crm.png index fdac61ca92d..3c86dd3b043 100644 Binary files a/addons/web/static/src/img/icons/terp-crm.png and b/addons/web/static/src/img/icons/terp-crm.png differ diff --git a/addons/web/static/src/img/icons/terp-dialog-close.png b/addons/web/static/src/img/icons/terp-dialog-close.png index 8f51ec05fd6..c65cb24871f 100644 Binary files a/addons/web/static/src/img/icons/terp-dialog-close.png and b/addons/web/static/src/img/icons/terp-dialog-close.png differ diff --git a/addons/web/static/src/img/icons/terp-document-new.png b/addons/web/static/src/img/icons/terp-document-new.png index 2815cbb403f..8ad4a78fe93 100644 Binary files a/addons/web/static/src/img/icons/terp-document-new.png and b/addons/web/static/src/img/icons/terp-document-new.png differ diff --git a/addons/web/static/src/img/icons/terp-dolar.png b/addons/web/static/src/img/icons/terp-dolar.png index bca7021c82f..03b37cfa0ed 100644 Binary files a/addons/web/static/src/img/icons/terp-dolar.png and b/addons/web/static/src/img/icons/terp-dolar.png differ diff --git a/addons/web/static/src/img/icons/terp-dolar_ok!.png b/addons/web/static/src/img/icons/terp-dolar_ok!.png index b1005aae7b9..e3cb9e17bcb 100644 Binary files a/addons/web/static/src/img/icons/terp-dolar_ok!.png and b/addons/web/static/src/img/icons/terp-dolar_ok!.png differ diff --git a/addons/web/static/src/img/icons/terp-emblem-important.png b/addons/web/static/src/img/icons/terp-emblem-important.png index a8321066abb..9b75ddb7c2e 100644 Binary files a/addons/web/static/src/img/icons/terp-emblem-important.png and b/addons/web/static/src/img/icons/terp-emblem-important.png differ diff --git a/addons/web/static/src/img/icons/terp-folder-blue.png b/addons/web/static/src/img/icons/terp-folder-blue.png index addc480d49a..1972448912b 100644 Binary files a/addons/web/static/src/img/icons/terp-folder-blue.png and b/addons/web/static/src/img/icons/terp-folder-blue.png differ diff --git a/addons/web/static/src/img/icons/terp-folder-green.png b/addons/web/static/src/img/icons/terp-folder-green.png index 206cd39603e..c1630414c78 100644 Binary files a/addons/web/static/src/img/icons/terp-folder-green.png and b/addons/web/static/src/img/icons/terp-folder-green.png differ diff --git a/addons/web/static/src/img/icons/terp-folder-orange.png b/addons/web/static/src/img/icons/terp-folder-orange.png index 726dbd7f00e..b401de6d04f 100644 Binary files a/addons/web/static/src/img/icons/terp-folder-orange.png and b/addons/web/static/src/img/icons/terp-folder-orange.png differ diff --git a/addons/web/static/src/img/icons/terp-folder-violet.png b/addons/web/static/src/img/icons/terp-folder-violet.png index c6f5cfb87ff..20e383a9967 100644 Binary files a/addons/web/static/src/img/icons/terp-folder-violet.png and b/addons/web/static/src/img/icons/terp-folder-violet.png differ diff --git a/addons/web/static/src/img/icons/terp-folder-yellow.png b/addons/web/static/src/img/icons/terp-folder-yellow.png index cd7295dcdd7..7cc7650e680 100644 Binary files a/addons/web/static/src/img/icons/terp-folder-yellow.png and b/addons/web/static/src/img/icons/terp-folder-yellow.png differ diff --git a/addons/web/static/src/img/icons/terp-go-year.png b/addons/web/static/src/img/icons/terp-go-year.png index f45efc9dd0c..b09bf94500a 100644 Binary files a/addons/web/static/src/img/icons/terp-go-year.png and b/addons/web/static/src/img/icons/terp-go-year.png differ diff --git a/addons/web/static/src/img/icons/terp-graph.png b/addons/web/static/src/img/icons/terp-graph.png index 30dea82a105..01cc0c4e8b9 100644 Binary files a/addons/web/static/src/img/icons/terp-graph.png and b/addons/web/static/src/img/icons/terp-graph.png differ diff --git a/addons/web/static/src/img/icons/terp-gtk-go-back-ltr.png b/addons/web/static/src/img/icons/terp-gtk-go-back-ltr.png index a76138d2e0d..b9c77e11f10 100644 Binary files a/addons/web/static/src/img/icons/terp-gtk-go-back-ltr.png and b/addons/web/static/src/img/icons/terp-gtk-go-back-ltr.png differ diff --git a/addons/web/static/src/img/icons/terp-gtk-go-back-rtl.png b/addons/web/static/src/img/icons/terp-gtk-go-back-rtl.png index 10d10b582fe..8e662b6291d 100644 Binary files a/addons/web/static/src/img/icons/terp-gtk-go-back-rtl.png and b/addons/web/static/src/img/icons/terp-gtk-go-back-rtl.png differ diff --git a/addons/web/static/src/img/icons/terp-gtk-jump-to-ltr.png b/addons/web/static/src/img/icons/terp-gtk-jump-to-ltr.png index fa517749d10..4e9092ba03c 100644 Binary files a/addons/web/static/src/img/icons/terp-gtk-jump-to-ltr.png and b/addons/web/static/src/img/icons/terp-gtk-jump-to-ltr.png differ diff --git a/addons/web/static/src/img/icons/terp-gtk-jump-to-rtl.png b/addons/web/static/src/img/icons/terp-gtk-jump-to-rtl.png index 7b5785c4963..3c2db42dfde 100644 Binary files a/addons/web/static/src/img/icons/terp-gtk-jump-to-rtl.png and b/addons/web/static/src/img/icons/terp-gtk-jump-to-rtl.png differ diff --git a/addons/web/static/src/img/icons/terp-gtk-media-pause.png b/addons/web/static/src/img/icons/terp-gtk-media-pause.png index 2896ad8e27f..3941af88653 100644 Binary files a/addons/web/static/src/img/icons/terp-gtk-media-pause.png and b/addons/web/static/src/img/icons/terp-gtk-media-pause.png differ diff --git a/addons/web/static/src/img/icons/terp-gtk-select-all.png b/addons/web/static/src/img/icons/terp-gtk-select-all.png index b71a6493791..d05a295ac62 100644 Binary files a/addons/web/static/src/img/icons/terp-gtk-select-all.png and b/addons/web/static/src/img/icons/terp-gtk-select-all.png differ diff --git a/addons/web/static/src/img/icons/terp-hr.png b/addons/web/static/src/img/icons/terp-hr.png index ba0241e6362..1e8eede30ca 100644 Binary files a/addons/web/static/src/img/icons/terp-hr.png and b/addons/web/static/src/img/icons/terp-hr.png differ diff --git a/addons/web/static/src/img/icons/terp-mail-forward.png b/addons/web/static/src/img/icons/terp-mail-forward.png index 3d4e694b6dc..637573d310b 100644 Binary files a/addons/web/static/src/img/icons/terp-mail-forward.png and b/addons/web/static/src/img/icons/terp-mail-forward.png differ diff --git a/addons/web/static/src/img/icons/terp-mail_delete.png b/addons/web/static/src/img/icons/terp-mail_delete.png index 90fb5239f02..b0b9e4ba691 100644 Binary files a/addons/web/static/src/img/icons/terp-mail_delete.png and b/addons/web/static/src/img/icons/terp-mail_delete.png differ diff --git a/addons/web/static/src/img/icons/terp-marketing.png b/addons/web/static/src/img/icons/terp-marketing.png index 1b04b599734..e3545242442 100644 Binary files a/addons/web/static/src/img/icons/terp-marketing.png and b/addons/web/static/src/img/icons/terp-marketing.png differ diff --git a/addons/web/static/src/img/icons/terp-mrp.png b/addons/web/static/src/img/icons/terp-mrp.png index c2b4ea31ec3..cd949c89213 100644 Binary files a/addons/web/static/src/img/icons/terp-mrp.png and b/addons/web/static/src/img/icons/terp-mrp.png differ diff --git a/addons/web/static/src/img/icons/terp-partner.png b/addons/web/static/src/img/icons/terp-partner.png index aab206a1d42..74b2414739e 100644 Binary files a/addons/web/static/src/img/icons/terp-partner.png and b/addons/web/static/src/img/icons/terp-partner.png differ diff --git a/addons/web/static/src/img/icons/terp-personal.png b/addons/web/static/src/img/icons/terp-personal.png index 0890c4d0e51..8e13350629b 100644 Binary files a/addons/web/static/src/img/icons/terp-personal.png and b/addons/web/static/src/img/icons/terp-personal.png differ diff --git a/addons/web/static/src/img/icons/terp-product.png b/addons/web/static/src/img/icons/terp-product.png index 99f58d95a8b..1009191c180 100644 Binary files a/addons/web/static/src/img/icons/terp-product.png and b/addons/web/static/src/img/icons/terp-product.png differ diff --git a/addons/web/static/src/img/icons/terp-project.png b/addons/web/static/src/img/icons/terp-project.png index cd95ae84e43..2686faba528 100644 Binary files a/addons/web/static/src/img/icons/terp-project.png and b/addons/web/static/src/img/icons/terp-project.png differ diff --git a/addons/web/static/src/img/icons/terp-purchase.png b/addons/web/static/src/img/icons/terp-purchase.png index 1e801f57485..3d5fcb67f4f 100644 Binary files a/addons/web/static/src/img/icons/terp-purchase.png and b/addons/web/static/src/img/icons/terp-purchase.png differ diff --git a/addons/web/static/src/img/icons/terp-report.png b/addons/web/static/src/img/icons/terp-report.png index ada36a2de24..6586ffcc501 100644 Binary files a/addons/web/static/src/img/icons/terp-report.png and b/addons/web/static/src/img/icons/terp-report.png differ diff --git a/addons/web/static/src/img/icons/terp-sale.png b/addons/web/static/src/img/icons/terp-sale.png index ba0241e6362..1e8eede30ca 100644 Binary files a/addons/web/static/src/img/icons/terp-sale.png and b/addons/web/static/src/img/icons/terp-sale.png differ diff --git a/addons/web/static/src/img/icons/terp-stock.png b/addons/web/static/src/img/icons/terp-stock.png index 0365dfdb8e1..fde0f52f28f 100644 Binary files a/addons/web/static/src/img/icons/terp-stock.png and b/addons/web/static/src/img/icons/terp-stock.png differ diff --git a/addons/web/static/src/img/icons/terp-stock_align_left_24.png b/addons/web/static/src/img/icons/terp-stock_align_left_24.png index 844367bb1a7..a5623e0873c 100644 Binary files a/addons/web/static/src/img/icons/terp-stock_align_left_24.png and b/addons/web/static/src/img/icons/terp-stock_align_left_24.png differ diff --git a/addons/web/static/src/img/icons/terp-stock_effects-object-colorize.png b/addons/web/static/src/img/icons/terp-stock_effects-object-colorize.png index 0ffd95a740a..a31c9930bf9 100644 Binary files a/addons/web/static/src/img/icons/terp-stock_effects-object-colorize.png and b/addons/web/static/src/img/icons/terp-stock_effects-object-colorize.png differ diff --git a/addons/web/static/src/img/icons/terp-stock_format-scientific.png b/addons/web/static/src/img/icons/terp-stock_format-scientific.png index 01f83950804..5b180e871f3 100644 Binary files a/addons/web/static/src/img/icons/terp-stock_format-scientific.png and b/addons/web/static/src/img/icons/terp-stock_format-scientific.png differ diff --git a/addons/web/static/src/img/icons/terp-stock_symbol-selection.png b/addons/web/static/src/img/icons/terp-stock_symbol-selection.png index 5773be57c9b..56803afdcb6 100644 Binary files a/addons/web/static/src/img/icons/terp-stock_symbol-selection.png and b/addons/web/static/src/img/icons/terp-stock_symbol-selection.png differ diff --git a/addons/web/static/src/img/icons/terp-stock_zoom.png b/addons/web/static/src/img/icons/terp-stock_zoom.png index e96f05e5905..088c3b379b4 100644 Binary files a/addons/web/static/src/img/icons/terp-stock_zoom.png and b/addons/web/static/src/img/icons/terp-stock_zoom.png differ diff --git a/addons/web/static/src/img/icons/terp-tools.png b/addons/web/static/src/img/icons/terp-tools.png index 379f7617427..4a44ce58e69 100644 Binary files a/addons/web/static/src/img/icons/terp-tools.png and b/addons/web/static/src/img/icons/terp-tools.png differ diff --git a/addons/web/static/src/img/iconset-a-help.png b/addons/web/static/src/img/iconset-a-help.png index 4af5ac170d6..a9df2902ed3 100644 Binary files a/addons/web/static/src/img/iconset-a-help.png and b/addons/web/static/src/img/iconset-a-help.png differ diff --git a/addons/web/static/src/img/iconset-b-remove.png b/addons/web/static/src/img/iconset-b-remove.png index 497f03b4ceb..48eb9670641 100644 Binary files a/addons/web/static/src/img/iconset-b-remove.png and b/addons/web/static/src/img/iconset-b-remove.png differ diff --git a/addons/web/static/src/img/logo.png b/addons/web/static/src/img/logo.png index 8f1c5c6085f..231cc26379f 100644 Binary files a/addons/web/static/src/img/logo.png and b/addons/web/static/src/img/logo.png differ diff --git a/addons/web/static/src/img/logo2.png b/addons/web/static/src/img/logo2.png index aca5f4c60d8..6b32937328b 100644 Binary files a/addons/web/static/src/img/logo2.png and b/addons/web/static/src/img/logo2.png differ diff --git a/addons/web/static/src/img/nologo.png b/addons/web/static/src/img/nologo.png index 711269813a1..36ff0e1d16c 100644 Binary files a/addons/web/static/src/img/nologo.png and b/addons/web/static/src/img/nologo.png differ diff --git a/addons/web/static/src/img/pager_first.png b/addons/web/static/src/img/pager_first.png index 83074ed696f..8f9005bfe2f 100644 Binary files a/addons/web/static/src/img/pager_first.png and b/addons/web/static/src/img/pager_first.png differ diff --git a/addons/web/static/src/img/pager_last.png b/addons/web/static/src/img/pager_last.png index dedcede4b62..582eb9620a1 100644 Binary files a/addons/web/static/src/img/pager_last.png and b/addons/web/static/src/img/pager_last.png differ diff --git a/addons/web/static/src/img/pager_next.png b/addons/web/static/src/img/pager_next.png index 9b5e7090735..068fa1d980d 100644 Binary files a/addons/web/static/src/img/pager_next.png and b/addons/web/static/src/img/pager_next.png differ diff --git a/addons/web/static/src/img/pager_previous.png b/addons/web/static/src/img/pager_previous.png index 7134186008c..7cd2a0de240 100644 Binary files a/addons/web/static/src/img/pager_previous.png and b/addons/web/static/src/img/pager_previous.png differ diff --git a/addons/web/static/src/img/partner.png b/addons/web/static/src/img/partner.png index aab206a1d42..74b2414739e 100644 Binary files a/addons/web/static/src/img/partner.png and b/addons/web/static/src/img/partner.png differ diff --git a/addons/web/static/src/img/placeholder.png b/addons/web/static/src/img/placeholder.png index 25af75ee815..c2e345e82e5 100644 Binary files a/addons/web/static/src/img/placeholder.png and b/addons/web/static/src/img/placeholder.png differ diff --git a/addons/web/static/src/img/product.png b/addons/web/static/src/img/product.png index 99f58d95a8b..1009191c180 100644 Binary files a/addons/web/static/src/img/product.png and b/addons/web/static/src/img/product.png differ diff --git a/addons/web/static/src/img/toggle-a-bg.png b/addons/web/static/src/img/toggle-a-bg.png index b9837ab233e..207a348725b 100644 Binary files a/addons/web/static/src/img/toggle-a-bg.png and b/addons/web/static/src/img/toggle-a-bg.png differ diff --git a/addons/web/static/src/img/ui/field_calendar.png b/addons/web/static/src/img/ui/field_calendar.png index 99a1f3f9ef1..5fdccf561ba 100644 Binary files a/addons/web/static/src/img/ui/field_calendar.png and b/addons/web/static/src/img/ui/field_calendar.png differ diff --git a/addons/web/static/src/img/ui/group-expanded.png b/addons/web/static/src/img/ui/group-expanded.png index 3f16536e123..ca76157826a 100644 Binary files a/addons/web/static/src/img/ui/group-expanded.png and b/addons/web/static/src/img/ui/group-expanded.png differ diff --git a/addons/web/static/src/img/ui/group-folded.png b/addons/web/static/src/img/ui/group-folded.png index 2909b0c268f..5fc4e533d1f 100644 Binary files a/addons/web/static/src/img/ui/group-folded.png and b/addons/web/static/src/img/ui/group-folded.png differ diff --git a/addons/web/static/src/img/user_menu_avatar.png b/addons/web/static/src/img/user_menu_avatar.png index a2c70ea7d49..f78ea0203d9 100644 Binary files a/addons/web/static/src/img/user_menu_avatar.png and b/addons/web/static/src/img/user_menu_avatar.png differ diff --git a/addons/web/static/src/img/view_empty_arrow.png b/addons/web/static/src/img/view_empty_arrow.png index 99561e3abf3..dc2b88a3c82 100644 Binary files a/addons/web/static/src/img/view_empty_arrow.png and b/addons/web/static/src/img/view_empty_arrow.png differ diff --git a/addons/web/static/src/img/warning.png b/addons/web/static/src/img/warning.png index cbfb25a89cd..85c1718e877 100644 Binary files a/addons/web/static/src/img/warning.png and b/addons/web/static/src/img/warning.png differ diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 884dc41a9f9..0c73a9b8a3c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -430,7 +430,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ var fetch_langs = this.rpc("/web/session/get_lang_list", {}).done(function(result) { self.lang_list = result; }); - return $.when(fetch_db, fetch_langs).done(self.do_render); + return $.when(fetch_db, fetch_langs).always(self.do_render); }, do_render: function() { var self = this; @@ -950,7 +950,7 @@ instance.web.Menu = instance.web.Widget.extend({ }, do_load_needaction: function (menu_ids) { var self = this; - menu_ids = _.reject(menu_ids, _.isEmpty); + menu_ids = _.compact(menu_ids); if (_.isEmpty(menu_ids)) { return $.when(); } @@ -1184,6 +1184,25 @@ instance.web.UserMenu = instance.web.Widget.extend({ }); } }, + on_menu_account: function() { + var self = this; + if (!this.getParent().has_uncommitted_changes()) { + var P = new instance.web.Model('ir.config_parameter'); + P.call('get_param', ['database.uuid']).then(function(dbuuid) { + var state = { + 'd': instance.session.db, + 'u': window.location.protocol + '//' + window.location.host, + }; + var params = { + response_type: 'token', + client_id: dbuuid || '', + state: JSON.stringify(state), + scope: 'userinfo', + }; + instance.web.redirect('https://accounts.openerp.com/oauth2/auth?'+$.param(params)); + }); + } + }, on_menu_about: function() { var self = this; self.rpc("/web/webclient/version_info", {}).done(function(res) { diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index dedb4a49710..6fc837333b6 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -555,19 +555,19 @@ instance.web.qweb.default_dict = { instance.web.qweb.preprocess_node = function() { // Note that 'this' is the Qweb Node switch (this.node.nodeType) { - case 3: - case 4: + case Node.TEXT_NODE: + case Node.CDATA_SECTION_NODE: // Text and CDATAs var translation = this.node.parentNode.attributes['t-translation']; if (translation && translation.value === 'off') { return; } - var match = /^(\s*)(.+?)(\s*)$/.exec(this.node.data); + var match = /^(\s*)([\s\S]+?)(\s*)$/.exec(this.node.data); if (match) { this.node.data = match[1] + instance.web._t(match[2]) + match[3]; } break; - case 1: + case Node.ELEMENT_NODE: // Element var attr, attrs = ['label', 'title', 'alt', 'placeholder']; while (attr = attrs.pop()) { diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index f1b043bacf9..679afe77bcd 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -112,24 +112,27 @@ instance.web.Query = instance.web.Class.extend({ * @returns {jQuery.Deferred> | null} */ group_by: function (grouping) { - if (grouping === undefined) { - return null; + var ctx = instance.web.pyeval.eval( + 'context', this._model.context(this._context)); + + // undefined passed in explicitly (!) + if (_.isUndefined(grouping)) { + grouping = []; } if (!(grouping instanceof Array)) { grouping = _.toArray(arguments); } - if (_.isEmpty(grouping)) { return null; } + if (_.isEmpty(grouping) && !ctx['group_by_no_leaf']) { + return null; + } var self = this; - - var ctx = instance.web.pyeval.eval( - 'context', this._model.context(this._context)); return this._model.call('read_group', { groupby: grouping, fields: _.uniq(grouping.concat(this._fields || [])), domain: this._model.domain(this._filter), - context: this._model.context(this._context), + context: ctx, offset: this._offset, limit: this._limit, orderby: instance.web.serialize_sort(this._order_by) || false @@ -325,7 +328,7 @@ instance.web.Model = instance.web.Class.extend({ * Fetches the model's domain, combined with the provided domain if any * * @param {Array} [domain] to combine with the model's internal domain - * @returns The model's internal domain, or the AND-ed union of the model's internal domain and the provided domain + * @returns {instance.web.CompoundDomain} The model's internal domain, or the AND-ed union of the model's internal domain and the provided domain */ domain: function (domain) { if (!domain) { return this._domain; } @@ -337,7 +340,7 @@ instance.web.Model = instance.web.Class.extend({ * combined with the provided context if any * * @param {Object} [context] to combine with the model's internal context - * @returns The union of the user's context and the model's internal context, as well as the provided context if any. In that order. + * @returns {instance.web.CompoundContext} The union of the user's context and the model's internal context, as well as the provided context if any. In that order. */ context: function (context) { return new instance.web.CompoundContext( @@ -487,7 +490,12 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, * @returns {$.Deferred} */ create: function(data, options) { - return this._model.call('create', [data], {context: this.get_context()}); + var self = this; + return this._model.call('create', [data], { + context: this.get_context() + }).done(function () { + self.trigger('dataset_changed', data, options) + }); }, /** * Saves the provided data in an existing db record @@ -502,7 +510,12 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, */ write: function (id, data, options) { options = options || {}; - return this._model.call('write', [[id], data], {context: this.get_context(options.context)}).done(this.trigger('dataset_changed', id, data, options)); + var self = this; + return this._model.call('write', [[id], data], { + context: this.get_context(options.context) + }).done(function () { + self.trigger('dataset_changed', id, data, options) + }); }, /** * Deletes an existing record from the database @@ -510,7 +523,12 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, * @param {Number|String} ids identifier of the record to delete */ unlink: function(ids) { - return this._model.call('unlink', [ids], {context: this.get_context()}).done(this.trigger('dataset_changed', ids)); + var self = this; + return this._model.call('unlink', [ids], { + context: this.get_context() + }).done(function () { + self.trigger('dataset_changed', ids) + }); }, /** * Calls an arbitrary RPC method @@ -604,6 +622,13 @@ instance.web.DataSet = instance.web.Class.extend(instance.web.PropertiesMixin, alter_ids: function(n_ids) { this.ids = n_ids; }, + remove_ids: function (ids) { + this.alter_ids(_(this.ids).difference(ids)); + }, + add_ids: function(ids, at) { + var args = [at, 0].concat(_.difference(ids, this.ids)); + this.ids.splice.apply(this.ids, args); + }, /** * Resequence records. * @@ -701,22 +726,28 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({ get_domain: function (other_domain) { this._model.domain(other_domain); }, + alter_ids: function (ids) { + this._super(ids); + if (this.index !== null && this.index >= this.ids.length) { + this.index = this.ids.length > 0 ? this.ids.length - 1 : 0; + } + }, + remove_ids: function (ids) { + var before = this.ids.length; + this._super(ids); + if (this._length) { + this._length -= (before - this.ids.length); + } + }, unlink: function(ids, callback, error_callback) { var self = this; return this._super(ids).done(function(result) { - self.ids = _(self.ids).difference(ids); - if (self._length) { - self._length -= 1; - } - if (self.index !== null) { - self.index = self.index <= self.ids.length - 1 ? - self.index : (self.ids.length > 0 ? self.ids.length -1 : 0); - } + self.remove_ids( ids); self.trigger("dataset_changed", ids, callback, error_callback); }); }, size: function () { - if (this._length !== undefined) { + if (this._length != null) { return this._length; } return this._super(); diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js index e38d21d1cd2..fb5e391effd 100644 --- a/addons/web/static/src/js/data_export.js +++ b/addons/web/static/src/js/data_export.js @@ -4,15 +4,34 @@ var QWeb = instance.web.qweb, instance.web.DataExport = instance.web.Dialog.extend({ template: 'ExportTreeView', dialog_title: {toString: function () { return _t("Export Data"); }}, + events: { + 'click #add_field': function () { + var self = this; + this.$('#field-tree-structure tr.ui-selected') + .removeClass('ui-selected') + .find('a').each(function () { + var id = $(this).attr('id').split('-')[1]; + var string = $(this).attr('string'); + self.add_field(id, string); + }); + }, + 'click #remove_field': function () { + this.$('#fields_list option:selected').remove(); + }, + 'click #remove_all_field': function () { + this.$('#fields_list').empty(); + }, + 'click #export_new_list': 'on_show_save_list', + }, init: function(parent, dataset) { var self = this; - options = { - buttons : [ - {text: _t("Close"), click: function() { self.close(); }}, - {text: _t("Export To File"), click: function() { self.on_click_export_data(); }} + var options = { + buttons: [ + {text: _t("Close"), click: function () { self.close(); }}, + {text: _t("Export To File"), click: function () { self.on_click_export_data(); }} ], - close: function(event, ui){ self.close();} - } + close: function () { self.close();} + }; this._super(parent, options); this.records = {}; this.dataset = dataset; @@ -23,24 +42,6 @@ instance.web.DataExport = instance.web.Dialog.extend({ var self = this; this._super.apply(this, arguments); self.$el.removeClass('ui-dialog-content ui-widget-content'); - self.$el.find('#add_field').click(function() { - if ($('#field-tree-structure tr.ui-selected')) { - var fld = self.$el.find('#field-tree-structure tr.ui-selected').find('a'); - for (var i = 0; i < fld.length; i++) { - var id = $(fld[i]).attr('id').split('-')[1]; - var string = $(fld[i]).attr('string'); - self.add_field(id, string); - } - self.$el.find('#field-tree-structure tr').removeClass('ui-selected'); - } - }); - self.$el.find('#remove_field').click(function() { - self.$el.find('#fields_list option:selected').remove(); - }); - self.$el.find('#remove_all_field').click(function() { - self.$el.find('#fields_list').empty(); - }); - this.$el.find('#export_new_list').click(this.on_show_save_list); var got_fields = new $.Deferred(); this.$el.find('#import_compat').change(function() { @@ -49,7 +50,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ var import_comp = self.$el.find("#import_compat").val(); self.rpc("/web/export/get_fields", { model: self.dataset.model, - import_compat: Boolean(import_comp) + import_compat: !!import_comp, }).done(function (records) { got_fields.resolve(); self.on_show_data(records); @@ -79,7 +80,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ var self = this; if (self.$el.find('#saved_export_list').is(':hidden')) { self.$el.find('#ExistsExportList').show(); - return; + return $.when(); } return this.exports.read_slice(['name'], { domain: [['resource', '=', this.dataset.model]] @@ -192,7 +193,6 @@ instance.web.DataExport = instance.web.Dialog.extend({ }, on_show_data: function(result, after) { var self = this; - var imp_cmpt = Boolean(self.$el.find("#import_compat").val()); if (after) { var current_tr = self.$el.find("tr[id='treerow-" + after + "']"); @@ -220,15 +220,16 @@ instance.web.DataExport = instance.web.Dialog.extend({ frst_click = self.$el.find("tr[id^='treerow-']")[self.row_index-1]; $(frst_click).addClass("ui-selected"); } else { + var i; if (this.rowIndex >=self.row_index) { - for (var i = (self.row_index-1); i < this.rowIndex; i++) { + for (i = (self.row_index-1); i < this.rowIndex; i++) { scnd_click = self.$el.find("tr[id^='treerow-']")[i]; if (!$(scnd_click).find('#tree-column').hasClass("oe_export_readonlyfield")) { $(scnd_click).addClass("ui-selected"); } } } else { - for (var i = (self.row_index-1); i >= (this.rowIndex-1); i--) { + for (i = (self.row_index-1); i >= (this.rowIndex-1); i--) { scnd_click = self.$el.find("tr[id^='treerow-']")[i]; if (!$(scnd_click).find('#tree-column').hasClass("oe_export_readonlyfield")) { $(scnd_click).addClass("ui-selected"); @@ -263,6 +264,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ self.$el.find("tr[id='treerow-" + record.id + "']").keydown(function(e) { var keyCode = e.keyCode || e.which; var arrow = {left: 37, up: 38, right: 39, down: 40 }; + var elem; switch (keyCode) { case arrow.left: if ($(this).hasClass('open')) { @@ -275,7 +277,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ } break; case arrow.up: - var elem = this; + elem = this; $(elem).removeClass("ui-selected"); while (!$(elem).prev().is(":visible")) { elem = $(elem).prev(); @@ -286,7 +288,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ $(elem).prev().find('a').focus(); break; case arrow.down: - var elem = this; + elem = this; $(elem).removeClass("ui-selected"); while(!$(elem).next().is(":visible")) { elem = $(elem).next(); @@ -353,14 +355,13 @@ instance.web.DataExport = instance.web.Dialog.extend({ } }, get_fields: function() { - var export_field = []; - this.$el.find("#fields_list option").each(function() { - export_field.push($(this).val()); - }); - if (!export_field.length) { + var export_fields = this.$("#fields_list option").map(function() { + return $(this).val(); + }).get(); + if (!export_fields.length) { alert(_t("Please select fields to save export list...")); } - return export_field; + return export_fields; }, on_click_export_data: function() { var self = this; @@ -374,21 +375,24 @@ instance.web.DataExport = instance.web.Dialog.extend({ alert(_t("Please select fields to export...")); return; } - exported_fields.unshift({name: 'id', label: 'External ID'}); + var export_format = this.$el.find("#export_format").val(); + var ids_to_export = this.$('#export_selection_only').prop('checked') + ? this.getParent().get_selected_ids() + : this.dataset.ids; + instance.web.blockUI(); this.session.get_file({ url: '/web/export/' + export_format, data: {data: JSON.stringify({ model: this.dataset.model, fields: exported_fields, - ids: this.dataset.ids, + ids: ids_to_export, domain: this.dataset.domain, - import_compat: Boolean( - this.$el.find("#import_compat").val()) + import_compat: !!this.$el.find("#import_compat").val(), })}, - complete: instance.web.unblockUI + complete: instance.web.unblockUI, }); }, close: function() { diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index f5449ed8bba..cef92ccf293 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -131,6 +131,7 @@ my.InputView = instance.web.Widget.extend({ paste: 'onPaste', }, getSelection: function () { + this.el.normalize(); // get Text node var root = this.el.childNodes[0]; if (!root || !root.textContent) { @@ -139,6 +140,16 @@ my.InputView = instance.web.Widget.extend({ return {start: 0, end: 0}; } var range = window.getSelection().getRangeAt(0); + // In Firefox, depending on the way text is selected (drag, double- or + // triple-click) the range may start or end on the parent of the + // selected text node‽ Check for this condition and fixup the range + // note: apparently with C-a this can go even higher? + if (range.startContainer === this.el && range.startOffset === 0) { + range.setStart(root, 0); + } + if (range.endContainer === this.el && range.endOffset === 1) { + range.setEnd(root, root.length) + } assert(range.startContainer === root, "selection should be in the input view"); assert(range.endContainer === root, @@ -149,6 +160,7 @@ my.InputView = instance.web.Widget.extend({ } }, onKeydown: function (e) { + this.el.normalize(); var sel; switch (e.which) { // Do not insert newline, but let it bubble so searchview can use it @@ -186,6 +198,7 @@ my.InputView = instance.web.Widget.extend({ } }, setCursorAtEnd: function () { + this.el.normalize(); var sel = window.getSelection(); sel.removeAllRanges(); var range = document.createRange(); @@ -196,13 +209,14 @@ my.InputView = instance.web.Widget.extend({ // from about half the link to half the text, paste in search box then // hit the left arrow key, getSelection would blow up). // - // Explicitly selecting only the inner text node (only child node at - // this point, though maybe we should assert that) avoiids the issue + // Explicitly selecting only the inner text node (only child node + // since we've normalized the parent) avoids the issue range.selectNode(this.el.childNodes[0]); range.collapse(false); sel.addRange(range); }, onPaste: function () { + this.el.normalize(); // In MSIE and Webkit, it is possible to get various representations of // the clipboard data at this point e.g. // window.clipboardData.getData('Text') and @@ -224,6 +238,7 @@ my.InputView = instance.web.Widget.extend({ var data = this.$el.text(); // paste raw text back in this.$el.empty().text(data); + this.el.normalize(); // Set the cursor at the end of the text, so the cursor is not lost // in some kind of error-spawning limbo. this.setCursorAtEnd(); @@ -326,7 +341,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea } }, 'autocompleteopen': function () { - this.$el.autocomplete('widget').css('z-index', 3); + this.$el.autocomplete('widget').css('z-index', 1004); }, }, /** @@ -449,11 +464,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea var autocomplete = this.$el.autocomplete({ source: this.proxy('complete_global_search'), select: this.proxy('select_completion'), + search: function () { self.$el.autocomplete('close'); }, focus: function (e) { e.preventDefault(); }, html: true, autoFocus: true, minLength: 1, - delay: 0 + delay: 0, }).data('autocomplete'); // MonkeyPatch autocomplete instance @@ -526,7 +542,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea var val = this.$el.val(); this.$el.val(''); var complete = this.$el.data('autocomplete'); - if ((val && complete.term === undefined) || complete.previous !== undefined) { + if ((val && complete.term === undefined) || complete.previous) { throw new Error("new jquery.ui version altering implementation" + " details relied on"); } @@ -1039,7 +1055,9 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in facet.values.each(function (v) { var i = _(self.filters).indexOf(v.get('value')); if (i === -1) { return; } - $filters.eq(i).addClass('oe_selected'); + $filters.filter(function () { + return Number($(this).data('index')) === i; + }).addClass('oe_selected'); }); }, /** @@ -1129,7 +1147,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in }); }, toggle_filter: function (e) { - this.toggle(this.filters[$(e.target).index()]); + this.toggle(this.filters[Number($(e.target).data('index'))]); }, toggle: function (filter) { this.view.query.toggle(this.make_facet([this.make_value(filter)])); @@ -1337,20 +1355,22 @@ instance.web.search.CharField = instance.web.search.Field.extend( /** @lends ins } }); instance.web.search.NumberField = instance.web.search.Field.extend(/** @lends instance.web.search.NumberField# */{ - value_from: function () { - if (!this.$el.val()) { - return null; - } - var val = this.parse(this.$el.val()), - check = Number(this.$el.val()); - if (isNaN(val) || val !== check) { - this.$el.addClass('error'); - throw new instance.web.search.Invalid( - this.attrs.name, this.$el.val(), this.error_message); - } - this.$el.removeClass('error'); - return val; - } + complete: function (value) { + var val = this.parse(value); + if (isNaN(val)) { return $.when(); } + var label = _.str.sprintf( + _t("Search %(field)s for: %(value)s"), { + field: '' + this.attrs.string + '', + value: '' + _.str.escapeHTML(value) + ''}); + return $.when([{ + label: label, + facet: { + category: this.attrs.string, + field: this, + values: [{label: value, value: val}] + } + }]); + }, }); /** * @class @@ -1888,7 +1908,7 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @ this._super(parent); this.fields = _(fields).chain() .map(function(val, key) { return _.extend({}, val, {'name': key}); }) - .filter(function (field) { return !field.deprecated; }) + .filter(function (field) { return !field.deprecated && (field.store === void 0 || field.store || field.fnct_search); }) .sortBy(function(field) {return field.string;}) .value(); this.attrs = {_: _, fields: this.fields, selected: null}; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 32e86d69bed..c87922937a2 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2721,6 +2721,11 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc self.internal_set_value(self.$textarea.val()); } }); + if (this.field.translate) { + var $img = $('') + .click(this.on_translate); + this.$cleditor.$toolbar.append($img); + } } }, render_value: function() { @@ -3241,6 +3246,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc self.display_value_backup = {}; self.render_value(); self.focus(); + self.view.do_onchange(self); }); }); @@ -4217,7 +4223,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in ext: { autocomplete: { selectFromDropdown: function() { - $(this).trigger('hideDropdown'); + this.trigger('hideDropdown'); var index = Number(this.selectedSuggestionElement().children().children().data('index')); var data = self.search_result[index]; if (data.id) { @@ -4226,6 +4232,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in ignore_blur = true; data.action(); } + this.trigger('setSuggestions', {result : []}); }, }, tags: { @@ -4960,7 +4967,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend this.searchview.hide(); } if (this.view_list) { - this.view_list.$el.hide(); + this.view_list.do_hide(); } this.setup_form_view(); }, diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 840effa9221..4f58b002328 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -503,12 +503,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi var reloaded = $.Deferred(); this.$el.find('.oe_list_content').append( this.groups.render(function () { - if (self.dataset.index == null) { - var has_one = false; - self.records.each(function () { has_one = true; }); - if (has_one) { + if (self.dataset.index == null && self.records.length || + self.dataset.index >= self.records.length) { self.dataset.index = 0; - } } self.compute_aggregates(); reloaded.resolve(); @@ -530,12 +527,13 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi return r.tag === 'field'; }), 'name') ).done(function (records) { - if (!records[0]) { + var values = records[0]; + if (!values) { self.records.remove(record); return; } - _(records[0]).each(function (value, key) { - record.set(key, value, {silent: true}); + _(_.keys(values)).each(function(key){ + record.set(key, values[key], {silent: true}); }); record.trigger('change', record); }); @@ -896,7 +894,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. this.record_callbacks = { 'remove': function (event, record) { var id = record.get('id'); - self.dataset.remove_ids([id]) + self.dataset.remove_ids([id]); var $row = self.$current.children('[data-id=' + id + ']'); var index = $row.data('index'); $row.remove(); @@ -909,12 +907,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. throw new Error(_.str.sprintf( _t("Setting 'id' attribute on existing record %s"), JSON.stringify(record.attributes) )); } - if (!_.contains(self.dataset.ids, value)) { - // add record to dataset if not already in (added by - // the form view?) - self.dataset.ids.splice( - self.records.indexOf(record), 0, value); - } + self.dataset.add_ids([value], self.records.indexOf(record)); // Set id on new record $row = self.$current.children('[data-id=false]'); } else { @@ -925,6 +918,8 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. }, 'add': function (ev, records, record, index) { var $new_row = $(self.render_record(record)); + var id = record.get('id'); + if (id) { self.dataset.add_ids([id], index); } if (index === 0) { $new_row.prependTo(self.$current); diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 4e042b60c5d..512fc4ff373 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -429,7 +429,6 @@ openerp.web.list_editable = function (instance) { var index = this.records.indexOf(source_record) + 1; record = this.make_empty_record(id); this.records.add(record, {at: index}); - this.dataset.ids.splice(index, 0, id); } return this.reload_record(record); }, diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index fdb2eeee329..78d733110d8 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1363,8 +1363,8 @@ instance.web.View = instance.web.Widget.extend({ } args.push(context); return dataset.call_button(action_data.name, args).then(handler).then(function () { - if (self.ViewManager.ActionManager) { - self.ViewManager.ActionManager.__parentedParent.menu.do_reload_needaction(); + if (instance.webclient) { + instance.webclient.menu.do_reload_needaction(); } }); } else if (action_data.type=="action") { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 14c7f722ec2..a459486bf05 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -422,6 +422,7 @@
  • Preferences
  • +
  • My OpenERP.com account
  • About OpenERP
  • Help
  • Log out
  • @@ -739,7 +740,7 @@ - + @@ -1743,6 +1744,9 @@ + + + diff --git a/addons/web_calendar/__init__.py b/addons/web_calendar/__init__.py index 013e4b7ec4e..e69de29bb2d 100644 --- a/addons/web_calendar/__init__.py +++ b/addons/web_calendar/__init__.py @@ -1 +0,0 @@ -#!/usr/bin/python diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.png index 5036c9c2efb..f4f322f7528 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/buttons.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png index 3bba608beeb..cbe2e940f64 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png index 510dfd0b17f..8cb8a8106ad 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png index 31d6626cdd4..5e13a09f6f6 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/images.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/images.png index 8faac638896..24767220be0 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/images.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/images.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/resize_dots.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/resize_dots.png index 44045c21c35..011bfafbe12 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/resize_dots.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/resize_dots.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_left.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_left.png index 133dabca745..f0fc5d0e3ba 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_left.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_left.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_right.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_right.png index ced03e5e4ed..14167035058 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_right.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_right.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/close_icon.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/close_icon.png index 4aa5d6620e4..23b826f113c 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/close_icon.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/close_icon.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/controls.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/controls.png index f9a99e21fae..c336f88d60f 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/controls.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/controls.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg.png index 1b02c11f18a..5d5836930f8 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg_now.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg_now.png index f1875140dbd..0f93ee3bcde 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg_now.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg_now.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resize_dots.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resize_dots.png index c26e2a3aaff..8a767c78dac 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resize_dots.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resize_dots.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resizing.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resizing.png index 389ca543e0d..0d3953baf24 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resizing.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resizing.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png index f874fa321f7..7f7a5dd3642 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png index 88e22e1682b..61261dc5dff 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.png index 8f789556215..1cf5dbbeddd 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.png index 697be65515c..bdd7e6fc320 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png index 24957208fdc..a6c5388c45d 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png index a3bae3e0186..9f92899f488 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png index 31d6626cdd4..5e13a09f6f6 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png index 22d630927f3..847c8e8830b 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png index 287a23bbdcf..cd47de7e0cd 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png index f0314fa6099..0af7c9357f6 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png index 15681b311e0..bd61e3fbd1c 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png index f43a46357b2..af75532c8f8 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png index 8f9a4f6da02..5bee85bbb98 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png index 094b805f609..1606c6d50ca 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png index 7ee92852294..b47770cfa2b 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png index 6e5ffb852f0..dcd1340019b 100644 Binary files a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png and b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png differ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/license.txt b/addons/web_calendar/static/lib/dhtmlxScheduler/license.txt index 4a7d08c91e4..f695d8ecb2c 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/license.txt +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/license.txt @@ -1,228 +1,228 @@ - - GNU GENERAL PUBLIC LICENSE - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. - -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -Everyone is permitted to copy and distribute verbatim copies - -of this license document, but changing it is not allowed. - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a -notice placed by the copyright holder saying it may be distributed under -the terms of this General Public License. The "Program", below, refers -to any such program or work, and a "work based on the Program" means -either the Program or any derivative work under copyright law: that is -to say, a work containing the Program or a portion of it, either -verbatim or with modifications and/or translated into another language. -(Hereinafter, translation is included without limitation in the term -"modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of running -the Program is not restricted, and the output from the Program is -covered only if its contents constitute a work based on the Program -(independent of having been made by running the Program). Whether that -is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source -code as you receive it, in any medium, provided that you conspicuously -and appropriately publish on each copy an appropriate copyright notice -and disclaimer of warranty; keep intact all the notices that refer to -this License and to the absence of any warranty; and give any other -recipients of the Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of -it, thus forming a work based on the Program, and copy and distribute -such modifications or work under the terms of Section 1 above, provided -that you also meet all of these conditions: - -a) You must cause the modified files to carry prominent notices stating -that you changed the files and the date of any change. - -b) You must cause any work that you distribute or publish, that in whole -or in part contains or is derived from the Program or any part thereof, -to be licensed as a whole at no charge to all third parties under the -terms of this License. - -c) If the modified program normally reads commands interactively when -run, you must cause it, when started running for such interactive use in -the most ordinary way, to print or display an announcement including an -appropriate copyright notice and a notice that there is no warranty (or -else, saying that you provide a warranty) and that users may -redistribute the program under these conditions, and telling the user -how to view a copy of this License. (Exception: if the Program itself is -interactive but does not normally print such an announcement, your work -based on the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, and -can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based on -the Program, the distribution of the whole must be on the terms of this -License, whose permissions for other licensees extend to the entire -whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of a -storage or distribution medium does not bring the other work under the -scope of this License. - -3. You may copy and distribute the Program (or a work based on it, under -Section 2) in object code or executable form under the terms of Sections -1 and 2 above provided that you also do one of the following: - -a) Accompany it with the complete corresponding machine-readable source -code, which must be distributed under the terms of Sections 1 and 2 -above on a medium customarily used for software interchange; or, - -b) Accompany it with a written offer, valid for at least three years, to -give any third party, for a charge no more than your cost of physically -performing source distribution, a complete machine-readable copy of the -corresponding source code, to be distributed under the terms of Sections -1 and 2 above on a medium customarily used for software interchange; or, - -c) Accompany it with the information you received as to the offer to -distribute corresponding source code. (This alternative is allowed only -for noncommercial distribution and only if you received the program in -object code or executable form with such an offer, in accord with -Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source code -means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to control -compilation and installation of the executable. However, as a special -exception, the source code distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies the -executable. - -If distribution of executable or object code is made by offering access -to copy from a designated place, then offering equivalent access to copy -the source code from the same place counts as distribution of the source -code, even though third parties are not compelled to copy the source -along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt otherwise -to copy, modify, sublicense or distribute the Program is void, and will -automatically terminate your rights under this License. However, parties -who have received copies, or rights, from you under this License will -not have their licenses terminated so long as such parties remain in -full compliance. - -5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and all -its terms and conditions for copying, distributing or modifying the -Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further restrictions -on the recipients' exercise of the rights granted herein. You are not -responsible for enforcing compliance by third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot distribute -so as to satisfy simultaneously your obligations under this License and -any other pertinent obligations, then as a consequence you may not -distribute the Program at all. For example, if a patent license would -not permit royalty-free redistribution of the Program by all those who -receive copies directly or indirectly through you, then the only way you -could satisfy both it and this License would be to refrain entirely from -distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is implemented -by public license practices. Many people have made generous -contributions to the wide range of software distributed through that -system in reliance on consistent application of that system; it is up to -the author/donor to decide if he or she is willing to distribute -software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be -a consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License may -add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among countries -not thus excluded. In such case, this License incorporates the -limitation as if written in the body of this License. - -9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Program does not specify a version -number of this License, you may choose any version ever published by the -Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the -author to ask for permission. For software which is copyrighted by the -Free Software Foundation, write to the Free Software Foundation; we -sometimes make exceptions for this. Our decision will be guided by the -two goals of preserving the free status of all derivatives of our free -software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE -ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH -YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL -NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR -DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL -DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM -(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED -INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF -THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR -OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - + + GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies + +of this license document, but changing it is not allowed. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed under +the terms of this General Public License. The "Program", below, refers +to any such program or work, and a "work based on the Program" means +either the Program or any derivative work under copyright law: that is +to say, a work containing the Program or a portion of it, either +verbatim or with modifications and/or translated into another language. +(Hereinafter, translation is included without limitation in the term +"modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of running +the Program is not restricted, and the output from the Program is +covered only if its contents constitute a work based on the Program +(independent of having been made by running the Program). Whether that +is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously +and appropriately publish on each copy an appropriate copyright notice +and disclaimer of warranty; keep intact all the notices that refer to +this License and to the absence of any warranty; and give any other +recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of +it, thus forming a work based on the Program, and copy and distribute +such modifications or work under the terms of Section 1 above, provided +that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating +that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole +or in part contains or is derived from the Program or any part thereof, +to be licensed as a whole at no charge to all third parties under the +terms of this License. + +c) If the modified program normally reads commands interactively when +run, you must cause it, when started running for such interactive use in +the most ordinary way, to print or display an announcement including an +appropriate copyright notice and a notice that there is no warranty (or +else, saying that you provide a warranty) and that users may +redistribute the program under these conditions, and telling the user +how to view a copy of this License. (Exception: if the Program itself is +interactive but does not normally print such an announcement, your work +based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, and +can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based on +the Program, the distribution of the whole must be on the terms of this +License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of a +storage or distribution medium does not bring the other work under the +scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections +1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source +code, which must be distributed under the terms of Sections 1 and 2 +above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to +give any third party, for a charge no more than your cost of physically +performing source distribution, a complete machine-readable copy of the +corresponding source code, to be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to +distribute corresponding source code. (This alternative is allowed only +for noncommercial distribution and only if you received the program in +object code or executable form with such an offer, in accord with +Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source code +means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to control +compilation and installation of the executable. However, as a special +exception, the source code distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies the +executable. + +If distribution of executable or object code is made by offering access +to copy from a designated place, then offering equivalent access to copy +the source code from the same place counts as distribution of the source +code, even though third parties are not compelled to copy the source +along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt otherwise +to copy, modify, sublicense or distribute the Program is void, and will +automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties remain in +full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and all +its terms and conditions for copying, distributing or modifying the +Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further restrictions +on the recipients' exercise of the rights granted herein. You are not +responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute +so as to satisfy simultaneously your obligations under this License and +any other pertinent obligations, then as a consequence you may not +distribute the Program at all. For example, if a patent license would +not permit royalty-free redistribution of the Program by all those who +receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is implemented +by public license practices. Many people have made generous +contributions to the wide range of software distributed through that +system in reliance on consistent application of that system; it is up to +the author/donor to decide if he or she is willing to distribute +software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be +a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License may +add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among countries +not thus excluded. In such case, this License incorporates the +limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Program does not specify a version +number of this License, you may choose any version ever published by the +Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the +author to ask for permission. For software which is copyrighted by the +Free Software Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be guided by the +two goals of preserving the free status of all derivatives of our free +software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH +YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR +DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM +(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED +INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR +OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + diff --git a/addons/web_calendar/static/src/img/cal_left.png b/addons/web_calendar/static/src/img/cal_left.png index b9b66aaeb63..acbc4565b4d 100644 Binary files a/addons/web_calendar/static/src/img/cal_left.png and b/addons/web_calendar/static/src/img/cal_left.png differ diff --git a/addons/web_calendar/static/src/img/cal_right.png b/addons/web_calendar/static/src/img/cal_right.png index 3c48e521be4..fc8f8a02697 100644 Binary files a/addons/web_calendar/static/src/img/cal_right.png and b/addons/web_calendar/static/src/img/cal_right.png differ diff --git a/addons/web_calendar/static/src/img/minical_left.png b/addons/web_calendar/static/src/img/minical_left.png index b17118fcc67..5af03c10187 100644 Binary files a/addons/web_calendar/static/src/img/minical_left.png and b/addons/web_calendar/static/src/img/minical_left.png differ diff --git a/addons/web_calendar/static/src/img/minical_right.png b/addons/web_calendar/static/src/img/minical_right.png index ab660de81f0..fc83ac89bd6 100644 Binary files a/addons/web_calendar/static/src/img/minical_right.png and b/addons/web_calendar/static/src/img/minical_right.png differ diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 3c9a8a6fa9d..8da2ad43819 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -4,9 +4,9 @@ (function() { // Monkey patch dhtml scheduler in order to fix a bug. - // It manually implements some kind of dbl click event - // bubbling but fails to do it properly. if (this.scheduler) { + // It manually implements some kind of dbl click event + // bubbling but fails to do it properly. var old_scheduler_dblclick = scheduler._on_dbl_click; scheduler._on_dbl_click = function(e, src) { if (src && !src.className) { @@ -15,6 +15,14 @@ old_scheduler_dblclick.apply(this, arguments); } }; + + // It uses the date+time format, leading to month range being between + // 1/5 08:53 - 1/6 08:52 instead of 1/5 00:00 - 31/5 23:59 + scheduler._click.dhx_cal_today_button = function() { + if (scheduler.callEvent("onBeforeTodayDisplayed", [])) { + scheduler.setCurrentView( scheduler.date.date_part(new Date()) ); + } + }; } }()); @@ -265,6 +273,13 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ //To parse Events we have to convert date Format var res_events = [], sidebar_items = {}; + var selection_label; + if(this.fields[this.color_field].selection) { + selection_label = {}; + _(this.fields[this.color_field].selection).each(function(value){ + selection_label[value[0]] = value[1]; + }); + } for (var e = 0; e < events.length; e++) { var evt = events[e]; if (!evt[this.date_start]) { @@ -274,13 +289,19 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ if (this.color_field) { var filter = evt[this.color_field]; if (filter) { - var filter_value = (typeof filter === 'object') ? filter[0] : filter; + if (typeof filter !== 'object') { + filter = [filter, filter]; + } + if (selection_label) { + filter[1] = selection_label[filter[0]]; + } + var filter_value = filter[0]; if (typeof(fn_filter) === 'function' && !fn_filter(filter_value)) { continue; } var filter_item = { value: filter_value, - label: (typeof filter === 'object') ? filter[1] : filter, + label: filter[1], color: this.get_color(filter_value) }; if (!sidebar_items[filter_value]) { @@ -339,9 +360,13 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ }, get_event_data: function(event_obj) { var data = { - name: event_obj.text + name: event_obj.text || scheduler.locale.labels.new_event }; - data[this.date_start] = instance.web.datetime_to_str(event_obj.start_date); + if (this.fields[this.date_start].type == 'date') { + data[this.date_start] = instance.web.date_to_str(event_obj.start_date) + }else { + data[this.date_start] = instance.web.datetime_to_str(event_obj.start_date) + } if (this.date_stop) { data[this.date_stop] = instance.web.datetime_to_str(event_obj.end_date); } @@ -498,7 +523,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ var self = this; var index = this.dataset.get_id_index(event_id); if (index !== null) { - this.dataset.unlink(event_id); + this.dataset.unlink(this.dataset.ids[index]); } }, }); diff --git a/addons/web_gantt/__init__.py b/addons/web_gantt/__init__.py index 013e4b7ec4e..e69de29bb2d 100644 --- a/addons/web_gantt/__init__.py +++ b/addons/web_gantt/__init__.py @@ -1 +0,0 @@ -#!/usr/bin/python diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png index 9d495780d13..82ef54a0696 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png index 68376a9c70d..035a1f4ca12 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png index 02f41eaf5d8..b98d24f25b6 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png index aa35f7dcf5f..6aa73a252d1 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png index 556058d6b22..60093e8b87f 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png index 1d08f670c44..bfa2300b0ed 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png index 69205da45a8..be13bb1e1a5 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png index 8be117b1ad2..f8b20038b40 100644 Binary files a/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png and b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png differ diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/index.html b/addons/web_gantt/static/lib/dhtmlxGantt/index.html index 5196d426ca6..d35c33ca747 100644 --- a/addons/web_gantt/static/lib/dhtmlxGantt/index.html +++ b/addons/web_gantt/static/lib/dhtmlxGantt/index.html @@ -1,107 +1,107 @@ - - - Gantt Chart - - - - - - - - - - - -
    DHTML Gantt sample
    - -

    Initialize object on page

    -

    You can place this JavaScript Gantt Chart anywhere on your web page, attaching it - to any div object.
    -

    - - - -<div style="width:950px;height:620px;position:absolute" id="GanttDiv"></div> -<script> - var gantt = new GanttChart(); - gantt.setImagePath("codebase/imgs/"); - gantt.setEditable(true); - ... - gantt.addProject(project_1); - ... - gantt.create("GanttDiv"); -</script> - - -
    -
    - - - - + + + Gantt Chart + + + + + + + + + + + +
    DHTML Gantt sample
    + +

    Initialize object on page

    +

    You can place this JavaScript Gantt Chart anywhere on your web page, attaching it + to any div object.
    +

    + + + +<div style="width:950px;height:620px;position:absolute" id="GanttDiv"></div> +<script> + var gantt = new GanttChart(); + gantt.setImagePath("codebase/imgs/"); + gantt.setEditable(true); + ... + gantt.addProject(project_1); + ... + gantt.create("GanttDiv"); +</script> + + +
    +
    + + + + diff --git a/addons/web_graph/static/lib/flotr2/lib/canvastext.js b/addons/web_graph/static/lib/flotr2/lib/canvastext.js index 3266729f6a6..2df45bae0d8 100644 --- a/addons/web_graph/static/lib/flotr2/lib/canvastext.js +++ b/addons/web_graph/static/lib/flotr2/lib/canvastext.js @@ -1,7 +1,7 @@ /** * This code is released to the public domain by Jim Studt, 2007. * He may keep some sort of up to date copy at http://www.federated.com/~jim/canvastext/ - * It as been modified by Fabien Ménager to handle font style like size, weight, color and rotation. + * It as been modified by Fabien Ménager to handle font style like size, weight, color and rotation. * A partial support for special characters has been added too. */ var CanvasText = { @@ -108,71 +108,71 @@ var CanvasText = { '~': { width: 24, points: [[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],null,[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]] }, // Lower case Latin-1 - 'à': { diacritic: '`', letter: 'a' }, - 'á': { diacritic: '´', letter: 'a' }, - 'â': { diacritic: '^', letter: 'a' }, - 'ä': { diacritic: '¨', letter: 'a' }, - 'ã': { diacritic: '~', letter: 'a' }, + 'à': { diacritic: '`', letter: 'a' }, + 'á': { diacritic: '´', letter: 'a' }, + 'â': { diacritic: '^', letter: 'a' }, + 'ä': { diacritic: '¨', letter: 'a' }, + 'ã': { diacritic: '~', letter: 'a' }, - 'è': { diacritic: '`', letter: 'e' }, - 'é': { diacritic: '´', letter: 'e' }, - 'ê': { diacritic: '^', letter: 'e' }, - 'ë': { diacritic: '¨', letter: 'e' }, + 'è': { diacritic: '`', letter: 'e' }, + 'é': { diacritic: '´', letter: 'e' }, + 'ê': { diacritic: '^', letter: 'e' }, + 'ë': { diacritic: '¨', letter: 'e' }, - 'ì': { diacritic: '`', letter: 'i' }, - 'í': { diacritic: '´', letter: 'i' }, - 'î': { diacritic: '^', letter: 'i' }, - 'ï': { diacritic: '¨', letter: 'i' }, + 'ì': { diacritic: '`', letter: 'i' }, + 'í': { diacritic: '´', letter: 'i' }, + 'î': { diacritic: '^', letter: 'i' }, + 'ï': { diacritic: '¨', letter: 'i' }, - 'ò': { diacritic: '`', letter: 'o' }, - 'ó': { diacritic: '´', letter: 'o' }, - 'ô': { diacritic: '^', letter: 'o' }, - 'ö': { diacritic: '¨', letter: 'o' }, - 'õ': { diacritic: '~', letter: 'o' }, + 'ò': { diacritic: '`', letter: 'o' }, + 'ó': { diacritic: '´', letter: 'o' }, + 'ô': { diacritic: '^', letter: 'o' }, + 'ö': { diacritic: '¨', letter: 'o' }, + 'õ': { diacritic: '~', letter: 'o' }, - 'ù': { diacritic: '`', letter: 'u' }, - 'ú': { diacritic: '´', letter: 'u' }, - 'û': { diacritic: '^', letter: 'u' }, - 'ü': { diacritic: '¨', letter: 'u' }, + 'ù': { diacritic: '`', letter: 'u' }, + 'ú': { diacritic: '´', letter: 'u' }, + 'û': { diacritic: '^', letter: 'u' }, + 'ü': { diacritic: '¨', letter: 'u' }, - 'ý': { diacritic: '´', letter: 'y' }, - 'ÿ': { diacritic: '¨', letter: 'y' }, + 'ý': { diacritic: '´', letter: 'y' }, + 'ÿ': { diacritic: '¨', letter: 'y' }, - 'ç': { diacritic: '¸', letter: 'c' }, - 'ñ': { diacritic: '~', letter: 'n' }, + 'ç': { diacritic: '¸', letter: 'c' }, + 'ñ': { diacritic: '~', letter: 'n' }, // Upper case Latin-1 - 'À': { diacritic: '`', letter: 'A' }, - 'Á': { diacritic: '´', letter: 'A' }, - 'Â': { diacritic: '^', letter: 'A' }, - 'Ä': { diacritic: '¨', letter: 'A' }, - 'Ã': { diacritic: '~', letter: 'A' }, + 'À': { diacritic: '`', letter: 'A' }, + 'Ã�': { diacritic: '´', letter: 'A' }, + 'Â': { diacritic: '^', letter: 'A' }, + 'Ä': { diacritic: '¨', letter: 'A' }, + 'Ã': { diacritic: '~', letter: 'A' }, - 'È': { diacritic: '`', letter: 'E' }, - 'É': { diacritic: '´', letter: 'E' }, - 'Ê': { diacritic: '^', letter: 'E' }, - 'Ë': { diacritic: '¨', letter: 'E' }, + 'È': { diacritic: '`', letter: 'E' }, + 'É': { diacritic: '´', letter: 'E' }, + 'Ê': { diacritic: '^', letter: 'E' }, + 'Ë': { diacritic: '¨', letter: 'E' }, - 'Ì': { diacritic: '`', letter: 'I' }, - 'Í': { diacritic: '´', letter: 'I' }, - 'Î': { diacritic: '^', letter: 'I' }, - 'Ï': { diacritic: '¨', letter: 'I' }, + 'ÃŒ': { diacritic: '`', letter: 'I' }, + 'Ã�': { diacritic: '´', letter: 'I' }, + 'ÃŽ': { diacritic: '^', letter: 'I' }, + 'Ã�': { diacritic: '¨', letter: 'I' }, - 'Ò': { diacritic: '`', letter: 'O' }, - 'Ó': { diacritic: '´', letter: 'O' }, - 'Ô': { diacritic: '^', letter: 'O' }, - 'Ö': { diacritic: '¨', letter: 'O' }, - 'Õ': { diacritic: '~', letter: 'O' }, + 'Ã’': { diacritic: '`', letter: 'O' }, + 'Ó': { diacritic: '´', letter: 'O' }, + 'Ô': { diacritic: '^', letter: 'O' }, + 'Ö': { diacritic: '¨', letter: 'O' }, + 'Õ': { diacritic: '~', letter: 'O' }, - 'Ù': { diacritic: '`', letter: 'U' }, - 'Ú': { diacritic: '´', letter: 'U' }, - 'Û': { diacritic: '^', letter: 'U' }, - 'Ü': { diacritic: '¨', letter: 'U' }, + 'Ù': { diacritic: '`', letter: 'U' }, + 'Ú': { diacritic: '´', letter: 'U' }, + 'Û': { diacritic: '^', letter: 'U' }, + 'Ü': { diacritic: '¨', letter: 'U' }, - 'Ý': { diacritic: '´', letter: 'Y' }, + 'Ã�': { diacritic: '´', letter: 'Y' }, - 'Ç': { diacritic: '¸', letter: 'C' }, - 'Ñ': { diacritic: '~', letter: 'N' } + 'Ç': { diacritic: '¸', letter: 'C' }, + 'Ñ': { diacritic: '~', letter: 'N' } }, specialchars: { @@ -181,11 +181,11 @@ var CanvasText = { /** Diacritics, used to draw accentuated letters */ diacritics: { - '¸': { entity: 'cedil', points: [[6,-4],[4,-6],[2,-7],[1,-7]] }, - '´': { entity: 'acute', points: [[8,19],[13,22]] }, + '¸': { entity: 'cedil', points: [[6,-4],[4,-6],[2,-7],[1,-7]] }, + '´': { entity: 'acute', points: [[8,19],[13,22]] }, '`': { entity: 'grave', points: [[7,22],[12,19]] }, '^': { entity: 'circ', points: [[5.5,19],[9.5,23],[12.5,19]] }, - '¨': { entity: 'trema', points: [[5,21],[6,20],[7,21],[6,22],[5,21],null,[12,21],[13,20],[14,21],[13,22],[12,21]] }, + '¨': { entity: 'trema', points: [[5,21],[6,20],[7,21],[6,22],[5,21],null,[12,21],[13,20],[14,21],[13,22],[12,21]] }, '~': { entity: 'tilde', points: [[4,18],[7,22],[10,18],[13,22]] } }, diff --git a/addons/web_graph/static/lib/flotr2/lib/jasmine/jasmine_favicon.png b/addons/web_graph/static/lib/flotr2/lib/jasmine/jasmine_favicon.png index 218f3b43713..bd147955254 100644 Binary files a/addons/web_graph/static/lib/flotr2/lib/jasmine/jasmine_favicon.png and b/addons/web_graph/static/lib/flotr2/lib/jasmine/jasmine_favicon.png differ diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 8710b840209..a84bb53fc85 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -5,6 +5,7 @@ openerp.web_graph = function (instance) { var _lt = instance.web._lt; +var _t = instance.web._t; // removed ``undefined`` values var filter_values = function (o) { @@ -343,7 +344,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ var defs = []; _.each(axis, function(x) { var key = x[xaxis[0]] - defs.push(obj.call("read_group", [domain, yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).then(function(res) { + defs.push(obj.call("read_group", [x['__domain'], yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).then(function(res) { return [x, key, res]; })); }); @@ -365,7 +366,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ }).then(function() { var res = { 'data': result, - 'ticks': _.map(ticks, function(el, key) { return [el, key] }) + 'ticks': _.map(ticks, function(el, key) { return [el, key || _t("Undefined")] }) }; return res; })); diff --git a/addons/web_hello/__init__.py b/addons/web_hello/__init__.py index 013e4b7ec4e..e69de29bb2d 100644 --- a/addons/web_hello/__init__.py +++ b/addons/web_hello/__init__.py @@ -1 +0,0 @@ -#!/usr/bin/python diff --git a/addons/web_kanban/static/src/img/minus-icon.png b/addons/web_kanban/static/src/img/minus-icon.png index cb655d1e503..9453bc80e5b 100644 Binary files a/addons/web_kanban/static/src/img/minus-icon.png and b/addons/web_kanban/static/src/img/minus-icon.png differ diff --git a/addons/web_kanban/static/src/img/plus-icon.png b/addons/web_kanban/static/src/img/plus-icon.png index 7bb9b1be856..c0fc0946cc9 100644 Binary files a/addons/web_kanban/static/src/img/plus-icon.png and b/addons/web_kanban/static/src/img/plus-icon.png differ diff --git a/openerp-long-polling b/openerp-long-polling new file mode 100755 index 00000000000..304cd01c1ee --- /dev/null +++ b/openerp-long-polling @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import gevent.monkey +gevent.monkey.patch_all() +import gevent_psycopg2 +gevent_psycopg2.monkey_patch() + +import openerp + +if __name__ == "__main__": + openerp.cli.main() diff --git a/openerp/__init__.py b/openerp/__init__.py index 285c6af85d9..22c8c98256a 100644 --- a/openerp/__init__.py +++ b/openerp/__init__.py @@ -23,6 +23,14 @@ """ +import sys + +# Is the server running with gevent. +evented = False +if sys.modules.get("gevent") is not None: + evented = True + + # Make sure the OpenERP server runs in UTC. This is especially necessary # under Windows as under Linux it seems the real import of time is # sufficiently deferred so that setting the TZ environment variable @@ -61,8 +69,6 @@ wsgi.register_wsgi_handler = wsgi.wsgi_server.register_wsgi_handler # its own copy of the data structure and we don't need to care about # locks between threads. multi_process = False -# Is the server running with gevent. -evented = False def registry(database_name): """ diff --git a/openerp/addons/base/base_data.xml b/openerp/addons/base/base_data.xml index 2922dd82dc4..6a47325db39 100644 --- a/openerp/addons/base/base_data.xml +++ b/openerp/addons/base/base_data.xml @@ -49,8 +49,6 @@ € 0.01 4 - - 1.0 @@ -86,10 +84,6 @@ Administrator - - - - localhost localhost diff --git a/openerp/addons/base/currency_data.xml b/openerp/addons/base/currency_data.xml index 96ff81cc0d1..e38f777d584 100644 --- a/openerp/addons/base/currency_data.xml +++ b/openerp/addons/base/currency_data.xml @@ -466,7 +466,6 @@ 0.01 4 ¢ - 691.3153 diff --git a/openerp/addons/base/res/res_bank_view.xml b/openerp/addons/base/res/res_bank_view.xml index 1c289d07141..7c1e07e37fb 100644 --- a/openerp/addons/base/res/res_bank_view.xml +++ b/openerp/addons/base/res/res_bank_view.xml @@ -53,7 +53,13 @@ res.bank form tree,form - Manage bank records you want to be used in the system. + +

    + Click to create a new bank. +

    + Manage bank records you want to be used in the system. +

    +
    @@ -152,7 +158,17 @@ res.partner.bank form tree,form - Configure your company's bank accounts and select those that must appear on the report footer. You can reorder bank accounts from the list view. If you use the accounting application of OpenERP, journals and accounts will be created automatically based on these data. + +

    + Click to create a bank account. +

    + Configure your company's bank accounts and select those that must appear on the report footer. + You can reorder bank accounts from the list view. +

    +

    + If you use the accounting application of OpenERP, journals and accounts will be created automatically based on these data. +

    +
    - + @@ -318,7 +318,7 @@ class res_company(osv.osv): - + diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 89b9448290e..566ee6066dd 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -608,9 +608,8 @@ class res_partner(osv.osv, format_address): query_args['limit'] = limit cr.execute('''SELECT partner.id FROM res_partner partner LEFT JOIN res_partner company ON partner.parent_id = company.id - WHERE partner.email ''' + operator +''' %(name)s - OR partner.name || ' (' || COALESCE(company.name,'') || ')' - ''' + operator + ' %(name)s ' + limit_str, query_args) + WHERE partner.email ''' + operator +''' %(name)s OR + partner.display_name ''' + operator + ' %(name)s ' + limit_str, query_args) ids = map(lambda x: x[0], cr.fetchall()) ids = self.search(cr, uid, [('id', 'in', ids)] + args, limit=limit, context=context) if ids: diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index ccf74206967..2e7b6f0c14d 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -580,7 +580,14 @@ ir.actions.act_window res.partner.category form - Manage the partner tags to better classify them for tracking and analysis purposes. A partner may have several tags and tags have a hierarchical structure: a partner with a tag has also the parent tags. + +

    + Click to create a new partner tags. +

    + Manage the partner tags to better classify them for tracking and analysis purposes. + A partner may have several tags and tags have a hierarchical structure: a partner with a tag has also the parent tags. +

    +
    diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py index 72d9269487b..93d6d307484 100644 --- a/openerp/addons/base/res/res_users.py +++ b/openerp/addons/base/res/res_users.py @@ -845,6 +845,7 @@ class users_view(osv.osv): 'string': app and app.name or _('Other'), 'selection': [(False, '')] + [(g.id, g.name) for g in gs], 'help': '\n'.join(tips), + 'exportable': False, } else: # boolean group fields @@ -853,6 +854,7 @@ class users_view(osv.osv): 'type': 'boolean', 'string': g.name, 'help': g.comment, + 'exportable': False, } return res diff --git a/openerp/addons/base/test/test_osv_expression.yml b/openerp/addons/base/test/test_osv_expression.yml index 1516f090e94..111ce40f2ce 100644 --- a/openerp/addons/base/test/test_osv_expression.yml +++ b/openerp/addons/base/test/test_osv_expression.yml @@ -375,6 +375,11 @@ currency_ids3 = self.pool.get('res.currency').search(cr, uid, [('id', 'not in', [])]) assert currency_ids1 == currency_ids2 == currency_ids3, 'All 3 results should have be the same: all currencies' default_company = self.browse(cr, uid, 1) + + # Due to currency data definition change (in relation with bug 1111298), this test now needs + # a manual setup where all currencies are assigned to the default company. + self.pool['res.currency'].write(cr, uid, currency_ids1, {'company_id': default_company.id}) + # one2many towards same model res_1 = self.search(cr, uid, [('child_ids', 'in', [x.id for x in company.child_ids])]) # any company having a child of company3 as child res_2 = self.search(cr, uid, [('child_ids', 'in', [company.child_ids[0].id])]) # any company having the first child of company3 as child diff --git a/openerp/cli/server.py b/openerp/cli/server.py index 2ee9e53b3ca..fc1bf61b617 100644 --- a/openerp/cli/server.py +++ b/openerp/cli/server.py @@ -221,6 +221,18 @@ def quit_on_signals(): os.unlink(config['pidfile']) sys.exit(0) +def watch_parent(beat=4): + import gevent + ppid = os.getppid() + while True: + if ppid != os.getppid(): + pid = os.getpid() + _logger.info("LongPolling (%s) Parent changed", pid) + # suicide !! + os.kill(pid, signal.SIGTERM) + return + gevent.sleep(beat) + def main(args): check_root_user() openerp.tools.config.parse_config(args) @@ -257,9 +269,15 @@ def main(args): setup_pid_file() # Some module register themselves when they are loaded so we need the # services to be running before loading any registry. - if config['workers']: - openerp.service.start_services_workers() + if not openerp.evented: + if config['workers']: + openerp.service.start_services_workers() + else: + openerp.service.start_services() else: + config['xmlrpc_port'] = config['longpolling_port'] + import gevent + gevent.spawn(watch_parent) openerp.service.start_services() rc = 0 diff --git a/openerp/report/render/rml2pdf/trml2pdf.py b/openerp/report/render/rml2pdf/trml2pdf.py index 243cc02a0b3..2052b128ad9 100644 --- a/openerp/report/render/rml2pdf/trml2pdf.py +++ b/openerp/report/render/rml2pdf/trml2pdf.py @@ -160,7 +160,7 @@ class _rml_styles(object,): for style in node.findall('paraStyle'): sname = style.get('name') self.styles[sname] = self._para_style_update(style) - if sname in self.default_style: + if self.default_style.has_key(sname): for key, value in self.styles[sname].items(): setattr(self.default_style[sname], key, value) else: @@ -277,11 +277,24 @@ class _rml_doc(object): fname = font.get('fontFile').encode('ascii') if name not in pdfmetrics._fonts: pdfmetrics.registerFont(TTFont(name, fname)) + #by default, we map the fontName to each style (bold, italic, bold and italic), so that + #if there isn't any font defined for one of these style (via a font family), the system + #will fallback on the normal font. addMapping(name, 0, 0, name) #normal addMapping(name, 0, 1, name) #italic addMapping(name, 1, 0, name) #bold addMapping(name, 1, 1, name) #italic and bold + #if registerFontFamily is defined, we register the mapping of the fontName to use for each style. + for font_family in node.findall('registerFontFamily'): + family_name = font_family.get('normal').encode('ascii') + if font_family.get('italic'): + addMapping(family_name, 0, 1, font_family.get('italic').encode('ascii')) + if font_family.get('bold'): + addMapping(family_name, 1, 0, font_family.get('bold').encode('ascii')) + if font_family.get('boldItalic'): + addMapping(family_name, 1, 1, font_family.get('boldItalic').encode('ascii')) + def setTTFontMapping(self,face, fontname, filename, mode='all'): from reportlab.lib.fonts import addMapping from reportlab.pdfbase import pdfmetrics diff --git a/openerp/service/__init__.py b/openerp/service/__init__.py index d66904615ba..2c6c80eb80c 100644 --- a/openerp/service/__init__.py +++ b/openerp/service/__init__.py @@ -3,7 +3,7 @@ # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). -# Copyright (C) 2010-2012 OpenERP SA () +# Copyright (C) 2010-2013 OpenERP SA () # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -37,6 +37,7 @@ import openerp.netsvc import openerp.osv from openerp.release import nt_service_name import openerp.tools +from openerp.tools.misc import stripped_sys_argv import common import db @@ -128,9 +129,7 @@ def _reexec(): if openerp.tools.osutil.is_running_as_nt_service(): subprocess.call('net stop {0} && net start {0}'.format(nt_service_name), shell=True) exe = os.path.basename(sys.executable) - strip_args = ['-d', '-u'] - a = sys.argv[:] - args = [x for i, x in enumerate(a) if x not in strip_args and a[max(i - 1, 0)] not in strip_args] + args = stripped_sys_argv() if not args or args[0] != exe: args.insert(0, exe) os.execv(sys.executable, args) diff --git a/openerp/service/workers.py b/openerp/service/workers.py index 9a6485b8fd3..1075342919d 100644 --- a/openerp/service/workers.py +++ b/openerp/service/workers.py @@ -14,6 +14,8 @@ import signal import socket import sys import time +import subprocess +import os.path import werkzeug.serving try: @@ -23,6 +25,7 @@ except ImportError: import openerp import openerp.tools.config as config +from openerp.tools.misc import stripped_sys_argv _logger = logging.getLogger(__name__) @@ -35,7 +38,6 @@ class Multicorn(object): def __init__(self, app): # config self.address = (config['xmlrpc_interface'] or '0.0.0.0', config['xmlrpc_port']) - self.long_polling_address = (config['xmlrpc_interface'] or '0.0.0.0', config['longpolling_port']) self.population = config['workers'] self.timeout = config['limit_time_real'] self.limit_request = config['limit_request'] @@ -46,10 +48,10 @@ class Multicorn(object): self.socket = None self.workers_http = {} self.workers_cron = {} - self.workers_longpolling = {} self.workers = {} self.generation = 0 self.queue = [] + self.long_polling_pid = None def pipe_new(self): pipe = os.pipe() @@ -89,6 +91,14 @@ class Multicorn(object): worker.run() sys.exit(0) + def long_polling_spawn(self): + nargs = stripped_sys_argv('--pidfile') + cmd = nargs[0] + cmd = os.path.join(os.path.dirname(cmd), "openerp-long-polling") + nargs[0] = cmd + popen = subprocess.Popen(nargs) + self.long_polling_pid = popen.pid + def worker_pop(self, pid): if pid in self.workers: _logger.debug("Worker (%s) unregistered",pid) @@ -143,8 +153,8 @@ class Multicorn(object): self.worker_spawn(WorkerHTTP, self.workers_http) while len(self.workers_cron) < config['max_cron_threads']: self.worker_spawn(WorkerCron, self.workers_cron) - while len(self.workers_longpolling) < 1: - self.worker_spawn(WorkerLongPolling, self.workers_longpolling) + if not self.long_polling_pid: + self.long_polling_spawn() def sleep(self): try: @@ -183,14 +193,11 @@ class Multicorn(object): self.socket.setblocking(0) self.socket.bind(self.address) self.socket.listen(8*self.population) - # long polling socket - self.long_polling_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.long_polling_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - self.long_polling_socket.setblocking(0) - self.long_polling_socket.bind(self.long_polling_address) - self.long_polling_socket.listen(8) def stop(self, graceful=True): + if self.long_polling_pid is not None: + self.worker_kill(self.long_polling_pid, signal.SIGTERM) + self.long_polling_pid = None if graceful: _logger.info("Stopping gracefully") limit = time.time() + self.timeout @@ -353,49 +360,8 @@ class WorkerHTTP(Worker): def start(self): Worker.start(self) - self.multi.long_polling_socket.close() self.server = WorkerBaseWSGIServer(self.multi.app) -class WorkerLongPolling(Worker): - """ Long polling workers """ - def __init__(self, multi): - super(WorkerLongPolling, self).__init__(multi) - # Disable the watchdog feature for this kind of worker. - self.watchdog_timeout = None - - def watch_parent(self): - import gevent - while True: - if self.ppid != os.getppid(): - _logger.info("WorkerLongPolling (%s) Parent changed", self.pid) - os.kill(os.getpid(), signal.SIGTERM) - return - gevent.sleep(self.multi.beat) - - def start(self): - openerp.evented = True - _logger.info('Using gevent mode') - import gevent.monkey - gevent.monkey.patch_all() - import gevent_psycopg2 - gevent_psycopg2.monkey_patch() - from openerp.modules.registry import RegistryManager - from gevent.coros import RLock - RegistryManager.registries_lock = RLock() - - Worker.start(self) - self.multi.socket.close() - - import gevent - watcher = gevent.spawn(self.watch_parent) - - log = _logger.getChild(self.__class__.__name__) - log.write = lambda msg: log.info(msg.strip()) - - from gevent.wsgi import WSGIServer - self.server = WSGIServer(self.multi.long_polling_socket, self.multi.app, log=log) - self.server.serve_forever() - class WorkerBaseWSGIServer(werkzeug.serving.BaseWSGIServer): """ werkzeug WSGI Server patched to allow using an external listen socket """ @@ -469,7 +435,6 @@ class WorkerCron(Worker): def start(self): Worker.start(self) self.multi.socket.close() - self.multi.long_polling_socket.close() openerp.service.start_internal() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/service/wsgi_server.py b/openerp/service/wsgi_server.py index df201825d31..acbfc67dd0b 100644 --- a/openerp/service/wsgi_server.py +++ b/openerp/service/wsgi_server.py @@ -449,7 +449,10 @@ def start_service(): interface = config['xmlrpc_interface'] or '0.0.0.0' port = config['xmlrpc_port'] _logger.info('HTTP service (werkzeug) running on %s:%s', interface, port) - threading.Thread(target=serve, args=(interface, port, True)).start() + if not openerp.evented: + threading.Thread(target=serve, args=(interface, port, True)).start() + else: + serve(interface, port, True) def stop_service(): """ Initiate the shutdown of the WSGI server. diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index 1b476fb9b2a..7a54d6b9b6e 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -3,7 +3,7 @@ # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). -# Copyright (C) 2010-2012 OpenERP s.a. (). +# Copyright (C) 2010-2013 OpenERP s.a. (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ import time import zipfile from collections import defaultdict from datetime import datetime -from itertools import islice, izip +from itertools import islice, izip, groupby from lxml import etree from which import which from threading import local @@ -1059,4 +1059,22 @@ class CountingStream(object): raise StopIteration() return val +def stripped_sys_argv(*strip_args): + """Return sys.argv with some arguments stripped, suitable for reexecution or subprocesses""" + strip_args = sorted(set(strip_args) | set(['-s', '--save', '-d', '--database', '-u', '--update', '-i', '--init'])) + assert all(config.parser.has_option(s) for s in strip_args) + takes_value = dict((s, config.parser.get_option(s).takes_value()) for s in strip_args) + + longs, shorts = list(tuple(y) for _, y in groupby(strip_args, lambda x: x.startswith('--'))) + longs_eq = tuple(l + '=' for l in longs if takes_value[l]) + + args = sys.argv[:] + + def strip(args, i): + return args[i].startswith(shorts) \ + or args[i].startswith(longs_eq) or (args[i] in longs) \ + or (i >= 1 and (args[i - 1] in strip_args) and takes_value[args[i - 1]]) + + return [x for i, x in enumerate(args) if not strip(args, i)] + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: