[MERGE] Merged with trunk web.

bzr revid: tde@openerp.com-20120627115748-3ckox2kez2uhfb7k
This commit is contained in:
Thibault Delavallée 2012-06-27 13:57:48 +02:00
commit 48b08907c0
15 changed files with 440 additions and 9364 deletions

View File

@ -15,7 +15,7 @@
"static/lib/datejs/parser.js",
"static/lib/datejs/sugarpak.js",
"static/lib/datejs/extras.js",
"static/lib/jquery/jquery-1.7.2b1.js",
"static/lib/jquery/jquery-1.7.2.js",
"static/lib/jquery.MD5/jquery.md5.js",
"static/lib/jquery.form/jquery.form.js",
"static/lib/jquery.validate/jquery.validate.js",
@ -56,6 +56,7 @@
"static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css",
"static/lib/jquery.ui.notify/css/ui.notify.css",
"static/lib/jquery.tipsy/tipsy.css",
"static/lib/jquery.textext/jquery.textext.css",
"static/src/css/base.css",
"static/src/css/data_export.css",
"static/src/css/data_import.css",

View File

@ -1286,7 +1286,8 @@ class SearchView(View):
del filter['context']
del filter['domain']
return filters
@openerpweb.jsonrequest
def add_to_dashboard(self, req, menu_id, action_id, context_to_save, domain, view_mode, name=''):
to_eval = common.nonliterals.CompoundContext(context_to_save)

View File

