[FIX] Move bootstrap.css outside from the single css file generate.
authorKersten Jeremy <jke@openerp.com>
Fri, 7 Mar 2014 17:44:11 +0000 (18:44 +0100)
committerKersten Jeremy <jke@openerp.com>
Fri, 7 Mar 2014 17:44:11 +0000 (18:44 +0100)
Without that, OpenERP become unusable in IE due to the follows limitations:
   - All style tags after the first 31 style tags are not applied.
   - All style rules after the first 4,095 rules are not applied.
   - On pages that uses the @import rule to continously import external style sheets that import other style sheets, style sheets that are more than three levels deep are ignored.
  (http://support.microsoft.com/kb/262161/en)

bzr revid: jke@openerp.com-20140307174411-hejt3x324nlv6tjr

addons/web/controllers/main.py

index b84efc7..f57ed91 100644 (file)
@@ -356,7 +356,13 @@ def manifest_glob(extension, addons=None, db=None, include_remotes=False):
                     r.append((None, pattern))
             else:
                 for path in glob.glob(os.path.normpath(os.path.join(addons_path, addon, pattern))):
-                    r.append((path, fs2web(path[len(addons_path):])))
+                    # Hack for IE, who limit 288Ko, 4095 rules, 31 sheets
+                    # http://support.microsoft.com/kb/262161/en
+                    if pattern == "static/lib/bootstrap/css/bootstrap.css":
+                        if include_remotes:
+                            r.insert(0, (None, fs2web(path[len(addons_path):])))
+                    else:
+                        r.append((path, fs2web(path[len(addons_path):])))
     return r
 
 def manifest_list(extension, mods=None, db=None, debug=False):