Merge trunk
bzr revid: nicolas.vanhoren@openerp.com-20130801125845-2aoeb7l6bicdmk59
This commit is contained in:
@@ -8,11 +8,31 @@ module.exports = function(grunt) {
|
||||
evil: true, //eval
|
||||
laxbreak: true, //unsafe line breaks
|
||||
},
|
||||
},
|
||||
sass: {
|
||||
dev: {
|
||||
options: {
|
||||
style: "expanded",
|
||||
},
|
||||
files: {
|
||||
"static/src/css/base.css": "static/src/css/base.sass",
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
sass: {
|
||||
files: ["static/src/css/base.sass"],
|
||||
tasks: ['sass']
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-sass');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
|
||||
grunt.registerTask('gen', ["sass"]);
|
||||
grunt.registerTask('watcher', ["gen", "watch"]);
|
||||
grunt.registerTask('test', []);
|
||||
|
||||
grunt.registerTask('default', ['jshint']);
|
||||
|
||||
+20
-12
@@ -124,17 +124,7 @@ class WebRequest(object):
|
||||
except SessionExpiredException, e:
|
||||
self.session.logout()
|
||||
raise SessionExpiredException("Session expired for request %s" % self.httprequest)
|
||||
if self.auth_method == "none":
|
||||
self.disable_db = True
|
||||
self.uid = None
|
||||
elif self.auth_method == "admin":
|
||||
self.disable_db = False
|
||||
if not self.db:
|
||||
raise SessionExpiredException("No valid database for request %s" % self.httprequest)
|
||||
self.uid = openerp.SUPERUSER_ID
|
||||
else: # auth
|
||||
self.disable_db = False
|
||||
self.uid = self.session.uid
|
||||
auth_methods[self.auth_method]()
|
||||
@property
|
||||
def registry(self):
|
||||
"""
|
||||
@@ -187,6 +177,24 @@ class WebRequest(object):
|
||||
self.disable_db = True
|
||||
self.uid = None
|
||||
|
||||
def auth_method_user():
|
||||
request.uid = request.session.uid
|
||||
|
||||
def auth_method_admin():
|
||||
if not request.db:
|
||||
raise SessionExpiredException("No valid database for request %s" % request.httprequest)
|
||||
request.uid = openerp.SUPERUSER_ID
|
||||
|
||||
def auth_method_none():
|
||||
request.disable_db = True
|
||||
request.uid = None
|
||||
|
||||
auth_methods = {
|
||||
"user": auth_method_user,
|
||||
"admin": auth_method_admin,
|
||||
"none": auth_method_none,
|
||||
}
|
||||
|
||||
def route(route, type="http", auth="user"):
|
||||
"""
|
||||
Decorator marking the decorated method as being a handler for requests. The method must be part of a subclass
|
||||
@@ -206,7 +214,7 @@ def route(route, type="http", auth="user"):
|
||||
configuration indicating the current database nor the current user.
|
||||
"""
|
||||
assert type in ["http", "json"]
|
||||
assert auth in ["user", "admin", "none"]
|
||||
assert auth in auth_methods.keys()
|
||||
def decorator(f):
|
||||
if isinstance(route, list):
|
||||
f.routes = route
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"grunt": "*",
|
||||
"grunt-contrib-jshint": "*"
|
||||
"grunt-contrib-jshint": "*",
|
||||
"grunt-contrib-sass": "~0.4.1",
|
||||
"grunt-contrib-watch": "~0.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* QUnit v1.9.0 - A JavaScript Unit Testing Framework
|
||||
* QUnit v1.12.0 - A JavaScript Unit Testing Framework
|
||||
*
|
||||
* http://docs.jquery.com/QUnit
|
||||
* http://qunitjs.com
|
||||
*
|
||||
* Copyright (c) 2012 John Resig, Jörn Zaefferer
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* or GPL (GPL-LICENSE.txt) licenses.
|
||||
* Copyright 2012 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
/** Font Family and Sizes */
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
/** Resets */
|
||||
|
||||
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
|
||||
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -67,6 +67,7 @@
|
||||
padding: 0.5em 0 0.5em 2em;
|
||||
color: #5E740B;
|
||||
background-color: #eee;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#qunit-userAgent {
|
||||
@@ -76,6 +77,9 @@
|
||||
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
|
||||
}
|
||||
|
||||
#qunit-modulefilter-container {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/** Tests: Pass/Fail */
|
||||
|
||||
@@ -107,7 +111,12 @@
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#qunit-tests ol {
|
||||
#qunit-tests li .runtime {
|
||||
float: right;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.qunit-assert-list {
|
||||
margin-top: 0.5em;
|
||||
padding: 0.5em;
|
||||
|
||||
@@ -118,6 +127,10 @@
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
.qunit-collapsed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#qunit-tests table {
|
||||
border-collapse: collapse;
|
||||
margin-top: .2em;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -198,8 +198,7 @@ openerp.testing = {};
|
||||
0, module_index + 1 || undefined);
|
||||
|
||||
// Serialize options for this precise test case
|
||||
// WARNING: typo is from jquery, do not fix!
|
||||
var env = QUnit.config.currentModuleTestEnviroment;
|
||||
var env = QUnit.config.currentModuleTestEnvironment;
|
||||
// section setup
|
||||
// case setup
|
||||
// test
|
||||
|
||||
@@ -113,7 +113,6 @@ openerp.testing.section('misordered resolution managemeng', {
|
||||
|
||||
var done = $.Deferred();
|
||||
setTimeout(function () {
|
||||
start();
|
||||
// d1 is failed
|
||||
ok(!done1);
|
||||
ok(fail1);
|
||||
|
||||
@@ -1132,8 +1132,8 @@ openerp.testing.section('search.groupby', {
|
||||
return f instanceof instance.web.search.GroupbyGroup;
|
||||
});
|
||||
ok(group, "should have a GroupbyGroup input");
|
||||
strictEqual(group.getParent(), view,
|
||||
"group's parent should be view");
|
||||
ok(group.getParent() === view,
|
||||
"group's parent should be view");
|
||||
|
||||
group.toggle(group.filters[0]);
|
||||
group.toggle(group.filters[2]);
|
||||
|
||||
Reference in New Issue
Block a user