@ -0,0 +1,7 @@
.text-core { position: relative;}.text-core .text-wrap { background: #fff; position: absolute;}.text-core .text-wrap textarea, .text-core .text-wrap input { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; outline: none; resize: none; position: absolute; z-index: 1; background: none; overflow: hidden; margin: 0; padding: 3px 5px 4px 5px; white-space: nowrap; font: 11px "lucida grande", tahoma, verdana, arial, sans-serif; line-height: 13px; height: auto;}
.text-core .text-wrap .text-arrow { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: absolute; top: 0; right: 0; width: 22px; height: 22px; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAOAQMAAADHWqTrAAAAA3NCSVQICAjb4U/gAAAABlBMVEX///8yXJnt8Ns4AAAACXBIWXMAAAsSAAALEgHS3X78AAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1MzmNZGAwAAABpJREFUCJljYEAF/xsY6hkY7BgYZBgYOFBkADkdAmFDagYFAAAAAElFTkSuQmCC") 50% 50% no-repeat; cursor: pointer; z-index: 2;}
.text-core .text-wrap .text-dropdown { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 0; position: absolute; z-index: 3; background: #fff; border: 1px solid #9daccc; width: 100%; max-height: 100px; padding: 1px; font: 11px "lucida grande", tahoma, verdana, arial, sans-serif; display: none; overflow-x: hidden; overflow-y: auto;}.text-core .text-wrap .text-dropdown.text-position-below { margin-top: 1px;}.text-core .text-wrap .text-dropdown.text-position-above { margin-bottom: 1px;}.text-core .text-wrap .text-dropdown .text-list .text-suggestion { padding: 3px 5px; cursor: pointer;}.text-core .text-wrap .text-dropdown .text-list .text-suggestion em { font-style: normal; text-decoration: underline;}.text-core .text-wrap .text-dropdown .text-list .text-suggestion.text-selected { color: #fff; background: #6d84b4;}
.text-core .text-wrap .text-focus { -webkit-box-shadow: 0px 0px 6px #6d84b4; -moz-box-shadow: 0px 0px 6px #6d84b4; box-shadow: 0px 0px 6px #6d84b4; position: absolute; width: 100%; height: 100%; display: none;}.text-core .text-wrap .text-focus.text-show-focus { display: block;}
.text-core .text-wrap .text-prompt { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: absolute; width: 100%; height: 100%; margin: 1px 0 0 2px; font: 11px "lucida grande", tahoma, verdana, arial, sans-serif; color: #c0c0c0; overflow: hidden; white-space: pre;}.text-core .text-wrap .text-prompt.text-hide-prompt { display: none;}
.text-core .text-wrap .text-tags { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: absolute; width: 100%; height: 100%; padding: 3px 35px 3px 3px; cursor: text;}.text-core .text-wrap .text-tags.text-tags-on-top { z-index: 2;}.text-core .text-wrap .text-tags .text-tag { float: left;}.text-core .text-wrap .text-tags .text-tag .text-button { -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; position: relative; float: left; border: 1px solid #9daccc; background: #e2e6f0; color: #000; padding: 0px 17px 0px 3px; margin: 0 2px 2px 0; cursor: pointer; height: 16px; font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;}.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove { position: absolute; right: 3px; top: 2px; display: block; width: 11px; height: 11px; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAhCAYAAAAPm1F2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB50RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNS4xqx9I6wAAAQ5JREFUOI2dlD0WwiAQhCc8L6HHgAPoASwtSYvX8BrQxtIyveYA8RppLO1jE+LwE8lzms2yH8MCj1QoaBzH+VuUYNYMS213UlvDRamtUbXb5ZyPHuDoxwGgip3ipfvGuGzPz+vZ/coDONdzFuYCO6ramQQG0DJIE1oPBBvM6e9LqaS2FwD7FWwnVoIAsOc2Xn1jDlyd8pfPBRVOBHA8cc/3yCmQqt0jcY4LuTyAF3pOYS6wI48LAm4MUrx5JthgSQJAt5LtNgAUgEMBBIC3AL2xgo58dEPfhE9wygef89FtCeC49UwltR1pQrK2qr9vNr7uRTCBF3pOYS6wI4/zdQ8MUpxPI9hgSQL0Xyio/QBt54DzsHQx6gAAAABJRU5ErkJggg==") 0 0 no-repeat;}.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove:hover { background-position: 0 -11px;}.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove:active { background-position: 0 -22px;}

View File

@ -4774,157 +4774,3 @@
return node;
};
})(jQuery);
;
(function(a){var b=document,c="getElementsByTagName",d=b[c]("head")[0]||b[c]("body")[0],e=b.createElement("style");e.innerHTML=a,d.appendChild(e)})('\n.text-core {\
position: relative;\
}\
.text-core .text-wrap {\
background: #fff;\
position: absolute;\
}\
.text-core .text-wrap textarea, .text-core .text-wrap input {\
-webkit-box-sizing: border-box;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
-webkit-border-radius: 3px;\
-moz-border-radius: 3px;\
border-radius: 3px;\
outline: none;\
resize: none;\
position: absolute;\
z-index: 1;\
background: none;\
overflow: hidden;\
margin: 0;\
padding: 3px 5px 4px 5px;\
white-space: nowrap;\
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;\
line-height: 13px;\
height: auto;\
}\
\n.text-core .text-wrap .text-arrow {\
-webkit-box-sizing: border-box;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
position: absolute;\
top: 0;\
right: 0;\
width: 22px;\
height: 22px;\
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAOAQMAAADHWqTrAAAAA3NCSVQICAjb4U/gAAAABlBMVEX///8yXJnt8Ns4AAAACXBIWXMAAAsSAAALEgHS3X78AAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1MzmNZGAwAAABpJREFUCJljYEAF/xsY6hkY7BgYZBgYOFBkADkdAmFDagYFAAAAAElFTkSuQmCC") 50% 50% no-repeat;\
cursor: pointer;\
z-index: 2;\
}\
\n.text-core .text-wrap .text-dropdown {\
-webkit-box-sizing: border-box;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
padding: 0;\
position: absolute;\
z-index: 3;\
background: #fff;\
border: 1px solid #9daccc;\
width: 100%;\
max-height: 100px;\
padding: 1px;\
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;\
display: none;\
overflow-x: hidden;\
overflow-y: auto;\
}\
.text-core .text-wrap .text-dropdown.text-position-below {\
margin-top: 1px;\
}\
.text-core .text-wrap .text-dropdown.text-position-above {\
margin-bottom: 1px;\
}\
.text-core .text-wrap .text-dropdown .text-list .text-suggestion {\
padding: 3px 5px;\
cursor: pointer;\
}\
.text-core .text-wrap .text-dropdown .text-list .text-suggestion em {\
font-style: normal;\
text-decoration: underline;\
}\
.text-core .text-wrap .text-dropdown .text-list .text-suggestion.text-selected {\
color: #fff;\
background: #6d84b4;\
}\
\n.text-core .text-wrap .text-focus {\
-webkit-box-shadow: 0px 0px 6px #6d84b4;\
-moz-box-shadow: 0px 0px 6px #6d84b4;\
box-shadow: 0px 0px 6px #6d84b4;\
position: absolute;\
width: 100%;\
height: 100%;\
display: none;\
}\
.text-core .text-wrap .text-focus.text-show-focus {\
display: block;\
}\
\n.text-core .text-wrap .text-prompt {\
-webkit-box-sizing: border-box;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
position: absolute;\
width: 100%;\
height: 100%;\
margin: 1px 0 0 2px;\
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;\
color: #c0c0c0;\
overflow: hidden;\
white-space: pre;\
}\
.text-core .text-wrap .text-prompt.text-hide-prompt {\
display: none;\
}\
\n.text-core .text-wrap .text-tags {\
-webkit-box-sizing: border-box;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
position: absolute;\
width: 100%;\
height: 100%;\
padding: 3px 35px 3px 3px;\
cursor: text;\
}\
.text-core .text-wrap .text-tags.text-tags-on-top {\
z-index: 2;\
}\
.text-core .text-wrap .text-tags .text-tag {\
float: left;\
}\
.text-core .text-wrap .text-tags .text-tag .text-button {\
-webkit-border-radius: 2px;\
-moz-border-radius: 2px;\
border-radius: 2px;\
-webkit-box-sizing: border-box;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
position: relative;\
float: left;\
border: 1px solid #9daccc;\
background: #e2e6f0;\
color: #000;\
padding: 0px 17px 0px 3px;\
margin: 0 2px 2px 0;\
cursor: pointer;\
height: 16px;\
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;\
}\
.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove {\
position: absolute;\
right: 3px;\
top: 2px;\
display: block;\
width: 11px;\
height: 11px;\
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAhCAYAAAAPm1F2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAB50RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNS4xqx9I6wAAAQ5JREFUOI2dlD0WwiAQhCc8L6HHgAPoASwtSYvX8BrQxtIyveYA8RppLO1jE+LwE8lzms2yH8MCj1QoaBzH+VuUYNYMS213UlvDRamtUbXb5ZyPHuDoxwGgip3ipfvGuGzPz+vZ/coDONdzFuYCO6ramQQG0DJIE1oPBBvM6e9LqaS2FwD7FWwnVoIAsOc2Xn1jDlyd8pfPBRVOBHA8cc/3yCmQqt0jcY4LuTyAF3pOYS6wI48LAm4MUrx5JthgSQJAt5LtNgAUgEMBBIC3AL2xgo58dEPfhE9wygef89FtCeC49UwltR1pQrK2qr9vNr7uRTCBF3pOYS6wI4/zdQ8MUpxPI9hgSQL0Xyio/QBt54DzsHQx6gAAAABJRU5ErkJggg==") 0 0 no-repeat;\
}\
.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove:hover {\
background-position: 0 -11px;\
}\
.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove:active {\
background-position: 0 -22px;\
}\
');

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*!
* jQuery JavaScript Library v1.7.2b1
* jQuery JavaScript Library v1.7.2
* http://jquery.com/
*
* Copyright 2011, John Resig
@ -11,7 +11,7 @@
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Tue Jan 31 20:11:27 2012 -0500
* Date: Wed Mar 21 12:46:34 2012 -0700
*/
(function( window, undefined ) {
@ -210,7 +210,7 @@ jQuery.fn = jQuery.prototype = {
selector: "",
// The current version of jQuery being used
jquery: "1.7.2b1",
jquery: "1.7.2",
// The default length of a jQuery object is 0
length: 0,
@ -578,6 +578,9 @@ jQuery.extend({
// Cross-browser xml parsing
parseXML: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
var xml, tmp;
try {
if ( window.DOMParser ) { // Standard
@ -1362,7 +1365,6 @@ jQuery.support = (function() {
select,
opt,
input,
marginDiv,
fragment,
tds,
events,
@ -1449,6 +1451,9 @@ jQuery.support = (function() {
pixelMargin: true
};
// jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
@ -1483,6 +1488,10 @@ jQuery.support = (function() {
support.radioValue = input.value === "t";
input.setAttribute("checked", "checked");
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "name", "t" );
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.lastChild );
@ -1497,23 +1506,6 @@ jQuery.support = (function() {
fragment.removeChild( input );
fragment.appendChild( div );
div.innerHTML = "";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if ( window.getComputedStyle ) {
marginDiv = document.createElement( "div" );
marginDiv.style.width = "0";
marginDiv.style.marginRight = "0";
div.style.width = "2px";
div.appendChild( marginDiv );
support.reliableMarginRight =
( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
}
// Technique from Juriy Zaytsev
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
@ -1539,12 +1531,13 @@ jQuery.support = (function() {
fragment.removeChild( div );
// Null elements to avoid leaks in IE
fragment = select = opt = marginDiv = div = input = null;
fragment = select = opt = div = input = null;
// Run tests that need a body at doc ready
jQuery(function() {
var container, outer, inner, table, td, offsetSupport,
conMarginTop, ptlm, vb, style, html,
marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
paddingMarginBorderVisibility, paddingMarginBorder,
body = document.getElementsByTagName("body")[0];
if ( !body ) {
@ -1553,15 +1546,16 @@ jQuery.support = (function() {
}
conMarginTop = 1;
ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";
vb = "visibility:hidden;border:0;";
style = "style='" + ptlm + "border:5px solid #000;padding:0;'";
html = "<div " + style + "><div></div></div>" +
"<table " + style + " cellpadding='0' cellspacing='0'>" +
paddingMarginBorder = "padding:0;margin:0;border:";
positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
"<table " + style + "' cellpadding='0' cellspacing='0'>" +
"<tr><td></td></tr></table>";
container = document.createElement("div");
container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
body.insertBefore( container, body.firstChild );
// Construct the test element
@ -1575,8 +1569,7 @@ jQuery.support = (function() {
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
tds = div.getElementsByTagName( "td" );
isSupported = ( tds[ 0 ].offsetHeight === 0 );
@ -1587,28 +1580,44 @@ jQuery.support = (function() {
// (IE <= 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Figure out if the W3C box model works as expected
div.innerHTML = "";
div.style.width = div.style.paddingLeft = "1px";
jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if ( window.getComputedStyle ) {
div.innerHTML = "";
marginDiv = document.createElement( "div" );
marginDiv.style.width = "0";
marginDiv.style.marginRight = "0";
div.style.width = "2px";
div.appendChild( marginDiv );
support.reliableMarginRight =
( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
}
if ( typeof div.style.zoom !== "undefined" ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE < 8 does this)
div.innerHTML = "";
div.style.width = div.style.padding = "1px";
div.style.border = 0;
div.style.overflow = "hidden";
div.style.display = "inline";
div.style.zoom = 1;
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
div.style.display = "";
div.innerHTML = "<div style='width:4px;'></div>";
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
div.style.display = "block";
div.style.overflow = "visible";
div.innerHTML = "<div style='width:5px;'></div>";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
}
div.style.cssText = ptlm + vb;
div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
div.innerHTML = html;
outer = div.firstChild;
@ -1643,7 +1652,7 @@ jQuery.support = (function() {
}
body.removeChild( container );
div = container = null;
marginDiv = div = container = null;
jQuery.extend( support, offsetSupport );
});
@ -1987,7 +1996,7 @@ function dataAttr( elem, key, data ) {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
jQuery.isNumeric( data ) ? parseFloat( data ) :
jQuery.isNumeric( data ) ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
@ -2196,7 +2205,7 @@ jQuery.fn.extend({
}
}
resolve();
return defer.promise();
return defer.promise( object );
}
});
@ -2365,7 +2374,7 @@ jQuery.fn.extend({
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
@ -2409,7 +2418,7 @@ jQuery.fn.extend({
});
}
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
@ -2555,7 +2564,7 @@ jQuery.extend({
},
removeAttr: function( elem, value ) {
var propName, attrNames, name, l,
var propName, attrNames, name, l, isBool,
i = 0;
if ( value && elem.nodeType === 1 ) {
@ -2567,13 +2576,17 @@ jQuery.extend({
if ( name ) {
propName = jQuery.propFix[ name ] || name;
isBool = rboolean.test( name );
// See #9699 for explanation of this approach (setting first, then removal)
jQuery.attr( elem, name, "" );
// Do not do this for boolean attributes (see #10870)
if ( !isBool ) {
jQuery.attr( elem, name, "" );
}
elem.removeAttribute( getSetAttribute ? name : propName );
// Set corresponding property to false for boolean attributes
if ( rboolean.test( name ) && propName in elem ) {
if ( isBool && propName in elem ) {
elem[ propName ] = false;
}
}
@ -2727,7 +2740,8 @@ if ( !getSetAttribute ) {
fixSpecified = {
name: true,
id: true
id: true,
coords: true
};
// Use this for any attribute in IE6/7
@ -3246,6 +3260,7 @@ jQuery.event = {
delegateCount = handlers.delegateCount,
args = [].slice.call( arguments, 0 ),
run_all = !event.exclusive && !event.namespace,
special = jQuery.event.special[ event.type ] || {},
handlerQueue = [],
i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
@ -3253,6 +3268,11 @@ jQuery.event = {
args[0] = event;
event.delegateTarget = this;
// Call the preDispatch hook for the mapped type, and let it bail if desired
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
return;
}
// Determine handlers that should run if there are delegated events
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && !(event.button && event.type === "click") ) {
@ -3262,7 +3282,7 @@ jQuery.event = {
jqcur.context = this.ownerDocument || this;
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
// Don't process events on disabled elements (#6911, #8165)
if ( cur.disabled !== true ) {
selMatch = {};
@ -3322,6 +3342,11 @@ jQuery.event = {
}
}
// Call the postDispatch hook for the mapped type
if ( special.postDispatch ) {
special.postDispatch.call( this, event );
}
return event.result;
},
@ -3613,16 +3638,23 @@ if ( !jQuery.support.submitBubbles ) {
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
if ( form && !form._submit_attached ) {
jQuery.event.add( form, "submit._submit", function( event ) {
// If form was submitted by the user, bubble the event up the tree
if ( this.parentNode && !event.isTrigger ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
event._submit_bubble = true;
});
form._submit_attached = true;
}
});
// return undefined since we don't need an event listener
},
postDispatch: function( event ) {
// If form was submitted by the user, bubble the event up the tree
if ( event._submit_bubble ) {
delete event._submit_bubble;
if ( this.parentNode && !event.isTrigger ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
}
},
teardown: function() {
// Only need this for delegated form submit events
@ -5565,7 +5597,7 @@ jQuery.each({
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( elem.parentNode.firstChild, elem );
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
@ -5709,7 +5741,7 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style)/i,
rnocache = /<(?:script|object|embed|option|style)/i,
rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
@ -6036,6 +6068,8 @@ jQuery.fn.extend({
jQuery.each( scripts, function( i, elem ) {
if ( elem.src ) {
jQuery.ajax({
type: "GET",
global: false,
url: elem.src,
async: false,
dataType: "script"
@ -6141,12 +6175,16 @@ function cloneFixAttributes( src, dest ) {
// cloning other types of input fields
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
// IE blanks contents when cloning scripts
} else if ( nodeName === "script" && dest.text !== src.text ) {
dest.text = src.text;
}
// Event data gets referenced instead of copied if the expando
// gets copied too
dest.removeAttribute( jQuery.expando );
// Clear flags for bubbling special change/submit events, they must
// be reattached when the newly cloned events are first activated
dest.removeAttribute( "_submit_attached" );
@ -6275,7 +6313,7 @@ jQuery.extend({
destElements,
i,
// IE<=8 does not properly clone detached, unknown element nodes
clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
elem.cloneNode( true ) :
shimCloneNode( elem );
@ -6325,7 +6363,8 @@ jQuery.extend({
},
clean: function( elems, context, fragment, scripts ) {
var checkScriptType;
var checkScriptType, script, j,
ret = [];
context = context || document;
@ -6334,8 +6373,6 @@ jQuery.extend({
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
var ret = [], j;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
@ -6357,7 +6394,9 @@ jQuery.extend({
var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
wrap = wrapMap[ tag ] || wrapMap._default,
depth = wrap[0],
div = context.createElement("div");
div = context.createElement("div"),
safeChildNodes = safeFragment.childNodes,
remove;
// Append wrapper element to unknown element safe doc fragment
if ( context === document ) {
@ -6402,6 +6441,21 @@ jQuery.extend({
}
elem = div.childNodes;
// Clear elements from DocumentFragment (safeFragment or otherwise)
// to avoid hoarding elements. Fixes #11356
if ( div ) {
div.parentNode.removeChild( div );
// Guard against -1 index exceptions in FF3.6
if ( safeChildNodes.length > 0 ) {
remove = safeChildNodes[ safeChildNodes.length - 1 ];
if ( remove && remove.parentNode ) {
remove.parentNode.removeChild( remove );
}
}
}
}
}
@ -6430,16 +6484,17 @@ jQuery.extend({
return !elem.type || rscriptType.test( elem.type );
};
for ( i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
script = ret[i];
if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
} else {
if ( ret[i].nodeType === 1 ) {
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
if ( script.nodeType === 1 ) {
var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
}
fragment.appendChild( ret[i] );
fragment.appendChild( script );
}
}
}
@ -6659,7 +6714,7 @@ jQuery.extend({
}
});
// DEPRECATED, Use jQuery.css() instead
// DEPRECATED in 1.3, Use jQuery.css() instead
jQuery.curCSS = jQuery.css;
if ( document.defaultView && document.defaultView.getComputedStyle ) {
@ -7228,7 +7283,7 @@ jQuery.extend({
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
type: "GET",
contentType: "application/x-www-form-urlencoded",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
processData: true,
async: true,
/*
@ -7927,8 +7982,7 @@ jQuery.ajaxSetup({
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
( typeof s.data === "string" );
var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
if ( s.dataTypes[ 0 ] === "jsonp" ||
s.jsonp !== false && ( jsre.test( s.url ) ||
@ -8229,7 +8283,13 @@ if ( jQuery.support.ajax ) {
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
responses.text = xhr.responseText;
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#11426)
try {
responses.text = xhr.responseText;
} catch( _ ) {
}
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
@ -8456,7 +8516,7 @@ jQuery.fn.extend({
prop[ name ] = prop[ p ];
delete prop[ p ];
}
if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
replace = hooks.expand( prop[ name ] );
delete prop[ name ];
@ -8699,11 +8759,11 @@ jQuery.extend({
},
easing: {
linear: function( p, n, firstNum, diff ) {
return firstNum + diff * p;
linear: function( p ) {
return p;
},
swing: function( p, n, firstNum, diff ) {
return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
swing: function( p ) {
return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
}
},
@ -8933,12 +8993,14 @@ jQuery.extend( jQuery.fx, {
}
});
// Adds width/height step functions
// Do not set anything below 0
jQuery.each([ "width", "height" ], function( i, prop ) {
jQuery.fx.step[ prop ] = function( fx ) {
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
};
// Ensure props that can't be negative don't go there on undershoot easing
jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
// exclude marginTop, marginLeft, marginBottom and marginRight from this list
if ( prop.indexOf( "margin" ) ) {
jQuery.fx.step[ prop ] = function( fx ) {
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
};
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
@ -8975,7 +9037,7 @@ function defaultDisplay( nodeName ) {
// document to it; WebKit & Firefox won't allow reusing the iframe document.
if ( !iframeDoc || !iframe.createElement ) {
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
iframeDoc.close();
}
@ -9279,7 +9341,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
doc = elem.document;
docElemProp = doc.documentElement[ clientProp ];
return doc.compatMode === "CSS1Compat" && docElemProp ||
return jQuery.support.boxModel && docElemProp ||
doc.body && doc.body[ clientProp ] || docElemProp;
}
@ -9287,8 +9349,16 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
if ( elem.nodeType === 9 ) {
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
doc = elem.documentElement;
// when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
// so we can't use max, as it'll choose the incorrect offset[Width/Height]
// instead we use the correct client[Width/Height]
// support:IE6
if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
return doc[ clientProp ];
}
return Math.max(
doc[ clientProp ],
elem.body[ scrollProp ], doc[ scrollProp ],
elem.body[ offsetProp ], doc[ offsetProp ]
);

View File

@ -91,11 +91,12 @@
list-style-type: none;
}
.openerp input, .openerp textarea, .openerp select {
padding: 4px;
padding: 1px 4px;
border: 1px solid #cccccc;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background: white;
}
.openerp img {
vertical-align: middle;
@ -308,6 +309,38 @@
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
border: none;
}
.openerp .oe_button.oe_link {
border: none;
padding: 0;
margin: 0;
background: none;
-moz-border-radius: none;
-webkit-border-radius: none;
border-radius: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.openerp .oe_button.oe_link img {
display: none;
}
.openerp .oe_button.oe_link span {
border: none;
padding: 0;
margin: 0;
background: none;
-moz-border-radius: none;
-webkit-border-radius: none;
border-radius: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
color: #8a89ba;
font-weight: bold;
}
.openerp .oe_button.oe_link span:hover {
text-decoration: underline;
}
.openerp.oe_tooltip {
font-size: 12px;
}
@ -1440,6 +1473,10 @@
top: 0;
right: 5px;
}
.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_dashboard form {
display: none;
margin-top: 2px;
}
.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced form {
display: none;
margin-top: 8px;

View File

@ -27,6 +27,14 @@ $colour4: #8a89ba
font-weight: normal
font-style: normal
@mixin reset()
border: none
padding: 0
margin: 0
background: none
@include radius(none)
@include box-shadow(none)
@mixin vertical-gradient($startColor: #555, $endColor: #333)
background-color: $startColor
background-image: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) /* Saf4+, Chrome */
@ -135,9 +143,10 @@ $colour4: #8a89ba
li
list-style-type: none
input, textarea, select
padding: 4px
padding: 1px 4px
border: 1px solid #ccc
@include radius(3px)
background: white
img
vertical-align: middle
h4
@ -260,6 +269,17 @@ $colour4: #8a89ba
@include radius(3px)
@include box-shadow(0 1px 3px rgba(0, 0, 0, 0.3))
border: none
.oe_button.oe_link
@include reset()
img
display: none
span
@include reset()
color: #8A89BA
font-weight: bold
&:hover
text-decoration: underline
//.oe_edit_only 
// }}}
// Tooltips {{{
@ -1130,6 +1150,11 @@ $colour4: #8a89ba
position: absolute
top: 0
right: 5px
.oe_searchview_dashboard
form
display: none
margin-top: 2px
.oe_searchview_advanced
form
display: none

View File

@ -595,7 +595,7 @@ instance.web.qweb.preprocess_node = function() {
break;
case 1:
// Element
var attr, attrs = ['label', 'title', 'alt'];
var attr, attrs = ['label', 'title', 'alt', 'placeholder'];
while (attr = attrs.pop()) {
if (this.attributes[attr]) {
this.attributes[attr] = instance.web._t(this.attributes[attr]);

View File

@ -635,6 +635,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
(new instance.web.search.CustomFilters(this));
// add Advanced to this.inputs
(new instance.web.search.Advanced(this));
(new instance.web.search.AddToDashboard(this));
// build drawer
var drawer_started = $.when.apply(
@ -692,53 +693,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
select.val('');
}
},
on_add_to_dashboard: function() {
this.$element.find(".oe_search-view-filters-management")[0].selectedIndex = 0;
var self = this,
menu = instance.webclient.menu,
$dialog = $(QWeb.render("SearchView.add_to_dashboard", {
dashboards : menu.data.data.children,
selected_menu_id : menu.$element.find('a.active').data('menu')
}));
$dialog.find('input').val(this.fields_view.name);
instance.web.dialog($dialog, {
modal: true,
title: _t("Add to Dashboard"),
buttons: [
{text: _t("Cancel"), click: function() {
$(this).dialog("close");
}},
{text: _t("OK"), click: function() {
$(this).dialog("close");
var menu_id = $(this).find("select").val(),
title = $(this).find("input").val(),
data = self.build_search_data(),
context = new instance.web.CompoundContext(),
domain = new instance.web.CompoundDomain();
_.each(data.contexts, function(x) {
context.add(x);
});
_.each(data.domains, function(x) {
domain.add(x);
});
self.rpc('/web/searchview/add_to_dashboard', {
menu_id: menu_id,
action_id: self.getParent().action.id,
context_to_save: context,
domain: domain,
view_mode: self.getParent().active_view,
name: title
}, function(r) {
if (r === false) {
self.do_warn("Could not add filter to dashboard");
} else {
self.do_notify("Filter added to dashboard", '');
}
});
}}
]
});
},
/**
* Extract search data from the view's facets.
*
@ -1540,6 +1494,14 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
var self = this;
this.model = new instance.web.Model('ir.filters');
this.filters = {};
this.view.query
.on('remove', function (facet) {
if (!facet.get('is_custom_filter')) {
return;
}
self.clear_selection();
})
.on('reset', this.proxy('clear_selection'));
this.$element.on('submit', 'form', this.proxy('save_current'));
this.$element.on('click', 'h4', function () {
self.$element.toggleClass('oe_opened');
@ -1549,6 +1511,9 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
model: this.view.model
}).pipe(this.proxy('set_filters'));
},
clear_selection: function () {
this.$element.find('li.oe_selected').removeClass('oe_selected');
},
append_filter: function (filter) {
var self = this;
var key = _.str.sprintf('(%s)%s', filter.user_id, filter.name);
@ -1583,8 +1548,10 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
get_groupby: function () { return [filter.context]; },
get_domain: function () { return filter.domain; }
},
is_custom_filter: true,
values: [{label: filter.name, value: null}]
}]);
$filter.addClass('oe_selected');
});
},
set_filters: function (filters) {
@ -1671,6 +1638,100 @@ instance.web.search.Filters = instance.web.search.Input.extend({
}));
}
});
instance.web.search.AddToDashboard = instance.web.search.Input.extend({
template: 'SearchView.addtodashboard',
_in_drawer: true,
start: function () {
var self = this;
this.data_loaded = $.Deferred();
this.dashboard_data =[];
this.$element
.on('click', 'h4', this.proxy('show_option'))
.on('submit', 'form', function (e) {e.preventDefault(); self.add_dashboard();});
return $.when(this.load_data(),this.data_loaded).pipe(this.proxy("render_data"));
},
load_data:function(){
// get from database if dashboard position change than also works(from Reporting to else).
/*var self = this,
ir_actions_act_window = new instance.web.Model('ir.actions.act_window',{},[['res_model','=',"board.board"],['view_id','!=',false]])
.query(['name','id']),
map_data = function(){
var ir_actions_values = arguments[0],ir_values = arguments[1];
_(ir_values).each(function(res){
var get_name = _.detect(ir_actions_values,function(name){ return name.id == parseInt((res.value).split(",")[1]);});
self.dashboard_data.push({"res_id":res.res_id,"name":get_name.name})
});
self.data_loaded.resolve();
},
make_domain = function(result){
var domain = [];
_(result).map(function(value,key){
domain.push(["value","=","ir.actions.act_window,"+value.id]);
((result.length)- 1 !== key)?domain.unshift("|"):false;
})
return domain;
};
return ir_actions_act_window._execute().then(function(ir_actions_values){
if(!ir_actions_values.length) {self.data_loaded.resolve();return;}
var ir_value = new instance.web.Model('ir.values',{},make_domain(ir_actions_values)).query(['res_id','value']);
ir_value._execute().done(function(ir_values){
map_data(ir_actions_values,ir_values);
})
});*/
//===============================get from instance.webclient.menu (with less rpc call)
var self = this,dashbaord_menu = instance.webclient.menu.data.data.children,
ir_model_data = new instance.web.Model('ir.model.data',{},[['name','=','menu_reporting_dashboard']]).query(['res_id']),
map_data = function(result){
_.detect(dashbaord_menu,function(dash){
var id = _.pluck(dash.children, "id"),indexof = _.indexOf(id, result.res_id);
if(indexof !== -1){
self.dashboard_data = dash.children[indexof].children
self.data_loaded.resolve();
return;
}
});
};
return ir_model_data._execute().done(function(result){map_data(result[0])});
},
render_data: function(){
var self = this;
var selection = instance.web.qweb.render("SearchView.addtodashboard.selection",{selections:this.dashboard_data});
this.$element.find("input").before(selection)
},
add_dashboard:function(){
var self = this,getParent = this.getParent(),view_parent = this.view.getParent();
if(!view_parent.action || !this.$element.find("select").val())
return this.do_warn("Can't find dashboard action");
data = getParent.build_search_data(),
context = new instance.web.CompoundContext(getParent.dataset.get_context() || []),
domain = new instance.web.CompoundDomain(getParent.dataset.get_domain() || []);
_.each(data.contexts, function(x) {context.add(x);});
_.each(data.domains, function(x) {domain.add(x);});
this.rpc('/web/searchview/add_to_dashboard', {
menu_id: this.$element.find("select").val(),
action_id: view_parent.action.id,
context_to_save: context,
domain: domain,
view_mode: view_parent.active_view,
name: this.$element.find("input").val()
}, function(r) {
if (r === false) {
self.do_warn("Could not add filter to dashboard");
} else {
self.$element.toggleClass('oe_opened');
self.do_notify("Filter added to dashboard", '');
}
});
},
show_option:function(){
this.$element.toggleClass('oe_opened');
if (! this.$element.hasClass('oe_opened'))
return;
this.$element.find("input").val(this.getParent().fields_view.name || "" );
}
});
instance.web.search.Advanced = instance.web.search.Input.extend({
template: 'SearchView.advanced',
_in_drawer: true,

View File

@ -515,21 +515,18 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
}
},
do_node_add: function(side){
var self = this;
var self = this,property_to_check = [];
var tr = self.get_object_by_id(this.one_object.clicked_tr_id, this.one_object['main_object'], [])[0].att_list[0];
var parent_tr = ($(side).prevAll("tr[level=" + String(this.one_object.clicked_tr_level - 1) + "]"))[0];
var field_dataset = new instance.web.DataSetSearch(this, this.model, null, null);
parent_tr = $(parent_tr).find('a').text();
parent_tr = self.get_object_by_id(parseInt($(parent_tr).attr('id').replace(/[^0-9]+/g, '')), this.one_object['main_object'], [])[0].att_list[0];
_.each([tr, parent_tr],function(element) {
var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false;
property_to_check.push(value);
});
field_dataset.call( 'fields_get', [], function(result) {
var fields = _.keys(result);
fields.push(" "),fields.sort();
var property_to_check = [];
_.each([tr, parent_tr],function(element) {
property_to_check.push(
_.detect(_.keys(_CHILDREN),function(res){
return _.str.include(element, res);
}));
});
self.on_add_node(property_to_check, fields);
});
},
@ -990,7 +987,7 @@ instance.web.ViewEditor = instance.web.OldWidget.extend({
render_new_field :function( result ) {
var self = this;
var action = {
context: {'default_model_id': result.id, 'manual': true, 'module' : result.modules},
context: {'default_model_id': result.id, 'manual': true, 'module' : result.model},
res_model: "ir.model.fields",
views: [[false, 'form']],
type: 'ir.actions.act_window',
@ -1168,8 +1165,16 @@ var _CHILDREN = {
'label': [],
'button' : [],
'newline': [],
'separator': []
'separator': [],
'sheet' :['group','field','notebook','label','separator','div','page'],
'kanban' : ['field'],
'html_tag':['notebook', 'group', 'field', 'label', 'button','board', 'newline', 'separator']
//e.g.:xyz 'td' : ['field']
};
// Generic html_tag list and can be added html tag in future. It's support above _CHILDREN dict's *html_tag* by default.
// For specific child node one has to define tag above and specify children tag in list. Like above xyz example.
var html_tag = ['div','h1','h2','h3','h4','h5','h6','td','tr'];
var _ICONS = ['','STOCK_ABOUT', 'STOCK_ADD', 'STOCK_APPLY', 'STOCK_BOLD',
'STOCK_CANCEL', 'STOCK_CDROM', 'STOCK_CLEAR', 'STOCK_CLOSE', 'STOCK_COLOR_PICKER',
'STOCK_CONNECT', 'STOCK_CONVERT', 'STOCK_COPY', 'STOCK_CUT', 'STOCK_DELETE',

View File

@ -1621,12 +1621,11 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({
},
start: function() {
this._super.apply(this, arguments);
var $button = this.$element.find('button');
$button.click(this.on_click);
this.$element.click(this.on_click);
if (this.node.attrs.help || instance.connection.debug) {
this.do_attach_tooltip();
}
this.setupFocus($button);
this.setupFocus(this.$element);
},
on_click: function() {
var self = this;

View File

@ -1238,7 +1238,6 @@
<optgroup label="-- Actions --">
<option value="advanced_filter">Add Advanced Filter</option>
<option value="save_filter">Save Filter</option>
<option value="add_to_dashboard">Add to Dashboard</option>
<option value="manage_filters">Manage Filters</option>
</optgroup>
</t>
@ -1249,16 +1248,7 @@
<p>(Any existing filter with the same name will be replaced)</p>
</div>
</t>
<t t-name="SearchView.add_to_dashboard">
<div>
<p><b>Select Dashboard to add this filter to:</b></p>
<select style="width: 100%; margin-right: 1em;">
<option t-foreach="dashboards" t-as="menu" t-att-value="menu.id" t-att-selected="(menu.id == selected_menu_id) || undefined"><t t-esc="menu.name"/></option>
</select>
<p><b>Title of new Dashboard item:</b></p>
<input type="text" style="width: 100%; margin-right: 1em;"/>
</div>
</t>
<t t-name="SearchView.render_lines">
<table class="oe-searchview-render-line" border="0" cellspacing="0" cellpadding="0"
t-foreach="lines" t-as="line">
@ -1397,6 +1387,20 @@
<div>
</div>
</div>
<div t-name="SearchView.addtodashboard" class="oe_searchview_dashboard">
<h4>Add to Dashboard</h4>
<form>
<input placeholder ="Title of new Dashboard item" title = "Title of new Dashboard item" type="text"/>
<button class="oe_apply" type="submit">save</button>
</form>
</div>
<t t-name="SearchView.addtodashboard.selection">
<select title = "Select Dashboard to add this filter to">
<t t-foreach="selections" t-as="element">
<option t-att-value="element.id || element.res_id "><t t-esc="element.name"/></option>
</t>
</select>
</t>
<div t-name="SearchView.advanced" class="oe_searchview_advanced">
<h4>Advanced Search</h4>
<form>

View File

@ -1094,6 +1094,72 @@ $(document).ready(function () {
});
});
module('saved_filters', {
setup: function () {
instance = window.openerp.init([]);
window.openerp.web.corelib(instance);
window.openerp.web.coresetup(instance);
window.openerp.web.chrome(instance);
window.openerp.web.data(instance);
window.openerp.web.formats(instance);
window.openerp.web.search(instance);
instance.web.qweb.add_template(doc);
mockifyRPC(instance.connection);
}
});
asyncTest('checkboxing', 6, function () {
var view = makeSearchView();
instance.connection.responses['/web/searchview/get_filters'] = function () {
return {result: [{
name: "filter name",
user_id: 42
}]};
};
var $fix = $('#qunit-fixture');
view.appendTo($fix)
.always(start)
.fail(function (error) { ok(false, error.message); })
.done(function () {
var $row = $fix.find('.oe_searchview_custom li:first').click();
ok($row.hasClass('oe_selected'), "should check/select the filter's row");
ok($row.hasClass("oe_searchview_custom_private"),
"should have private filter note/class");
equal(view.query.length, 1, "should have only one facet");
var values = view.query.at(0).values;
equal(values.length, 1,
"should have only one value in the facet");
equal(values.at(0).get('label'), 'filter name',
"displayed label should be the name of the filter");
equal(values.at(0).get('value'), null,
"should have no value set");
})
});
asyncTest('removal', 1, function () {
var view = makeSearchView();
instance.connection.responses['/web/searchview/get_filters'] = function () {
return {result: [{
name: "filter name",
user_id: 42
}]};
};
var $fix = $('#qunit-fixture');
view.appendTo($fix)
.always(start)
.fail(function (error) { ok(false, error.message); })
.done(function () {
var $row = $fix.find('.oe_searchview_custom li:first').click();
view.query.remove(view.query.at(0));
ok(!$row.hasClass('oe_selected'),
"should not be checked anymore");
})
});
module('advanced', {
setup: function () {
instance = window.openerp.init([]);

View File

@ -107,7 +107,7 @@ def extract_qweb(fileobj, keywords, comment_tags, options):
not ("t-jquery" in el.attrib and "t-operation" not in el.attrib) and \
not ("t-translation" in el.attrib and el.attrib["t-translation"].strip() == "off"):
handle_text(el.text, el.sourceline)
for att in ('title', 'alt', 'label'):
for att in ('title', 'alt', 'label', 'placeholder'):
if att in el.attrib:
handle_text(el.attrib[att], el.sourceline)
iter_elements(el)