[MERGE] from trunk
bzr revid: chm@openerp.com-20121109083925-rpuk4rwyu3kx50vt
|
@ -17,7 +17,7 @@ This module provides the core of the OpenERP Web Client.
|
|||
"static/lib/datejs/parser.js",
|
||||
"static/lib/datejs/sugarpak.js",
|
||||
"static/lib/datejs/extras.js",
|
||||
"static/lib/jquery/jquery-1.7.2.js",
|
||||
"static/lib/jquery/jquery-1.8.2.js",
|
||||
"static/lib/jquery.MD5/jquery.md5.js",
|
||||
"static/lib/jquery.form/jquery.form.js",
|
||||
"static/lib/jquery.validate/jquery.validate.js",
|
||||
|
@ -25,7 +25,7 @@ This module provides the core of the OpenERP Web Client.
|
|||
"static/lib/spinjs/spin.js",
|
||||
"static/lib/jquery.autosize/jquery.autosize.js",
|
||||
"static/lib/jquery.blockUI/jquery.blockUI.js",
|
||||
"static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js",
|
||||
"static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js",
|
||||
"static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js",
|
||||
"static/lib/jquery.ui.notify/js/jquery.notify.js",
|
||||
"static/lib/jquery.deferred-queue/jquery.deferred-queue.js",
|
||||
|
@ -55,7 +55,7 @@ This module provides the core of the OpenERP Web Client.
|
|||
"static/src/js/view_tree.js",
|
||||
],
|
||||
'css' : [
|
||||
"static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css",
|
||||
"static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css",
|
||||
"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",
|
||||
|
|
|
@ -11,12 +11,15 @@ Contents:
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
presentation
|
||||
|
||||
changelog-7.0
|
||||
|
||||
async
|
||||
rpc
|
||||
|
||||
widget
|
||||
qweb
|
||||
search-view
|
||||
|
||||
list-view
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
Presentation
|
||||
============
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Prerequisites to code addons for the OpenERP Web Client:
|
||||
|
||||
- Html
|
||||
- Css
|
||||
- Javascript
|
||||
- jQuery
|
||||
|
||||
Once you know all this, that's only the beginning. Most usages of Javascript/jQuery are small hacks to make a web page nicer. The OpenERP Client Web is different: it's a web application, not a web site. It doesn't have multiple pages generated by a server side code. Only one unique empty page is loaded and all the html is generated by Javascript code, the page is never reloaded. If you never developed that kind of application you still have lot of good practices to learn.
|
||||
|
||||
Recommendations
|
||||
---------------
|
||||
|
||||
First, here are the 5 golden rules when you create web 2.0 applications:
|
||||
|
||||
* **Do not use ids**. Html ids are evil, the key anti-feature that makes your components non-reusable. You want to identify a dom part? Save a jQuery object over that dom element. If you really need to use ids, use _.uniqueId(), but 99% of the time you don't need to, classes are sufficient.
|
||||
* **Do not use predictable css class names** like "content" or "navigation", ten other developers will have the same idea than you and there will be clashes. A simple way to avoid this is to use prefixes. For example, if you need a css class for the button named "new" that is contained in the form view which is itself contained in the OpenERP application, name it "oe-form-view-new-button".
|
||||
* **Do not use global selectors** like *$(".my-class")*, you never know if your component will be instantiated multiple times. Limit the selector with a context, like *$(".my-class", this.$el)*.
|
||||
* As a general advice, **Never assume you own the page**. When you create a component, it is never unique and is always surrounded by a bunch of crazy html. You have to do with it.
|
||||
* **Learn how to use jQuery's deferreds** [1]_. That concept may seem over-complicated, but the experience tell us that it is nearly impossible to create big-size javascript applications without that.
|
||||
|
||||
More recommendations related to the specific case of the OpenERP Web Client:
|
||||
|
||||
* Your components should inherit from the *Widget* class.
|
||||
* Use QWeb templates for html rendering.
|
||||
* Use *Widget* 's methods (*appendTo*, *replace*,...) to insert your component and its content into the dom.
|
||||
* All css classes should have the prefix *oe-* .
|
||||
* Functions that call rpc() should return a deferred, even if it calls it indirectly. So a function that calls a function that calls a function that calls rpc() should return a deferred too.
|
||||
|
||||
.. [1] http://api.jquery.com/category/deferred-object/
|
|
@ -0,0 +1,79 @@
|
|||
|
||||
QWeb Cookbook
|
||||
=============
|
||||
|
||||
QWeb is the template engine used by the OpenERP Web Client. It is a home made engine create by OpenERP developers. There are a few things to note about it:
|
||||
|
||||
* Template are rendered in javascript on the client-side, the server does nothing.
|
||||
* It is an xml template engine, like Facelets_ for example. The source file must be a valid xml.
|
||||
* Templates are not interpreted. There are compiled to javascript. This makes them a lot faster to render, but sometimes harder to debug.
|
||||
* Most of the time it is used through the Widget class, but you can also use it directly using *openerp.web.qweb.render()* .
|
||||
|
||||
.. _Facelets: http://en.wikipedia.org/wiki/Facelets
|
||||
|
||||
Here is a typical QWeb file:
|
||||
|
||||
::
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates>
|
||||
<t t-name="Template1">
|
||||
<div>...</div>
|
||||
</t>
|
||||
<t t-name="Template2">
|
||||
<div>...</div>
|
||||
</t>
|
||||
</templates>
|
||||
|
||||
A QWeb file contains multiple templates, they are simply identified by a name.
|
||||
|
||||
Here is a sample QWeb template:
|
||||
|
||||
::
|
||||
|
||||
<t t-name="UserPage">
|
||||
<div>
|
||||
<p>Name: <t t-esc="widget.user_name"/></p>
|
||||
<p>Password: <input type="text" t-att-value="widget.password"/></p>
|
||||
<p t-if="widget.is_admin">This user is an Administrator</p>
|
||||
<t t-foreach="widget.roles" t-as="role">
|
||||
<p>User has role: <t t-esc="role"/></p>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
||||
*widget* is a variable given to the template engine by Widget sub-classes when they decide to render their associated template, it is simply *this*. Here is the corresponding Widget sub-class:
|
||||
|
||||
::
|
||||
|
||||
UserPageWidget = openerp.base.Widget.extend({
|
||||
template: "UserPage",
|
||||
init: function(parent) {
|
||||
this._super(parent);
|
||||
this.user_name = "Xavier";
|
||||
this.password = "lilo";
|
||||
this.is_admin = true;
|
||||
this.roles = ["Web Developer", "IE Hater", "Steve Jobs Worshiper"];
|
||||
},
|
||||
});
|
||||
|
||||
It could output something like this:
|
||||
|
||||
::
|
||||
|
||||
<div>
|
||||
<p>Name: Xavier</p>
|
||||
<p>Password: <input type="text" value="lilo"/></p>
|
||||
<p>This user is an Administrator</p
|
||||
<p>User has role: Web Developer</p>
|
||||
<p>User has role: IE Hater</p>
|
||||
<p>User has role: Steve Jobs Worshiper</p>
|
||||
</div>
|
||||
|
||||
A QWeb template should always contain one unique root element to be used effectively with the Widget class, here it is a *<div>*. QWeb only react to *<t>* elements or attributes prefixed by *t-*. The *<t>* is simply a null element, it is only used when you need to use a *t-* attribute without outputting an html element at the same time. Here are the effects of the most common QWeb attributes:
|
||||
|
||||
* *t-esc* outputs the result of the evaluation of the given javascript expression
|
||||
* *t-att-ATTR* sets the value of the *ATTR* attribute to the result of the evaluation of the given javascript expression
|
||||
* *t-if* outputs the element and its content only if the given javascript expression returns true
|
||||
* *t-foreach* outputs as many times as contained in the list returned by the given javascript expression. For each iteration, a variable with the name defined by *t-as* contains the current element in the list.
|
|
@ -1,21 +0,0 @@
|
|||
Copyright 2011 Xavier Morel. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are
|
||||
permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
of conditions and the following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY XAVIER MOREL ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,59 +0,0 @@
|
|||
.. -*- restructuredtext -*-
|
||||
|
||||
In jQuery 1.5, jQuery has introduced a Deferred object in order to
|
||||
better handle callbacks.
|
||||
|
||||
Along with Deferred, it introduced ``jQuery.when`` which allows, among
|
||||
other things, for multiplexing deferreds (waiting on multiple
|
||||
deferreds at the same time).
|
||||
|
||||
While this is very nice if all deferreds are available at the same
|
||||
point, it doesn't really work if the resolution of a deferred can
|
||||
generate more deferreds, or for collections of deferreds coming from
|
||||
multiple sources (which may not be aware of one another).
|
||||
|
||||
Deferred.queue tries to be a solution to this. It is based on the
|
||||
principle of FIFO multiple-producers multiple-consumers tasks queues,
|
||||
such as Python's `queue.Queue`_. Any code with a reference to the
|
||||
queue can add a promise to the queue, and the queue (which is a
|
||||
promise itself) will only be resolved once all promises within are
|
||||
resolved.
|
||||
|
||||
Quickstart
|
||||
----------
|
||||
|
||||
Deferred.queue has a very simple life cycle: it is dormant when
|
||||
created, it starts working as soon as promises get added to it (via
|
||||
``.push``, or by providing them directly to its constructor), and as
|
||||
soon as the last promise in the queue is resolved it resolves itself.
|
||||
|
||||
If any promise in the queue fails, the queue itself will be rejected
|
||||
(without waiting for further promises).
|
||||
|
||||
Once a queue has been resolved or rejected, adding new promises to it
|
||||
results in an error.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
``jQuery.Deferred.queue([promises...])``
|
||||
Creates a new deferred queue. Can be primed with a series of promise
|
||||
objects.
|
||||
|
||||
``.push(promise...)``
|
||||
Adds promises to the queue. Returns the queue itself (can be
|
||||
chained).
|
||||
|
||||
If the queue has already been resolved or rejected, raises an error.
|
||||
|
||||
``.then([doneCallbacks][, failCallbacks])``
|
||||
Promise/A ``then`` method.
|
||||
|
||||
``.done(doneCallbacks)``
|
||||
jQuery ``done`` extension to promise objects
|
||||
|
||||
``.fail(failCallbacks)``
|
||||
jQuery ``fail`` extension to promise objects
|
||||
|
||||
.. _queue.Queue:
|
||||
http://docs.python.org/dev/library/queue.html
|
|
@ -1,34 +0,0 @@
|
|||
(function ($) {
|
||||
"use strict";
|
||||
$.extend($.Deferred, {
|
||||
queue: function () {
|
||||
var queueDeferred = $.Deferred();
|
||||
var promises = 0;
|
||||
|
||||
function resolve() {
|
||||
if (--promises > 0) {
|
||||
return;
|
||||
}
|
||||
setTimeout($.proxy(queueDeferred, 'resolve'), 0);
|
||||
}
|
||||
|
||||
var promise = $.extend(queueDeferred.promise(), {
|
||||
push: function () {
|
||||
if (this.isResolved() || this.isRejected()) {
|
||||
throw new Error("Can not add promises to a resolved "
|
||||
+ "or rejected promise queue");
|
||||
}
|
||||
|
||||
promises += 1;
|
||||
$.when.apply(null, arguments).then(
|
||||
resolve, $.proxy(queueDeferred, 'reject'));
|
||||
return this;
|
||||
}
|
||||
});
|
||||
if (arguments.length) {
|
||||
promise.push.apply(promise, arguments);
|
||||
}
|
||||
return promise;
|
||||
}
|
||||
});
|
||||
})(jQuery)
|
|
@ -0,0 +1,31 @@
|
|||
#jQuery UI Bootstrap
|
||||
|
||||
##Summary
|
||||
|
||||
This is a project I started to bring the beauty of Twitter's Bootstrap to jQuery UI widgets.
|
||||
|
||||
Twitter's Bootstrap was one of my favorite projects to come out of 2011, but having used it regularly it left me wanting two things:
|
||||
|
||||
* The ability to work side-by-side with jQuery UI (something which caused a number of widgets to break visually)
|
||||
* The ability to theme jQuery UI widgets using Bootstrap styles. Whilst I love jQuery UI, I (like others) find some of the current themes to look a little dated. My hope is that this theme provides a decent alternative for others that feel the same.
|
||||
|
||||
To clarify, this project doesn't aim or intend to replace Twitter Bootstrap. It merely provides a jQuery UI-compatible theme inspired by Bootstrap's design. It also provides a version of Bootstrap CSS with a few (minor) sections commented out which enable the theme to work along-side it.
|
||||
|
||||
I welcome any and all feedback as I'd very much like this theme to be as solid as possible.
|
||||
|
||||
##Browser-support
|
||||
|
||||
All modern browsers are targeted by this theme with 'lo-res' experiences (i.e no gradients, border-radius etc.) provided for users using older browsers.
|
||||
|
||||
There *are* some minor known issues lingering that I'm working on, but the hope is that in time those will all get ironed out.
|
||||
|
||||
##jQuery UI support
|
||||
|
||||
This theme targets jQuery UI 1.8.16 and the default version of jQuery included in the (current) jQuery UI builds (jQuery 1.6.2). I'm aware of jQuery 1.7.1 and intend on upgrading anything necessary in the theme to use it when the jQuery UI team officially include it in their theme packs.
|
||||
|
||||
|
||||
##Demo
|
||||
|
||||
For a live preview of the theme, see [http://addyosmani.github.com/jquery-ui-bootstrap](http://addyosmani.github.com/jquery-ui-bootstrap).
|
||||
|
||||
A [blog post](http://addyosmani.com/blog/jquery-ui-bootstrap/) with some more details about the project is also available.
|
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png
Executable file → Normal file
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png
Executable file → Normal file
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png
Executable file → Normal file
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 105 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png
Executable file → Normal file
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png
Executable file → Normal file
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png
Executable file → Normal file
Before Width: | Height: | Size: 107 B After Width: | Height: | Size: 107 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Executable file → Normal file
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png
Executable file → Normal file
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png
Executable file → Normal file
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png
Executable file → Normal file
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png
Executable file → Normal file
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png
Executable file → Normal file
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png
Executable file → Normal file
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
@ -23,6 +23,7 @@
|
|||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
@ -59,7 +60,7 @@
|
|||
----------------------------------*/
|
||||
.ui-widget { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:13px; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
/*.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; }*/
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x; color: #404040; }
|
||||
.ui-widget-content a { color: #404040; }
|
||||
.ui-widget-header {
|
||||
|
@ -399,7 +400,6 @@
|
|||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
|
||||
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
|
||||
|
@ -432,9 +432,9 @@
|
|||
*/
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
/*
|
||||
* jQuery UI Accordion 1.8.16
|
||||
* jQuery UI Accordion 1.9.0
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
|
@ -445,7 +445,7 @@
|
|||
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; font-weight:bold; }
|
||||
.ui-accordion .ui-accordion-li-fix { display: inline; }
|
||||
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
|
||||
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
|
||||
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 1.7em; }
|
||||
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
|
||||
|
@ -465,46 +465,55 @@
|
|||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
/*
|
||||
* jQuery UI Menu 1.8.16
|
||||
* jQuery UI Menu 1.9.0
|
||||
*
|
||||
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Menu#theming
|
||||
*/
|
||||
.ui-menu {
|
||||
list-style:none;
|
||||
padding: 2px;
|
||||
margin: 0;
|
||||
display:block;
|
||||
float: left;
|
||||
}
|
||||
.ui-menu .ui-menu {
|
||||
margin-top: -3px;
|
||||
}
|
||||
.ui-menu .ui-menu-item {
|
||||
margin:0;
|
||||
padding: 0;
|
||||
zoom: 1;
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
}
|
||||
.ui-menu .ui-menu-item a {
|
||||
text-decoration:none;
|
||||
display:block;
|
||||
padding:.2em .4em;
|
||||
line-height:1.5;
|
||||
zoom:1;
|
||||
}
|
||||
.ui-menu .ui-menu-item a.ui-state-hover,
|
||||
.ui-menu .ui-menu-item a.ui-state-active {
|
||||
font-weight: normal;
|
||||
background:#0064CD;
|
||||
color:#fff
|
||||
|
||||
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; float:left; outline: none; }
|
||||
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
||||
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1;float: left;clear: left; width: 100%; }
|
||||
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
||||
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
||||
.ui-menu .ui-menu-item a.ui-state-focus,
|
||||
.ui-menu .ui-menu-item a.ui-state-active {
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
color: #ffffff;
|
||||
background: #0064cd;
|
||||
background-color: #0064cd;
|
||||
background-repeat: repeat-x;
|
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
|
||||
background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
|
||||
background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: -o-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: linear-gradient(top, #049cdb, #0064cd);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
border-color: #0064cd #0064cd #003f81;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
||||
.ui-menu .ui-state-disabled a { cursor: default; }
|
||||
|
||||
/* icon support */
|
||||
.ui-menu-icons { position: relative; }
|
||||
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned */
|
||||
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned */
|
||||
.ui-menu .ui-menu-icon { position: static; float: right; }
|
||||
|
||||
.ui-menu { width: 200px; margin-bottom: 2em; }
|
||||
|
||||
/*
|
||||
* jQuery UI Button 1.8.16
|
||||
|
@ -651,7 +660,31 @@ button.ui-button-icons-only { width: 3.7em; }
|
|||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
|
||||
/*
|
||||
* jQuery UI spinner 1.9.0
|
||||
*
|
||||
* Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Menu#theming
|
||||
*/
|
||||
|
||||
.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
||||
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
||||
.ui-spinner{}
|
||||
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; z-index: 100; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
||||
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
||||
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
||||
.ui-spinner-up { top: 0; }
|
||||
.ui-spinner-down { bottom: 0; }
|
||||
|
||||
/* TR overrides */
|
||||
span.ui-spinner { background: none; }
|
||||
.ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position:-65px -16px;
|
||||
}
|
||||
|
||||
/*
|
||||
* jQuery UI Dialog 1.8.16
|
||||
|
@ -805,14 +838,16 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
|
||||
* jQuery UI Tabs 1.8.16
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }
|
||||
|
||||
/*
|
||||
* jQuery UI Tabs 1.9.0
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs#theming
|
||||
* http://jqueryui.com/tabs/
|
||||
*/
|
||||
.ui-tabs .ui-tabs-nav{ background:none; border-color: #ddd;
|
||||
border-style: solid;
|
||||
|
@ -824,14 +859,11 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
background:whiteSmoke;
|
||||
border-bottom:1px solid #ddd;
|
||||
padding-bottom:0px;
|
||||
color:#4c4c4c;
|
||||
color:#00438A;
|
||||
}
|
||||
|
||||
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; border-bottom:1px solid #DDD; }
|
||||
.ui-tabs .ui-tabs-nav li { text-decoration: none; list-style: none; float: left; position: relative; top: 1px; padding: 0px 0px 1px 0px; white-space: nowrap; background:none; border:0px;
|
||||
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li { text-decoration: none; list-style: none; float: left; position: relative; top: 1px; padding: 0px 0px 1px 0px; white-space: nowrap; background:none; border:0px; }
|
||||
|
||||
.ui-tabs-nav .ui-state-default{
|
||||
-webkit-box-shadow: 0px 0px 0px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
|
||||
|
@ -853,25 +885,24 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
|
||||
|
||||
}
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 0px; outline:none;}
|
||||
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a {
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: 0; padding-bottom: 0px; outline:none;}
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a {
|
||||
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-color: #ffffff;
|
||||
cursor: default;
|
||||
color:#4c4c4c;
|
||||
color:gray;
|
||||
outline:none;
|
||||
}
|
||||
|
||||
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected:hover{
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active:hover{
|
||||
background:#ffffff;
|
||||
outline:none;
|
||||
}
|
||||
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; color:#0069D6; background:none; font-weight:normal; margin-bottom:-1px;}
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; color:#0069D6; background:none; font-weight:normal; margin-bottom:-1px;}
|
||||
/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.ui-tabs-panel .ui-button{text-decoration:none;}
|
||||
|
@ -883,16 +914,39 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
filter:none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* jQuery UI Datepicker 1.8.16
|
||||
* jQuery UI Tooltip 1.9.0
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Datepicker#theming
|
||||
* http://jqueryui.com/tooltip/
|
||||
*/
|
||||
.ui-tooltip {
|
||||
padding:8px;
|
||||
position:absolute;
|
||||
z-index:9999;
|
||||
-o-box-shadow: 0 0 5px #ddd;
|
||||
-moz-box-shadow: 0 0 5px #ddd;
|
||||
-webkit-box-shadow: 0 0 5px #ddd;
|
||||
/*box-shadow: 0 2px 5px #ddd;*/
|
||||
box-shadow: inset 0 1px 0 #ffffff;
|
||||
}
|
||||
/* Fades and background-images don't work well together in IE6, drop the image */
|
||||
* html .ui-tooltip {
|
||||
background-image: none;
|
||||
}
|
||||
body .ui-tooltip { border-width:2px; }
|
||||
|
||||
/*
|
||||
* jQuery UI Datepicker 1.9.0
|
||||
*
|
||||
* Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://jqueryui.com/datepicker/
|
||||
*/
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; border:0px; font-weight: bold; width: 100%; padding: 4px 0; background-color: #f5f5f5; color: #808080; }
|
||||
|
@ -982,7 +1036,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
}
|
||||
|
||||
.ui-datepicker td:hover{
|
||||
color:white;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.ui-datepicker td .ui-state-default {
|
||||
|
@ -1001,21 +1055,34 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
margin-bottom:0px;
|
||||
font-size:normal;
|
||||
text-shadow: 0px;
|
||||
color:white;
|
||||
color: #ffffff;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.ui-datepicker td .ui-state-default:hover{
|
||||
background:#0064cd;
|
||||
color:white;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
.ui-datepicker td .ui-state-hover {
|
||||
color: #ffffff;
|
||||
background: #0064cd;
|
||||
background-color: #0064cd;
|
||||
background-repeat: repeat-x;
|
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
|
||||
background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
|
||||
background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: -o-linear-gradient(top, #049cdb, #0064cd);
|
||||
background-image: linear-gradient(top, #049cdb, #0064cd);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
border-color: #0064cd #0064cd #003f81;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* jQuery UI Progressbar 1.8.16
|
||||
*
|
||||
|
@ -1065,16 +1132,17 @@ input:focus, textarea:focus {
|
|||
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
|
||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
|
||||
}
|
||||
/*input[type=file]:focus, input[type=checkbox]:focus, select:focus {
|
||||
input[type=file]:focus, input[type=checkbox]:focus, select:focus {
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
outline: 1px dotted #666;
|
||||
}*/
|
||||
}
|
||||
|
||||
/*input[type="text"],
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
textarea,*/
|
||||
.ui-autocomplete-input,
|
||||
textarea,
|
||||
.uneditable-input {
|
||||
display: inline-block;
|
||||
padding: 4px;
|
|
@ -1,5 +1,15 @@
|
|||
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-left, .ui-corner-bottom{ border-radius:0px;}
|
||||
/*
|
||||
* jQuery UI Tabs 1.9.0
|
||||
*
|
||||
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://jqueryui.com/tabs/
|
||||
*/
|
||||
|
||||
.ui-state-active,.ui-tabs-selected { border-radius:0px;}
|
||||
.ui-tabs-selected { border-radius:0px;}
|
||||
.ui-tabs .ui-tabs-nav li{ filter:none;}
|
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 144 B |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 5.2 KiB |
|
@ -1,12 +1,8 @@
|
|||
/*
|
||||
* jQuery UI CSS Framework 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Theming/API
|
||||
*/
|
||||
/*! jQuery UI - v1.9.1 - 2012-10-29
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
|
@ -36,20 +32,198 @@
|
|||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
|
||||
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
|
||||
.ui-autocomplete {
|
||||
position: absolute;
|
||||
top: 0; /* #8656 */
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*
|
||||
* jQuery UI CSS Framework 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Theming/API
|
||||
*
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
*/
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
|
||||
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
||||
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
|
||||
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
||||
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
||||
.ui-menu .ui-menu-item a.ui-state-focus,
|
||||
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
|
||||
|
||||
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
||||
.ui-menu .ui-state-disabled a { cursor: default; }
|
||||
|
||||
/* icon support */
|
||||
.ui-menu-icons { position: relative; }
|
||||
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned */
|
||||
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned */
|
||||
.ui-menu .ui-menu-icon { position: static; float: right; }
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
||||
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
||||
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
||||
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
||||
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
||||
.ui-spinner-up { top: 0; }
|
||||
.ui-spinner-down { bottom: 0; }
|
||||
|
||||
/* TR overrides */
|
||||
.ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position:-65px -16px;
|
||||
}
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.ui-tooltip {
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
}
|
||||
/* Fades and background-images don't work well together in IE6, drop the image */
|
||||
* html .ui-tooltip {
|
||||
background-image: none;
|
||||
}
|
||||
body .ui-tooltip { border-width: 2px; }
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
|
@ -66,10 +240,9 @@
|
|||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
||||
.ui-widget :active { outline: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
|
@ -81,6 +254,7 @@
|
|||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
@ -222,8 +396,8 @@
|
|||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-off { background-position: -96px -144px; }
|
||||
.ui-icon-radio-on { background-position: -112px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
|
@ -283,283 +457,5 @@
|
|||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
|
||||
* jQuery UI Resizable 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Resizable#theming
|
||||
*/
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
|
||||
* jQuery UI Selectable 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Selectable#theming
|
||||
*/
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
/*
|
||||
* jQuery UI Accordion 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion#theming
|
||||
*/
|
||||
/* IE/Win - Fix animation bug - #4615 */
|
||||
.ui-accordion { width: 100%; }
|
||||
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-li-fix { display: inline; }
|
||||
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
|
||||
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
|
||||
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-content-active { display: block; }
|
||||
/*
|
||||
* jQuery UI Autocomplete 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Autocomplete#theming
|
||||
*/
|
||||
.ui-autocomplete { position: absolute; cursor: default; }
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
/*
|
||||
* jQuery UI Menu 1.8.17
|
||||
*
|
||||
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Menu#theming
|
||||
*/
|
||||
.ui-menu {
|
||||
list-style:none;
|
||||
padding: 2px;
|
||||
margin: 0;
|
||||
display:block;
|
||||
float: left;
|
||||
}
|
||||
.ui-menu .ui-menu {
|
||||
margin-top: -3px;
|
||||
}
|
||||
.ui-menu .ui-menu-item {
|
||||
margin:0;
|
||||
padding: 0;
|
||||
zoom: 1;
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
}
|
||||
.ui-menu .ui-menu-item a {
|
||||
text-decoration:none;
|
||||
display:block;
|
||||
padding:.2em .4em;
|
||||
line-height:1.5;
|
||||
zoom:1;
|
||||
}
|
||||
.ui-menu .ui-menu-item a.ui-state-hover,
|
||||
.ui-menu .ui-menu-item a.ui-state-active {
|
||||
font-weight: normal;
|
||||
margin: -1px;
|
||||
}
|
||||
/*
|
||||
* jQuery UI Button 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Button#theming
|
||||
*/
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
/*
|
||||
* jQuery UI Dialog 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Dialog#theming
|
||||
*/
|
||||
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
/*
|
||||
* jQuery UI Slider 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Slider#theming
|
||||
*/
|
||||
.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
|
||||
* jQuery UI Tabs 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs#theming
|
||||
*/
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.ui-tabs .ui-tabs-hide { display: none !important; }
|
||||
/*
|
||||
* jQuery UI Datepicker 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Datepicker#theming
|
||||
*/
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
display: none; /*sorry for IE5*/
|
||||
display/**/: block; /*sorry for IE5*/
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}/*
|
||||
* jQuery UI Progressbar 1.8.17
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Progressbar#theming
|
||||
*/
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
5
addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.min.css
vendored
Normal file
|
@ -81,9 +81,6 @@ instance.web.Dialog = instance.web.Widget.extend({
|
|||
}
|
||||
}
|
||||
if (options) {
|
||||
if (options.buttons) {
|
||||
this.params_buttons = true;
|
||||
}
|
||||
_.extend(this.dialog_options, options);
|
||||
}
|
||||
this.on("closing", this, this._closing);
|
||||
|
@ -129,6 +126,8 @@ instance.web.Dialog = instance.web.Widget.extend({
|
|||
if (! this.dialog_inited)
|
||||
this.init_dialog();
|
||||
var o = this.get_options(options);
|
||||
this.add_buttons(o.buttons);
|
||||
delete(o.buttons);
|
||||
this.$buttons.appendTo($("body"));
|
||||
instance.web.dialog(this.$el, o).dialog('open');
|
||||
this.$el.dialog("widget").find(".ui-dialog-buttonpane").remove();
|
||||
|
@ -138,22 +137,30 @@ instance.web.Dialog = instance.web.Widget.extend({
|
|||
}
|
||||
return this;
|
||||
},
|
||||
add_buttons: function(buttons) {
|
||||
var self = this;
|
||||
_.each(buttons, function(fn, but) {
|
||||
var $but = $(QWeb.render('WidgetButton', { widget : { string: but, node: { attrs: {} }}}));
|
||||
self.$buttons.append($but);
|
||||
$but.on('click', function(ev) {
|
||||
fn.call(self.$el, ev);
|
||||
});
|
||||
});
|
||||
},
|
||||
init_dialog: function(options) {
|
||||
this.renderElement();
|
||||
var o = this.get_options(options);
|
||||
instance.web.dialog(this.$el, o);
|
||||
if (! this.params_buttons) {
|
||||
this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" />');
|
||||
this.$el.dialog("widget").append(this.$buttons);
|
||||
} else {
|
||||
this.$buttons = this.$el.dialog("widget").find(".ui-dialog-buttonpane");
|
||||
}
|
||||
this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" />');
|
||||
this.$el.dialog("widget").append(this.$buttons);
|
||||
this.dialog_inited = true;
|
||||
var res = this.start();
|
||||
return res;
|
||||
},
|
||||
close: function() {
|
||||
this.$el.dialog('close');
|
||||
if (this.dialog_inited && this.$el.is(":data(dialog)")) {
|
||||
this.$el.dialog('close');
|
||||
}
|
||||
},
|
||||
_closing: function() {
|
||||
if (this.__tmp_dialog_destroying)
|
||||
|
@ -175,7 +182,7 @@ instance.web.Dialog = instance.web.Widget.extend({
|
|||
this.close();
|
||||
this.__tmp_dialog_destroying = undefined;
|
||||
}
|
||||
if (! this.isDestroyed()) {
|
||||
if (this.dialog_inited && !this.isDestroyed()) {
|
||||
this.$el.dialog('destroy');
|
||||
}
|
||||
this._super();
|
||||
|
@ -294,7 +301,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
|||
start: function() {
|
||||
var self = this;
|
||||
$('.oe_secondary_menus_container,.oe_user_menu_placeholder').empty();
|
||||
var fetch_db = this.rpc("/web/database/get_list", {}).pipe(
|
||||
var fetch_db = this.rpc("/web/database/get_list", {}).then(
|
||||
function(result) {
|
||||
self.db_list = result.db_list;
|
||||
},
|
||||
|
@ -302,10 +309,10 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
|||
ev.preventDefault();
|
||||
self.db_list = null;
|
||||
});
|
||||
var fetch_langs = this.rpc("/web/session/get_lang_list", {}).then(function(result) {
|
||||
var fetch_langs = this.rpc("/web/session/get_lang_list", {}).done(function(result) {
|
||||
self.lang_list = result.lang_list;
|
||||
});
|
||||
return $.when(fetch_db, fetch_langs).then(self.do_render);
|
||||
return $.when(fetch_db, fetch_langs).done(self.do_render);
|
||||
},
|
||||
do_render: function() {
|
||||
var self = this;
|
||||
|
@ -394,7 +401,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
|||
do_create: function(form) {
|
||||
var self = this;
|
||||
var fields = $(form).serializeArray();
|
||||
self.rpc("/web/database/create", {'fields': fields}).then(function(result) {
|
||||
self.rpc("/web/database/create", {'fields': fields}).done(function(result) {
|
||||
var form_obj = self.to_object(fields);
|
||||
var client_action = {
|
||||
type: 'ir.actions.client',
|
||||
|
@ -420,7 +427,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
|||
if (!db || !confirm("Do you really want to delete the database: " + db + " ?")) {
|
||||
return;
|
||||
}
|
||||
self.rpc("/web/database/drop", {'fields': fields}).then(function(result) {
|
||||
self.rpc("/web/database/drop", {'fields': fields}).done(function(result) {
|
||||
if (result.error) {
|
||||
self.display_error(result);
|
||||
return;
|
||||
|
@ -483,7 +490,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
|
|||
var self = this;
|
||||
self.rpc("/web/database/change_password", {
|
||||
'fields': $(form).serializeArray()
|
||||
}).then(function(result) {
|
||||
}).done(function(result) {
|
||||
if (result.error) {
|
||||
self.display_error(result);
|
||||
return;
|
||||
|
@ -581,7 +588,7 @@ instance.web.Login = instance.web.Widget.extend({
|
|||
var self = this;
|
||||
self.hide_error();
|
||||
self.$(".oe_login_pane").fadeOut("slow");
|
||||
return this.session.session_authenticate(db, login, password).pipe(function() {
|
||||
return this.session.session_authenticate(db, login, password).then(function() {
|
||||
if (self.has_local_storage) {
|
||||
if(self.remember_credentials) {
|
||||
localStorage.setItem('last_db_login_success', db);
|
||||
|
@ -664,7 +671,7 @@ instance.web.ChangePassword = instance.web.Widget.extend({
|
|||
submitHandler: function (form) {
|
||||
self.rpc("/web/session/change_password",{
|
||||
'fields': $(form).serializeArray()
|
||||
}).then(function(result) {
|
||||
}).done(function(result) {
|
||||
if (result.error) {
|
||||
self.display_error(result);
|
||||
return;
|
||||
|
@ -703,7 +710,7 @@ instance.web.Menu = instance.web.Widget.extend({
|
|||
},
|
||||
do_reload: function() {
|
||||
var self = this;
|
||||
return this.rpc("/web/menu/load", {}).then(function(r) {
|
||||
return this.rpc("/web/menu/load", {}).done(function(r) {
|
||||
self.menu_loaded(r);
|
||||
});
|
||||
},
|
||||
|
@ -873,7 +880,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
|
|||
if (!self.session.uid)
|
||||
return;
|
||||
var func = new instance.web.Model("res.users").get_func("read");
|
||||
return func(self.session.uid, ["name", "company_id"]).pipe(function(res) {
|
||||
return func(self.session.uid, ["name", "company_id"]).then(function(res) {
|
||||
var topbar_name = res.name;
|
||||
if(instance.session.debug)
|
||||
topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.session.db);
|
||||
|
@ -884,7 +891,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
|
|||
$avatar.attr('src', avatar_src);
|
||||
});
|
||||
};
|
||||
this.update_promise = this.update_promise.pipe(fct, fct);
|
||||
this.update_promise = this.update_promise.then(fct, fct);
|
||||
},
|
||||
on_menu_logout: function() {
|
||||
this.trigger('user_logout');
|
||||
|
@ -900,7 +907,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
|
|||
},
|
||||
on_menu_about: function() {
|
||||
var self = this;
|
||||
self.rpc("/web/webclient/version_info", {}).then(function(res) {
|
||||
self.rpc("/web/webclient/version_info", {}).done(function(res) {
|
||||
var $help = $(QWeb.render("UserMenu.about", {version_info: res}));
|
||||
$help.find('a.oe_activate_debug_mode').click(function (e) {
|
||||
e.preventDefault();
|
||||
|
@ -920,7 +927,7 @@ instance.web.Client = instance.web.Widget.extend({
|
|||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
return instance.session.session_bind(this.origin).pipe(function() {
|
||||
return instance.session.session_bind(this.origin).then(function() {
|
||||
var $e = $(QWeb.render(self._template, {}));
|
||||
self.replaceElement($e);
|
||||
self.bind_events();
|
||||
|
@ -987,7 +994,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
return $.when(this._super()).pipe(function() {
|
||||
return $.when(this._super()).then(function() {
|
||||
self.$el.on('click', '.oe_logo', function() {
|
||||
self.action_manager.do_action('home');
|
||||
});
|
||||
|
@ -1056,8 +1063,8 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
},
|
||||
do_reload: function() {
|
||||
var self = this;
|
||||
return this.session.session_reload().pipe(function () {
|
||||
instance.session.load_modules(true).pipe(
|
||||
return this.session.session_reload().then(function () {
|
||||
instance.session.load_modules(true).then(
|
||||
self.menu.proxy('do_reload')); });
|
||||
|
||||
},
|
||||
|
@ -1072,7 +1079,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
on_logout: function() {
|
||||
var self = this;
|
||||
if (!this.has_uncommitted_changes()) {
|
||||
this.session.session_logout().then(function () {
|
||||
this.session.session_logout().done(function () {
|
||||
$(window).unbind('hashchange', self.on_hashchange);
|
||||
self.do_push_state({});
|
||||
window.location.reload();
|
||||
|
@ -1085,7 +1092,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
|
||||
var state = $.bbq.getState(true);
|
||||
if (_.isEmpty(state) || state.action == "login") {
|
||||
self.menu.has_been_loaded.then(function() {
|
||||
self.menu.has_been_loaded.done(function() {
|
||||
var first_menu_id = self.menu.$el.find("a:first").data("menu");
|
||||
if(first_menu_id) {
|
||||
self.menu.menu_click(first_menu_id);
|
||||
|
@ -1100,8 +1107,8 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
var state = event.getState(true);
|
||||
if (!_.isEqual(this._current_state, state)) {
|
||||
if(state.action_id === undefined && state.menu_id) {
|
||||
self.menu.has_been_loaded.then(function() {
|
||||
self.menu.do_reload().then(function() {
|
||||
self.menu.has_been_loaded.done(function() {
|
||||
self.menu.do_reload().done(function() {
|
||||
self.menu.menu_click(state.menu_id)
|
||||
});
|
||||
});
|
||||
|
@ -1118,11 +1125,12 @@ instance.web.WebClient = instance.web.Client.extend({
|
|||
var url = '#' + $.param(state);
|
||||
this._current_state = _.clone(state);
|
||||
$.bbq.pushState(url);
|
||||
this.trigger('state_pushed', state);
|
||||
},
|
||||
on_menu_action: function(options) {
|
||||
var self = this;
|
||||
return this.rpc("/web/action/load", { action_id: options.action_id })
|
||||
.pipe(function (result) {
|
||||
.then(function (result) {
|
||||
var action = result;
|
||||
if (options.needaction) {
|
||||
action.context.search_default_message_unread = true;
|
||||
|
@ -1168,9 +1176,9 @@ instance.web.EmbeddedClient = instance.web.Client.extend({
|
|||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
return $.when(this._super()).pipe(function() {
|
||||
return instance.session.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() {
|
||||
return self.rpc("/web/action/load", { action_id: self.action_id }).then(function(result) {
|
||||
return $.when(this._super()).then(function() {
|
||||
return instance.session.session_authenticate(self.dbname, self.login, self.key, true).then(function() {
|
||||
return self.rpc("/web/action/load", { action_id: self.action_id }).done(function(result) {
|
||||
var action = result;
|
||||
action.flags = _.extend({
|
||||
//views_switcher : false,
|
||||
|
|
|
@ -809,12 +809,12 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, {
|
|||
return false;
|
||||
},
|
||||
rpc: function(url, data, success, error) {
|
||||
var def = $.Deferred().then(success, error);
|
||||
var def = $.Deferred().done(success).fail(error);
|
||||
var self = this;
|
||||
instance.session.rpc(url, data).then(function() {
|
||||
instance.session.rpc(url, data).done(function() {
|
||||
if (!self.isDestroyed())
|
||||
def.resolve.apply(def, arguments);
|
||||
}, function() {
|
||||
}).fail(function() {
|
||||
if (!self.isDestroyed())
|
||||
def.reject.apply(def, arguments);
|
||||
});
|
||||
|
@ -1287,7 +1287,7 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({
|
|||
};
|
||||
var deferred = $.Deferred();
|
||||
this.trigger('request', url, payload);
|
||||
var request = this.rpc_function(url, payload).then(
|
||||
var request = this.rpc_function(url, payload).done(
|
||||
function (response, textStatus, jqXHR) {
|
||||
self.trigger('response', response);
|
||||
if (!response.error) {
|
||||
|
@ -1300,7 +1300,8 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({
|
|||
} else {
|
||||
deferred.reject(response.error, $.Event());
|
||||
}
|
||||
},
|
||||
}
|
||||
).fail(
|
||||
function(jqXHR, textStatus, errorThrown) {
|
||||
self.trigger('response_failed', jqXHR);
|
||||
var error = {
|
||||
|
@ -1387,10 +1388,11 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({
|
|||
$iframe.unbind('load').bind('load', function() {
|
||||
$.ajax(ajax).always(function() {
|
||||
cleanUp();
|
||||
}).then(
|
||||
function() { deferred.resolve.apply(deferred, arguments); },
|
||||
function() { deferred.reject.apply(deferred, arguments); }
|
||||
);
|
||||
}).done(function() {
|
||||
deferred.resolve.apply(deferred, arguments);
|
||||
}).fail(function() {
|
||||
deferred.reject.apply(deferred, arguments);
|
||||
});
|
||||
});
|
||||
// now that the iframe can receive data, we fill and submit the form
|
||||
$form.submit();
|
||||
|
|
|
@ -51,15 +51,15 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
|
|||
var self = this;
|
||||
// TODO: session store in cookie should be optional
|
||||
this.session_id = this.get_cookie('session_id');
|
||||
return this.session_reload().pipe(function(result) {
|
||||
return this.session_reload().then(function(result) {
|
||||
var modules = instance._modules.join(',');
|
||||
var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).pipe(self.do_load_qweb);
|
||||
var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).then(self.do_load_qweb);
|
||||
if(self.session_is_valid()) {
|
||||
return deferred.pipe(function() { return self.load_modules(); });
|
||||
return deferred.then(function() { return self.load_modules(); });
|
||||
}
|
||||
return $.when(
|
||||
deferred,
|
||||
self.rpc('/web/webclient/bootstrap_translations', {mods: instance._modules}).pipe(function(trans) {
|
||||
self.rpc('/web/webclient/bootstrap_translations', {mods: instance._modules}).then(function(trans) {
|
||||
instance.web._t.database.set_bundle(trans);
|
||||
})
|
||||
);
|
||||
|
@ -73,7 +73,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
|
|||
*/
|
||||
session_reload: function () {
|
||||
var self = this;
|
||||
return this.rpc("/web/session/get_session_info", {}).then(function(result) {
|
||||
return this.rpc("/web/session/get_session_info", {}).done(function(result) {
|
||||
// If immediately follows a login (triggered by trying to restore
|
||||
// an invalid session or no session at all), refresh session data
|
||||
// (should not change, but just in case...)
|
||||
|
@ -96,7 +96,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
|
|||
var self = this;
|
||||
var base_location = document.location.protocol + '//' + document.location.host;
|
||||
var params = { db: db, login: login, password: password, base_location: base_location };
|
||||
return this.rpc("/web/session/authenticate", params).pipe(function(result) {
|
||||
return this.rpc("/web/session/authenticate", params).then(function(result) {
|
||||
if (!result.uid) {
|
||||
return $.Deferred().reject();
|
||||
}
|
||||
|
@ -154,30 +154,30 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
|
|||
*/
|
||||
load_modules: function() {
|
||||
var self = this;
|
||||
return this.rpc('/web/session/modules', {}).pipe(function(result) {
|
||||
return this.rpc('/web/session/modules', {}).then(function(result) {
|
||||
var lang = self.user_context.lang,
|
||||
all_modules = _.uniq(self.module_list.concat(result));
|
||||
var params = { mods: all_modules, lang: lang};
|
||||
var to_load = _.difference(result, self.module_list).join(',');
|
||||
self.module_list = all_modules;
|
||||
|
||||
var loaded = self.rpc('/web/webclient/translations', params).then(function(trans) {
|
||||
var loaded = self.rpc('/web/webclient/translations', params).done(function(trans) {
|
||||
instance.web._t.database.set_bundle(trans);
|
||||
});
|
||||
var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"];
|
||||
if(to_load.length) {
|
||||
loaded = $.when(
|
||||
loaded,
|
||||
self.rpc('/web/webclient/csslist', {mods: to_load}).then(self.do_load_css),
|
||||
self.rpc('/web/webclient/qweblist', {mods: to_load}).pipe(self.do_load_qweb),
|
||||
self.rpc('/web/webclient/jslist', {mods: to_load}).then(function(files) {
|
||||
self.rpc('/web/webclient/csslist', {mods: to_load}).done(self.do_load_css),
|
||||
self.rpc('/web/webclient/qweblist', {mods: to_load}).then(self.do_load_qweb),
|
||||
self.rpc('/web/webclient/jslist', {mods: to_load}).done(function(files) {
|
||||
file_list = file_list.concat(files);
|
||||
})
|
||||
);
|
||||
}
|
||||
return loaded.pipe(function () {
|
||||
return loaded.then(function () {
|
||||
return self.do_load_js(file_list);
|
||||
}).then(function() {
|
||||
}).done(function() {
|
||||
self.on_modules_loaded();
|
||||
self.trigger('module_loaded');
|
||||
if (!Date.CultureInfo.pmDesignator) {
|
||||
|
@ -212,7 +212,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
|
|||
if ( (tag.readyState && tag.readyState != "loaded" && tag.readyState != "complete") || tag.onload_done )
|
||||
return;
|
||||
tag.onload_done = true;
|
||||
self.do_load_js(files).then(function () {
|
||||
self.do_load_js(files).done(function () {
|
||||
d.resolve();
|
||||
});
|
||||
};
|
||||
|
@ -227,7 +227,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
|
|||
var self = this;
|
||||
_.each(files, function(file) {
|
||||
self.qweb_mutex.exec(function() {
|
||||
return self.rpc('/web/proxy/load', {path: file}).pipe(function(xml) {
|
||||
return self.rpc('/web/proxy/load', {path: file}).then(function(xml) {
|
||||
if (!xml) { return; }
|
||||
instance.web.qweb.add_template(_.str.trim(xml));
|
||||
});
|
||||
|
@ -462,7 +462,7 @@ $.Mutex = (function() {
|
|||
Mutex.prototype.exec = function(action) {
|
||||
var current = this.def;
|
||||
var next = this.def = $.Deferred();
|
||||
return current.pipe(function() {
|
||||
return current.then(function() {
|
||||
return $.when(action()).always(function() {
|
||||
next.resolve();
|
||||
});
|
||||
|
@ -474,7 +474,7 @@ $.Mutex = (function() {
|
|||
$.async_when = function() {
|
||||
var async = false;
|
||||
var def = $.Deferred();
|
||||
$.when.apply($, arguments).then(function() {
|
||||
$.when.apply($, arguments).done(function() {
|
||||
var args = arguments;
|
||||
var action = function() {
|
||||
def.resolve.apply(def, args);
|
||||
|
@ -483,7 +483,7 @@ $.async_when = function() {
|
|||
action();
|
||||
else
|
||||
setTimeout(action, 0);
|
||||
}, function() {
|
||||
}).fail(function() {
|
||||
var args = arguments;
|
||||
var action = function() {
|
||||
def.reject.apply(def, args);
|
||||
|
|
|
@ -66,7 +66,7 @@ instance.web.Query = instance.web.Class.extend({
|
|||
offset: this._offset,
|
||||
limit: this._limit,
|
||||
sort: instance.web.serialize_sort(this._order_by)
|
||||
}).pipe(function (results) {
|
||||
}).then(function (results) {
|
||||
self._count = results.length;
|
||||
return results.records;
|
||||
}, null);
|
||||
|
@ -78,7 +78,7 @@ instance.web.Query = instance.web.Class.extend({
|
|||
*/
|
||||
first: function () {
|
||||
var self = this;
|
||||
return this.clone({limit: 1})._execute().pipe(function (records) {
|
||||
return this.clone({limit: 1})._execute().then(function (records) {
|
||||
delete self._count;
|
||||
if (records.length) { return records[0]; }
|
||||
return null;
|
||||
|
@ -132,7 +132,7 @@ instance.web.Query = instance.web.Class.extend({
|
|||
offset: this._offset,
|
||||
limit: this._limit,
|
||||
orderby: instance.web.serialize_sort(this._order_by) || false
|
||||
}).pipe(function (results) {
|
||||
}).then(function (results) {
|
||||
return _(results).map(function (result) {
|
||||
// FIX: querygroup initialization
|
||||
result.__context = result.__context || {};
|
||||
|
@ -443,7 +443,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
|
|||
return this._model.query(fields)
|
||||
.limit(options.limit || false)
|
||||
.offset(options.offset || 0)
|
||||
.all().then(function (records) {
|
||||
.all().done(function (records) {
|
||||
self.ids = _(records).pluck('id');
|
||||
});
|
||||
},
|
||||
|
@ -456,7 +456,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
|
|||
*/
|
||||
read_index: function (fields, options) {
|
||||
options = options || {};
|
||||
return this.read_ids([this.ids[this.index]], fields, options).pipe(function (records) {
|
||||
return this.read_ids([this.ids[this.index]], fields, options).then(function (records) {
|
||||
if (_.isEmpty(records)) { return $.Deferred().reject().promise(); }
|
||||
return records[0];
|
||||
});
|
||||
|
@ -493,7 +493,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
|
|||
*/
|
||||
write: function (id, data, options) {
|
||||
options = options || {};
|
||||
return this._model.call('write', [[id], data], {context: this.get_context(options.context)}).then(this.trigger('dataset_changed', id, data, options));
|
||||
return this._model.call('write', [[id], data], {context: this.get_context(options.context)}).done(this.trigger('dataset_changed', id, data, options));
|
||||
},
|
||||
/**
|
||||
* Deletes an existing record from the database
|
||||
|
@ -501,7 +501,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
|
|||
* @param {Number|String} ids identifier of the record to delete
|
||||
*/
|
||||
unlink: function(ids) {
|
||||
return this._model.call('unlink', [ids], {context: this.get_context()}).then(this.trigger('dataset_changed', ids));
|
||||
return this._model.call('unlink', [ids], {context: this.get_context()}).done(this.trigger('dataset_changed', ids));
|
||||
},
|
||||
/**
|
||||
* Calls an arbitrary RPC method
|
||||
|
@ -607,7 +607,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
|
|||
model: this.model,
|
||||
ids: ids,
|
||||
context: this.get_context(options.context),
|
||||
}).pipe(function (results) {
|
||||
}).then(function (results) {
|
||||
return results;
|
||||
});
|
||||
},
|
||||
|
@ -682,9 +682,9 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({
|
|||
.limit(options.limit || false);
|
||||
q = q.order_by.apply(q, this._sort);
|
||||
|
||||
return q.all().then(function (records) {
|
||||
return q.all().done(function (records) {
|
||||
// FIXME: not sure about that one, *could* have discarded count
|
||||
q.count().then(function (count) { self._length = count; });
|
||||
q.count().done(function (count) { self._length = count; });
|
||||
self.ids = _(records).pluck('id');
|
||||
});
|
||||
},
|
||||
|
@ -693,7 +693,7 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({
|
|||
},
|
||||
unlink: function(ids, callback, error_callback) {
|
||||
var self = this;
|
||||
return this._super(ids).then(function(result) {
|
||||
return this._super(ids).done(function(result) {
|
||||
self.ids = _(self.ids).difference(ids);
|
||||
if (self._length) {
|
||||
self._length -= 1;
|
||||
|
@ -722,7 +722,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
|
|||
this.last_default_get = {};
|
||||
},
|
||||
default_get: function(fields, options) {
|
||||
return this._super(fields, options).then(this.on_default_get);
|
||||
return this._super(fields, options).done(this.on_default_get);
|
||||
},
|
||||
on_default_get: function(res) {
|
||||
this.last_default_get = res;
|
||||
|
@ -774,7 +774,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
|
|||
this.cache = _.reject(this.cache, function(x) { return _.include(ids, x.id);});
|
||||
this.set_ids(_.without.apply(_, [this.ids].concat(ids)));
|
||||
this.trigger("dataset_changed", ids, callback, error_callback);
|
||||
return $.async_when({result: true}).then(callback);
|
||||
return $.async_when({result: true}).done(callback);
|
||||
},
|
||||
reset_ids: function(ids) {
|
||||
this.set_ids(ids);
|
||||
|
@ -836,7 +836,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
|
|||
completion.resolve(records);
|
||||
};
|
||||
if(to_get.length > 0) {
|
||||
var rpc_promise = this._super(to_get, fields, options).then(function(records) {
|
||||
var rpc_promise = this._super(to_get, fields, options).done(function(records) {
|
||||
_.each(records, function(record, index) {
|
||||
var id = to_get[index];
|
||||
var cached = _.detect(self.cache, function(x) {return x.id === id;});
|
||||
|
@ -991,14 +991,14 @@ instance.web.DropMisordered = instance.web.Class.extend({
|
|||
var res = $.Deferred();
|
||||
|
||||
var self = this, seq = this.lsn++;
|
||||
deferred.then(function () {
|
||||
deferred.done(function () {
|
||||
if (seq > self.rsn) {
|
||||
self.rsn = seq;
|
||||
res.resolve.apply(res, arguments);
|
||||
} else if (self.failMisordered) {
|
||||
res.reject();
|
||||
}
|
||||
}, function () {
|
||||
}).fail(function () {
|
||||
res.reject.apply(res, arguments);
|
||||
});
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
|
|||
self.rpc("/web/export/get_fields", {
|
||||
model: self.dataset.model,
|
||||
import_compat: Boolean(import_comp)
|
||||
}).then(function (records) {
|
||||
}).done(function (records) {
|
||||
got_fields.resolve();
|
||||
self.on_show_data(records);
|
||||
});
|
||||
|
@ -59,7 +59,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
|
|||
|
||||
return $.when(
|
||||
got_fields,
|
||||
this.rpc('/web/export/formats', {}).then(this.do_setup_export_formats),
|
||||
this.rpc('/web/export/formats', {}).done(this.do_setup_export_formats),
|
||||
this.show_exports_list());
|
||||
},
|
||||
do_setup_export_formats: function (formats) {
|
||||
|
@ -84,7 +84,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
|
|||
}
|
||||
return this.exports.read_slice(['name'], {
|
||||
domain: [['resource', '=', this.dataset.model]]
|
||||
}).then(function (export_list) {
|
||||
}).done(function (export_list) {
|
||||
if (!export_list.length) {
|
||||
return;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
|
|||
self.$el.find('#fields_list option').remove();
|
||||
var export_id = self.$el.find('#saved_export_list option:selected').val();
|
||||
if (export_id) {
|
||||
self.rpc('/web/export/namelist', {'model': self.dataset.model, export_id: parseInt(export_id)}).then(self.do_load_export_field);
|
||||
self.rpc('/web/export/namelist', {'model': self.dataset.model, export_id: parseInt(export_id)}).done(self.do_load_export_field);
|
||||
}
|
||||
});
|
||||
self.$el.find('#delete_export_list').click(function() {
|
||||
|
@ -183,7 +183,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
|
|||
import_compat: Boolean(import_comp),
|
||||
parent_field_type : record['field_type'],
|
||||
exclude: exclude_fields
|
||||
}).then(function(results) {
|
||||
}).done(function(results) {
|
||||
record.loaded = true;
|
||||
self.on_show_data(results, record.id);
|
||||
});
|
||||
|
|
|
@ -236,7 +236,7 @@ my.FacetView = instance.web.Widget.extend({
|
|||
start: function () {
|
||||
var self = this;
|
||||
var $e = this.$('> span:last-child');
|
||||
return $.when(this._super()).pipe(function () {
|
||||
return $.when(this._super()).then(function () {
|
||||
return $.when.apply(null, self.model.values.map(function (value) {
|
||||
return new my.FacetValueView(self, value).appendTo($e);
|
||||
}));
|
||||
|
@ -271,15 +271,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
|||
this.$('.oe_searchview_input:last').focus();
|
||||
}
|
||||
},
|
||||
// when the completion list opens/refreshes, automatically select the
|
||||
// first completion item so if the user just hits [RETURN] or [TAB] it
|
||||
// automatically selects it
|
||||
'autocompleteopen': function () {
|
||||
var menu = this.$el.data('autocomplete').menu;
|
||||
menu.activate(
|
||||
$.Event({ type: "mouseenter" }),
|
||||
menu.element.children().first());
|
||||
},
|
||||
// search button
|
||||
'click button.oe_searchview_search': function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
|
@ -356,7 +347,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
|||
context: this.dataset.get_context() });
|
||||
|
||||
$.when(load_view)
|
||||
.pipe(function(r) {
|
||||
.then(function(r) {
|
||||
self.search_view_loaded(r)
|
||||
}).fail(function () {
|
||||
self.ready.reject.apply(null, arguments);
|
||||
|
@ -417,58 +408,46 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
|||
setup_global_completion: function () {
|
||||
var self = this;
|
||||
|
||||
// autocomplete only correctly handles being initialized on the actual
|
||||
// editable element (and only an element with a @value in 1.8 e.g.
|
||||
// input or textarea), cheat by setting val() on $el
|
||||
this.$el.on('keydown', function () {
|
||||
// keydown is triggered *before* the element's value is set, so
|
||||
// delay this. Pray that setTimeout are executed in FIFO (if they
|
||||
// have the same delay) as autocomplete uses the exact same trick.
|
||||
// FIXME: brittle as fuck
|
||||
setTimeout(function () {
|
||||
self.$el.val(self.currentInputValue());
|
||||
}, 0);
|
||||
|
||||
});
|
||||
|
||||
this.$el.autocomplete({
|
||||
var autocomplete = this.$el.autocomplete({
|
||||
source: this.proxy('complete_global_search'),
|
||||
select: this.proxy('select_completion'),
|
||||
focus: function (e) { e.preventDefault(); },
|
||||
html: true,
|
||||
autoFocus: true,
|
||||
minLength: 1,
|
||||
delay: 0
|
||||
}).data('autocomplete')._renderItem = function (ul, item) {
|
||||
// item of completion list
|
||||
var $item = $( "<li></li>" )
|
||||
.data( "item.autocomplete", item )
|
||||
.appendTo( ul );
|
||||
}).data('autocomplete');
|
||||
|
||||
if (item.facet !== undefined) {
|
||||
// regular completion item
|
||||
return $item.append(
|
||||
(item.label)
|
||||
? $('<a>').html(item.label)
|
||||
: $('<a>').text(item.value));
|
||||
}
|
||||
return $item.text(item.label)
|
||||
.css({
|
||||
borderTop: '1px solid #cccccc',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
zoom: 1,
|
||||
'float': 'left',
|
||||
clear: 'left',
|
||||
width: '100%'
|
||||
});
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Gets value out of the currently focused "input" (a
|
||||
* div[contenteditable].oe_searchview_input)
|
||||
*/
|
||||
currentInputValue: function () {
|
||||
return this.$('div.oe_searchview_input:focus').text();
|
||||
// MonkeyPatch autocomplete instance
|
||||
_.extend(autocomplete, {
|
||||
_renderItem: function (ul, item) {
|
||||
// item of completion list
|
||||
var $item = $( "<li></li>" )
|
||||
.data( "item.autocomplete", item )
|
||||
.appendTo( ul );
|
||||
|
||||
if (item.facet !== undefined) {
|
||||
// regular completion item
|
||||
return $item.append(
|
||||
(item.label)
|
||||
? $('<a>').html(item.label)
|
||||
: $('<a>').text(item.value));
|
||||
}
|
||||
return $item.text(item.label)
|
||||
.css({
|
||||
borderTop: '1px solid #cccccc',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
zoom: 1,
|
||||
'float': 'left',
|
||||
clear: 'left',
|
||||
width: '100%'
|
||||
});
|
||||
},
|
||||
_value: function() {
|
||||
return self.$('div.oe_searchview_input').text();
|
||||
},
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Provide auto-completion result for req.term (an array to `resp`)
|
||||
|
@ -480,7 +459,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
|||
complete_global_search: function (req, resp) {
|
||||
$.when.apply(null, _(this.inputs).chain()
|
||||
.invoke('complete', req.term)
|
||||
.value()).then(function () {
|
||||
.value()).done(function () {
|
||||
resp(_(_(arguments).compact()).flatten(true));
|
||||
});
|
||||
},
|
||||
|
@ -548,7 +527,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
|||
childView.on('blurred', self, self.proxy('childBlurred'));
|
||||
});
|
||||
|
||||
$.when.apply(null, started).then(function () {
|
||||
$.when.apply(null, started).done(function () {
|
||||
var input_to_focus;
|
||||
// options.at: facet inserted at given index, focus next input
|
||||
// otherwise just focus last input
|
||||
|
@ -656,12 +635,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
|
|||
|
||||
// load defaults
|
||||
var defaults_fetched = $.when.apply(null, _(this.inputs).invoke(
|
||||
'facet_for_defaults', this.defaults)).then(function () {
|
||||
'facet_for_defaults', this.defaults)).done(function () {
|
||||
self.query.reset(_(arguments).compact(), {preventSearch: true});
|
||||
});
|
||||
|
||||
return $.when(drawer_started, defaults_fetched)
|
||||
.then(function () {
|
||||
.done(function () {
|
||||
self.trigger("search_view_loaded", data);
|
||||
self.ready.resolve();
|
||||
});
|
||||
|
@ -1430,7 +1409,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({
|
|||
name: needle,
|
||||
limit: 8,
|
||||
context: {}
|
||||
}).pipe(function (results) {
|
||||
}).then(function (results) {
|
||||
if (_.isEmpty(results)) { return null; }
|
||||
return [{label: self.attrs.string}].concat(
|
||||
_(results).map(function (result) {
|
||||
|
@ -1453,7 +1432,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({
|
|||
// to handle this as if it were a single value.
|
||||
value = value[0];
|
||||
}
|
||||
return this.model.call('name_get', [value]).pipe(function (names) {
|
||||
return this.model.call('name_get', [value]).then(function (names) {
|
||||
if (_(names).isEmpty()) { return null; }
|
||||
return facet_from(self, names[0]);
|
||||
})
|
||||
|
@ -1500,7 +1479,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
|
|||
// FIXME: local eval of domain and context to get rid of special endpoint
|
||||
return this.rpc('/web/searchview/get_filters', {
|
||||
model: this.view.model
|
||||
}).pipe(this.proxy('set_filters'));
|
||||
}).then(this.proxy('set_filters'));
|
||||
},
|
||||
clear_selection: function () {
|
||||
this.$('li.oe_selected').removeClass('oe_selected');
|
||||
|
@ -1523,7 +1502,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
|
|||
$('<a class="oe_searchview_custom_delete">x</a>')
|
||||
.click(function (e) {
|
||||
e.stopPropagation();
|
||||
self.model.call('unlink', [id]).then(function () {
|
||||
self.model.call('unlink', [id]).done(function () {
|
||||
$filter.remove();
|
||||
});
|
||||
})
|
||||
|
@ -1558,7 +1537,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
|
|||
domains: search.domains,
|
||||
contexts: search.contexts,
|
||||
group_by_seq: search.groupbys || []
|
||||
}).then(function (results) {
|
||||
}).done(function (results) {
|
||||
if (!_.isEmpty(results.group_by)) {
|
||||
results.context.group_by = results.group_by;
|
||||
}
|
||||
|
@ -1570,7 +1549,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
|
|||
domain: results.domain
|
||||
};
|
||||
// FIXME: current context?
|
||||
return self.model.call('create_or_replace', [filter]).then(function (id) {
|
||||
return self.model.call('create_or_replace', [filter]).done(function (id) {
|
||||
filter.id = id;
|
||||
self.append_filter(filter);
|
||||
self.$el
|
||||
|
@ -1647,18 +1626,18 @@ instance.web.search.Advanced = instance.web.search.Input.extend({
|
|||
});
|
||||
return $.when(
|
||||
this._super(),
|
||||
this.rpc("/web/searchview/fields_get", {model: this.view.model}).then(function(data) {
|
||||
this.rpc("/web/searchview/fields_get", {model: this.view.model}).done(function(data) {
|
||||
self.fields = _.extend({
|
||||
id: { string: 'ID', type: 'id' }
|
||||
}, data.fields);
|
||||
})).then(function () {
|
||||
})).done(function () {
|
||||
self.append_proposition();
|
||||
});
|
||||
},
|
||||
append_proposition: function () {
|
||||
var self = this;
|
||||
return (new instance.web.search.ExtendedSearchProposition(this, this.fields))
|
||||
.appendTo(this.$('ul')).then(function () {
|
||||
.appendTo(this.$('ul')).done(function () {
|
||||
self.$('button.oe_apply').prop('disabled', false);
|
||||
});
|
||||
},
|
||||
|
@ -1723,7 +1702,7 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @
|
|||
this.value = null;
|
||||
},
|
||||
start: function () {
|
||||
return this._super().then(this.proxy('changed'));
|
||||
return this._super().done(this.proxy('changed'));
|
||||
},
|
||||
changed: function() {
|
||||
var nval = this.$(".searchview_extended_prop_field").val();
|
||||
|
|
|
@ -32,20 +32,20 @@ openerp.test_support = {
|
|||
window.openerp.web[tested_core](oe);
|
||||
var done = openerp.test_support.setup_session(oe.session);
|
||||
if (nonliterals) {
|
||||
done = done.pipe(function () {
|
||||
done = done.then(function () {
|
||||
return oe.session.rpc('/tests/add_nonliterals', {
|
||||
domains: nonliterals.domains || [],
|
||||
contexts: nonliterals.contexts || []
|
||||
}).then(function (r) {
|
||||
}).done(function (r) {
|
||||
oe.domains = r.domains;
|
||||
oe.contexts = r.contexts;
|
||||
});
|
||||
});
|
||||
}
|
||||
done.always(QUnit.start)
|
||||
.then(function () {
|
||||
.done(function () {
|
||||
conf.openerp = oe;
|
||||
}, function (e) {
|
||||
}).fail(function (e) {
|
||||
QUnit.test(title, function () {
|
||||
console.error(e);
|
||||
QUnit.ok(false, 'Could not obtain a session:' + e.debug);
|
||||
|
|
|
@ -121,7 +121,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
this.__blur_timeout = null;
|
||||
this.rendering_engine = new instance.web.form.FormRenderingEngine(this);
|
||||
self.set({actual_mode: self.options.initial_mode});
|
||||
this.has_been_loaded.then(function() {
|
||||
this.has_been_loaded.done(function() {
|
||||
self.on("change:actual_mode", self, self.check_actual_mode);
|
||||
self.check_actual_mode();
|
||||
self.on("change:actual_mode", self, self.init_pager);
|
||||
|
@ -201,7 +201,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
this.$el.find(".oe_form_group_row,.oe_form_field,label").on('click', function (e) {
|
||||
if(self.get("actual_mode") == "view") {
|
||||
var $button = self.options.$buttons.find(".oe_form_button_edit");
|
||||
$button.effect('bounce', {distance: 18, times: 5}, 150);
|
||||
$button.css('box-sizing', 'content-box').effect('bounce', {distance: 18, times: 5}, 150);
|
||||
e.stopPropagation();
|
||||
instance.web.bus.trigger('click', e);
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
|
||||
var shown = this.has_been_loaded;
|
||||
if (options.reload !== false) {
|
||||
shown = shown.pipe(function() {
|
||||
shown = shown.then(function() {
|
||||
if (self.dataset.index === null) {
|
||||
// null index means we should start a new record
|
||||
return self.on_button_new();
|
||||
|
@ -284,12 +284,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
fields.push('display_name');
|
||||
return self.dataset.read_index(fields, {
|
||||
context: { 'bin_size': true, 'future_display_name' : true }
|
||||
}).pipe(function(r) {
|
||||
}).then(function(r) {
|
||||
self.trigger('load_record', r);
|
||||
});
|
||||
});
|
||||
}
|
||||
return shown.pipe(function() {
|
||||
return shown.then(function() {
|
||||
self._actualize_mode(options.mode || self.options.initial_mode);
|
||||
self.$el.css({
|
||||
opacity: '1',
|
||||
|
@ -327,7 +327,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
field._inhibit_on_change_flag = false;
|
||||
set_values.push(result);
|
||||
});
|
||||
return $.when.apply(null, set_values).pipe(function() {
|
||||
return $.when.apply(null, set_values).then(function() {
|
||||
if (!record.id) {
|
||||
// New record: Second pass in order to trigger the onchanges
|
||||
// respecting the fields order defined in the view
|
||||
|
@ -365,7 +365,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
var self = this;
|
||||
var keys = _.keys(this.fields_view.fields);
|
||||
if (keys.length) {
|
||||
return this.dataset.default_get(keys).pipe(function(r) {
|
||||
return this.dataset.default_get(keys).then(function(r) {
|
||||
self.trigger('load_record', r);
|
||||
});
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
} else {
|
||||
def = $.when({});
|
||||
}
|
||||
return def.pipe(function(response) {
|
||||
return def.then(function(response) {
|
||||
if (widget.field['change_default']) {
|
||||
var fieldname = widget.name
|
||||
var value_;
|
||||
|
@ -534,7 +534,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
model: 'ir.values',
|
||||
method: 'get_defaults',
|
||||
args: [self.model, condition]
|
||||
}).pipe(function (results) {
|
||||
}).then(function (results) {
|
||||
if (!results.length) {
|
||||
return response;
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
}
|
||||
}
|
||||
return response;
|
||||
}).pipe(function(response) {
|
||||
}).then(function(response) {
|
||||
return self.on_processed_onchange(response, processed);
|
||||
});
|
||||
} catch(e) {
|
||||
|
@ -600,7 +600,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
function iterate() {
|
||||
var on_change_obj = self.on_change_list.shift();
|
||||
if (on_change_obj) {
|
||||
return self._process_onchange(on_change_obj).pipe(function() {
|
||||
return self._process_onchange(on_change_obj).then(function() {
|
||||
return iterate();
|
||||
});
|
||||
}
|
||||
|
@ -609,13 +609,13 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
defs.push(field.commit_value());
|
||||
});
|
||||
var args = _.toArray(arguments);
|
||||
return $.when.apply($, defs).pipe(function() {
|
||||
return $.when.apply($, defs).then(function() {
|
||||
if (self.on_change_list.length !== 0) {
|
||||
return iterate();
|
||||
}
|
||||
var save_obj = self.save_list.pop();
|
||||
if (save_obj) {
|
||||
return self._process_save(save_obj).pipe(function() {
|
||||
return self._process_save(save_obj).then(function() {
|
||||
save_obj.ret = _.toArray(arguments);
|
||||
return iterate();
|
||||
});
|
||||
|
@ -719,7 +719,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
},
|
||||
on_button_save: function() {
|
||||
var self = this;
|
||||
return this.save().then(function(result) {
|
||||
return this.save().done(function(result) {
|
||||
self.trigger("save", result);
|
||||
self.to_view_mode();
|
||||
});
|
||||
|
@ -739,7 +739,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
on_button_new: function() {
|
||||
var self = this;
|
||||
this.to_edit_mode();
|
||||
return $.when(this.has_been_loaded).pipe(function() {
|
||||
return $.when(this.has_been_loaded).then(function() {
|
||||
if (self.can_be_discarded()) {
|
||||
return self.load_defaults();
|
||||
}
|
||||
|
@ -754,29 +754,24 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
},
|
||||
on_button_duplicate: function() {
|
||||
var self = this;
|
||||
var def = $.Deferred();
|
||||
$.when(this.has_been_loaded).then(function() {
|
||||
self.dataset.call('copy', [self.datarecord.id, {}, self.dataset.context]).then(function(new_id) {
|
||||
return self.record_created(new_id);
|
||||
}).then(function() {
|
||||
return self.to_edit_mode();
|
||||
}).then(function() {
|
||||
def.resolve();
|
||||
return this.has_been_loaded.then(function() {
|
||||
return self.dataset.call('copy', [self.datarecord.id, {}, self.dataset.context]).then(function(new_id) {
|
||||
self.record_created(new_id);
|
||||
self.to_edit_mode();
|
||||
});
|
||||
});
|
||||
return def.promise();
|
||||
},
|
||||
on_button_delete: function() {
|
||||
var self = this;
|
||||
var def = $.Deferred();
|
||||
$.when(this.has_been_loaded).then(function() {
|
||||
this.has_been_loaded.done(function() {
|
||||
if (self.datarecord.id && confirm(_t("Do you really want to delete this record?"))) {
|
||||
self.dataset.unlink([self.datarecord.id]).then(function() {
|
||||
self.dataset.unlink([self.datarecord.id]).done(function() {
|
||||
self.execute_pager_action('next');
|
||||
def.resolve();
|
||||
});
|
||||
} else {
|
||||
$.async_when().then(function () {
|
||||
$.async_when().done(function () {
|
||||
def.reject();
|
||||
})
|
||||
}
|
||||
|
@ -805,7 +800,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
var self = this;
|
||||
var save_obj = {prepend_on_create: prepend_on_create, ret: null};
|
||||
this.save_list.push(save_obj);
|
||||
return this._process_operations().pipe(function() {
|
||||
return this._process_operations().then(function() {
|
||||
return $.when.apply($, save_obj.ret);
|
||||
});
|
||||
},
|
||||
|
@ -841,7 +836,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
var save_deferral;
|
||||
if (!self.datarecord.id) {
|
||||
// Creation save
|
||||
save_deferral = self.dataset.create(values).pipe(function(r) {
|
||||
save_deferral = self.dataset.create(values).then(function(r) {
|
||||
return self.record_created(r, prepend_on_create);
|
||||
}, null);
|
||||
} else if (_.isEmpty(values) && ! self.force_dirty) {
|
||||
|
@ -850,7 +845,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
} else {
|
||||
self.force_dirty = false;
|
||||
// Write save
|
||||
save_deferral = self.dataset.write(self.datarecord.id, values, {}).pipe(function(r) {
|
||||
save_deferral = self.dataset.write(self.datarecord.id, values, {}).then(function(r) {
|
||||
return self.record_saved(r);
|
||||
}, null);
|
||||
}
|
||||
|
@ -884,7 +879,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
this.trigger('record_saved', r);
|
||||
return $.Deferred().reject();
|
||||
} else {
|
||||
return $.when(this.reload()).pipe(function () {
|
||||
return $.when(this.reload()).then(function () {
|
||||
self.trigger('record_saved', r);
|
||||
return r;
|
||||
});
|
||||
|
@ -923,7 +918,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
this.sidebar.do_attachement_update(this.dataset, this.datarecord.id);
|
||||
}
|
||||
//openerp.log("The record has been created with id #" + this.datarecord.id);
|
||||
return $.when(this.reload()).pipe(function () {
|
||||
return $.when(this.reload()).then(function () {
|
||||
self.trigger('record_created', r);
|
||||
return _.extend(r, {created: true});
|
||||
});
|
||||
|
@ -950,7 +945,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
'bin_size': true,
|
||||
'future_display_name': true
|
||||
}
|
||||
}).pipe(function(r) {
|
||||
}).then(function(r) {
|
||||
self.trigger('load_record', r);
|
||||
});
|
||||
}
|
||||
|
@ -976,7 +971,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
},
|
||||
recursive_save: function() {
|
||||
var self = this;
|
||||
return $.when(this.save()).pipe(function(res) {
|
||||
return $.when(this.save()).then(function(res) {
|
||||
if (self.dataset.parent_view)
|
||||
return self.dataset.parent_view.recursive_save();
|
||||
});
|
||||
|
@ -986,7 +981,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
var pre = $.when();
|
||||
if (self.dataset.parent_view)
|
||||
pre = self.dataset.parent_view.recursive_reload();
|
||||
return pre.pipe(function() {
|
||||
return pre.then(function() {
|
||||
return self.reload();
|
||||
});
|
||||
},
|
||||
|
@ -1007,7 +1002,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
return true;
|
||||
},
|
||||
sidebar_context: function () {
|
||||
return this.save().pipe(_.bind(function() {return this.get_fields_values();}, this));
|
||||
return this.save().then(_.bind(function() {return this.get_fields_values();}, this));
|
||||
},
|
||||
open_defaults_dialog: function () {
|
||||
var self = this;
|
||||
|
@ -1083,7 +1078,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
all_users,
|
||||
true,
|
||||
condition || false
|
||||
]).then(function () { d.close(); });
|
||||
]).done(function () { d.close(); });
|
||||
}}
|
||||
]
|
||||
});
|
||||
|
@ -1912,7 +1907,7 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({
|
|||
}
|
||||
},
|
||||
{text: _t("Ok"), click: function() {
|
||||
self.on_confirmed().then(function() {
|
||||
self.on_confirmed().done(function() {
|
||||
def.resolve();
|
||||
});
|
||||
$(this).dialog("close");
|
||||
|
@ -1927,7 +1922,7 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({
|
|||
};
|
||||
if (!this.node.attrs.special) {
|
||||
this.view.force_dirty = true;
|
||||
return this.view.recursive_save().pipe(exec_action);
|
||||
return this.view.recursive_save().then(exec_action);
|
||||
} else {
|
||||
return exec_action();
|
||||
}
|
||||
|
@ -2151,7 +2146,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w
|
|||
on_translate: function() {
|
||||
var self = this;
|
||||
var trans = new instance.web.DataSet(this, 'ir.translation');
|
||||
return trans.call_button('translate_fields', [this.view.dataset.model, this.view.datarecord.id, this.name, this.view.dataset.get_context()]).then(function(r) {
|
||||
return trans.call_button('translate_fields', [this.view.dataset.model, this.view.datarecord.id, this.name, this.view.dataset.get_context()]).done(function(r) {
|
||||
self.do_action(r);
|
||||
});
|
||||
},
|
||||
|
@ -2787,7 +2782,7 @@ instance.web.form.CompletionFieldMixin = {
|
|||
|
||||
return this.orderer.add(dataset.name_search(
|
||||
search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]),
|
||||
'ilike', this.limit + 1, self.build_context())).pipe(function(data) {
|
||||
'ilike', this.limit + 1, self.build_context())).then(function(data) {
|
||||
self.last_search = data;
|
||||
// possible selections for the m2o
|
||||
var values = _.map(data, function(x) {
|
||||
|
@ -2806,7 +2801,7 @@ instance.web.form.CompletionFieldMixin = {
|
|||
values.push({
|
||||
label: _t("Search More..."),
|
||||
action: function() {
|
||||
dataset.name_search(search_val, self.build_domain(), 'ilike', false).then(function(data) {
|
||||
dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) {
|
||||
self._search_create_popup("search", data);
|
||||
});
|
||||
},
|
||||
|
@ -2847,7 +2842,7 @@ instance.web.form.CompletionFieldMixin = {
|
|||
};
|
||||
if (self.options.quick_create === undefined || self.options.quick_create) {
|
||||
new instance.web.DataSet(this, this.field.relation, self.build_context())
|
||||
.name_create(name).then(function(data) {
|
||||
.name_create(name).done(function(data) {
|
||||
self.add_id(data[0]);
|
||||
}).fail(function(error, event) {
|
||||
event.preventDefault();
|
||||
|
@ -3044,7 +3039,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
|||
self.ed_def.reject();
|
||||
self.uned_def.reject();
|
||||
self.ed_def = $.Deferred();
|
||||
self.ed_def.then(function() {
|
||||
self.ed_def.done(function() {
|
||||
self.show_error_displayer();
|
||||
ignore_blur = false;
|
||||
self.trigger('focused');
|
||||
|
@ -3054,7 +3049,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
|||
self.ed_def.resolve();
|
||||
self.uned_def.reject();
|
||||
self.uned_def = $.Deferred();
|
||||
self.uned_def.then(function() {
|
||||
self.uned_def.done(function() {
|
||||
self.hide_error_displayer();
|
||||
});
|
||||
setTimeout(function() {self.uned_def.resolve();}, ed_duration);
|
||||
|
@ -3084,7 +3079,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
|||
// autocomplete
|
||||
this.$input.autocomplete({
|
||||
source: function(req, resp) {
|
||||
self.get_search_result(req.term).then(function(result) {
|
||||
self.get_search_result(req.term).done(function(result) {
|
||||
resp(result);
|
||||
});
|
||||
},
|
||||
|
@ -3135,7 +3130,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
|||
}
|
||||
if (! no_recurse) {
|
||||
var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context());
|
||||
dataset.name_get([self.get("value")]).then(function(data) {
|
||||
dataset.name_get([self.get("value")]).done(function(data) {
|
||||
self.display_value["" + self.get("value")] = data[0][1];
|
||||
self.render_value(true);
|
||||
});
|
||||
|
@ -3256,7 +3251,7 @@ instance.web.form.Many2OneButton = instance.web.form.AbstractField.extend({
|
|||
this.build_context(),
|
||||
{title: this.string}
|
||||
);
|
||||
this.popup.on('create_completed write_completed', self, function(r) {
|
||||
this.popup.on('create_completed', self, function(r) {
|
||||
self.set_value(r);
|
||||
});
|
||||
},
|
||||
|
@ -3344,11 +3339,11 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
|
|||
var self = this;
|
||||
|
||||
self.load_views();
|
||||
this.is_loaded.then(function() {
|
||||
this.is_loaded.done(function() {
|
||||
self.on("change:effective_readonly", self, function() {
|
||||
self.is_loaded = self.is_loaded.pipe(function() {
|
||||
self.is_loaded = self.is_loaded.then(function() {
|
||||
self.viewmanager.destroy();
|
||||
return $.when(self.load_views()).then(function() {
|
||||
return $.when(self.load_views()).done(function() {
|
||||
self.reload_current_view();
|
||||
});
|
||||
});
|
||||
|
@ -3418,10 +3413,10 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
|
|||
|
||||
this.viewmanager = new instance.web.form.One2ManyViewManager(this, this.dataset, views, {});
|
||||
this.viewmanager.o2m = self;
|
||||
var once = $.Deferred().then(function() {
|
||||
var once = $.Deferred().done(function() {
|
||||
self.init_form_last_update.resolve();
|
||||
});
|
||||
var def = $.Deferred().then(function() {
|
||||
var def = $.Deferred().done(function() {
|
||||
self.initial_is_loaded.resolve();
|
||||
});
|
||||
this.viewmanager.on("controller_inited", self, function(view_type, controller) {
|
||||
|
@ -3453,22 +3448,22 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
|
|||
def.resolve();
|
||||
});
|
||||
this.viewmanager.on("switch_mode", self, function(n_mode, b, c, d, e) {
|
||||
$.when(self.save_any_view()).then(function() {
|
||||
$.when(self.save_any_view()).done(function() {
|
||||
if (n_mode === "list") {
|
||||
$.async_when().then(function() {
|
||||
$.async_when().done(function() {
|
||||
self.reload_current_view();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
$.async_when().then(function () {
|
||||
$.async_when().done(function () {
|
||||
self.viewmanager.appendTo(self.$el);
|
||||
});
|
||||
return def;
|
||||
},
|
||||
reload_current_view: function() {
|
||||
var self = this;
|
||||
return self.is_loaded = self.is_loaded.pipe(function() {
|
||||
return self.is_loaded = self.is_loaded.then(function() {
|
||||
var active_view = self.viewmanager.active_view;
|
||||
var view = self.viewmanager.views[active_view].controller;
|
||||
if(active_view === "list") {
|
||||
|
@ -3480,7 +3475,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
|
|||
var act = function() {
|
||||
return view.do_show();
|
||||
};
|
||||
self.form_last_update = self.form_last_update.pipe(act, act);
|
||||
self.form_last_update = self.form_last_update.then(act, act);
|
||||
return self.form_last_update;
|
||||
} else if (view.do_search) {
|
||||
return view.do_search(self.build_domain(), self.dataset.get_context(), []);
|
||||
|
@ -3578,7 +3573,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
|
|||
this.viewmanager.views[this.viewmanager.active_view].controller) {
|
||||
var view = this.viewmanager.views[this.viewmanager.active_view].controller;
|
||||
if (this.viewmanager.active_view === "form") {
|
||||
if (!view.is_initialized.isResolved()) {
|
||||
if (!view.is_initialized.state() === 'resolved') {
|
||||
return $.when(false);
|
||||
}
|
||||
return $.when(view.save());
|
||||
|
@ -3627,13 +3622,13 @@ instance.web.form.One2ManyViewManager = instance.web.ViewManager.extend({
|
|||
pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), {
|
||||
title: _t("Open: ") + self.o2m.string,
|
||||
create_function: function(data) {
|
||||
return self.o2m.dataset.create(data).then(function(r) {
|
||||
return self.o2m.dataset.create(data).done(function(r) {
|
||||
self.o2m.dataset.set_ids(self.o2m.dataset.ids.concat([r]));
|
||||
self.o2m.dataset.trigger("dataset_changed", r);
|
||||
});
|
||||
},
|
||||
write_function: function(id, data, options) {
|
||||
return self.o2m.dataset.write(id, data, {}).then(function() {
|
||||
return self.o2m.dataset.write(id, data, {}).done(function() {
|
||||
self.o2m.reload_current_view();
|
||||
});
|
||||
},
|
||||
|
@ -3718,10 +3713,10 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
|||
initial_view: "form",
|
||||
alternative_form_view: self.o2m.field.views ? self.o2m.field.views["form"] : undefined,
|
||||
create_function: function(data, callback, error_callback) {
|
||||
return self.o2m.dataset.create(data).then(function(r) {
|
||||
return self.o2m.dataset.create(data).done(function(r) {
|
||||
self.o2m.dataset.set_ids(self.o2m.dataset.ids.concat([r]));
|
||||
self.o2m.dataset.trigger("dataset_changed", r);
|
||||
}).then(callback, error_callback);
|
||||
}).done(callback).fail(error_callback);
|
||||
},
|
||||
read_function: function() {
|
||||
return self.o2m.dataset.read_ids.apply(self.o2m.dataset, arguments);
|
||||
|
@ -3744,7 +3739,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
|||
pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), {
|
||||
title: _t("Open: ") + self.o2m.string,
|
||||
write_function: function(id, data) {
|
||||
return self.o2m.dataset.write(id, data, {}).then(function() {
|
||||
return self.o2m.dataset.write(id, data, {}).done(function() {
|
||||
self.o2m.reload_current_view();
|
||||
});
|
||||
},
|
||||
|
@ -3767,12 +3762,12 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
|||
}
|
||||
var parent_form = this.o2m.view;
|
||||
var self = this;
|
||||
this.ensure_saved().pipe(function () {
|
||||
this.ensure_saved().then(function () {
|
||||
if (parent_form)
|
||||
return parent_form.save();
|
||||
else
|
||||
return $.when();
|
||||
}).then(function () {
|
||||
}).done(function () {
|
||||
self.handle_button(name, id, callback);
|
||||
});
|
||||
},
|
||||
|
@ -3832,7 +3827,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
|||
ids.splice(false_id_index, 1);
|
||||
next = this.cancel_edition(true);
|
||||
}
|
||||
return next.pipe(function () {
|
||||
return next.then(function () {
|
||||
// wheeee
|
||||
var confirm = window.confirm;
|
||||
window.confirm = function () { return true; };
|
||||
|
@ -3894,7 +3889,7 @@ instance.web.form.One2ManyList = instance.web.ListView.List.extend({
|
|||
clearTimeout(self.view.editor.form.__blur_timeout);
|
||||
self.view.editor.form.__blur_timeout = false;
|
||||
}
|
||||
self.view.ensure_saved().then(function () {
|
||||
self.view.ensure_saved().done(function () {
|
||||
self.view.do_add_record();
|
||||
});
|
||||
}));
|
||||
|
@ -3915,7 +3910,7 @@ instance.web.form.One2ManyFormView = instance.web.FormView.extend({
|
|||
this._super(data);
|
||||
var self = this;
|
||||
this.$buttons.find('button.oe_form_button_create').click(function() {
|
||||
self.save().then(self.on_button_new);
|
||||
self.save().done(self.on_button_new);
|
||||
});
|
||||
},
|
||||
do_notify_change: function() {
|
||||
|
@ -3992,7 +3987,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
|
|||
}).bind('getSuggestions', function(e, data) {
|
||||
var _this = this;
|
||||
var str = !!data ? data.query || '' : '';
|
||||
self.get_search_result(str).then(function(result) {
|
||||
self.get_search_result(str).done(function(result) {
|
||||
self.search_result = result;
|
||||
$(_this).trigger('setSuggestions', {result : _.map(result, function(el, i) {
|
||||
return _.extend(el, {index:i});
|
||||
|
@ -4047,7 +4042,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
|
|||
}
|
||||
};
|
||||
if (! values || values.length > 0) {
|
||||
this._display_orderer.add(dataset.name_get(values)).then(handle_names);
|
||||
this._display_orderer.add(dataset.name_get(values)).done(handle_names);
|
||||
} else {
|
||||
handle_names([]);
|
||||
}
|
||||
|
@ -4084,11 +4079,11 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
|
|||
var self = this;
|
||||
|
||||
self.load_view();
|
||||
this.is_loaded.then(function() {
|
||||
this.is_loaded.done(function() {
|
||||
self.on("change:effective_readonly", self, function() {
|
||||
self.is_loaded = self.is_loaded.pipe(function() {
|
||||
self.is_loaded = self.is_loaded.then(function() {
|
||||
self.list_view.destroy();
|
||||
return $.when(self.load_view()).then(function() {
|
||||
return $.when(self.load_view()).done(function() {
|
||||
self.render_value();
|
||||
});
|
||||
});
|
||||
|
@ -4129,7 +4124,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
|
|||
self.initial_is_loaded.resolve();
|
||||
loaded.resolve();
|
||||
});
|
||||
$.async_when().then(function () {
|
||||
$.async_when().done(function () {
|
||||
self.list_view.appendTo(self.$el);
|
||||
});
|
||||
return loaded;
|
||||
|
@ -4137,7 +4132,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
|
|||
render_value: function() {
|
||||
var self = this;
|
||||
this.dataset.set_ids(this.get("value"));
|
||||
this.is_loaded = this.is_loaded.pipe(function() {
|
||||
this.is_loaded = this.is_loaded.then(function() {
|
||||
return self.list_view.reload_content();
|
||||
});
|
||||
},
|
||||
|
@ -4198,7 +4193,7 @@ instance.web.form.Many2ManyListView = instance.web.ListView.extend(/** @lends in
|
|||
if (! this.m2m_field.options.reload_on_button) {
|
||||
return _sup(name, id, callback);
|
||||
} else {
|
||||
return this.m2m_field.view.save().pipe(function() {
|
||||
return this.m2m_field.view.save().then(function() {
|
||||
return _sup(name, id, function() {
|
||||
self.m2m_field.view.reload();
|
||||
});
|
||||
|
@ -4229,11 +4224,11 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend(
|
|||
var self = this;
|
||||
|
||||
self.load_view();
|
||||
this.is_loaded.then(function() {
|
||||
this.is_loaded.done(function() {
|
||||
self.on("change:effective_readonly", self, function() {
|
||||
self.is_loaded = self.is_loaded.pipe(function() {
|
||||
self.is_loaded = self.is_loaded.then(function() {
|
||||
self.kanban_view.destroy();
|
||||
return $.when(self.load_view()).then(function() {
|
||||
return $.when(self.load_view()).done(function() {
|
||||
self.render_value();
|
||||
});
|
||||
});
|
||||
|
@ -4270,7 +4265,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend(
|
|||
loaded.resolve();
|
||||
});
|
||||
this.kanban_view.on('switch_mode', this, this.open_popup);
|
||||
$.async_when().then(function () {
|
||||
$.async_when().done(function () {
|
||||
self.kanban_view.appendTo(self.$el);
|
||||
});
|
||||
return loaded;
|
||||
|
@ -4278,7 +4273,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend(
|
|||
render_value: function() {
|
||||
var self = this;
|
||||
this.dataset.set_ids(this.get("value"));
|
||||
this.is_loaded = this.is_loaded.pipe(function() {
|
||||
this.is_loaded = this.is_loaded.then(function() {
|
||||
return self.kanban_view.do_search(self.build_domain(), self.dataset.get_context(), []);
|
||||
});
|
||||
},
|
||||
|
@ -4314,7 +4309,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend(
|
|||
pop.show_element(self.field.relation, id, self.build_context(), {
|
||||
title: _t("Open: ") + self.string,
|
||||
write_function: function(id, data, options) {
|
||||
return self.dataset.write(id, data, {}).then(function() {
|
||||
return self.dataset.write(id, data, {}).done(function() {
|
||||
self.render_value();
|
||||
});
|
||||
},
|
||||
|
@ -4387,7 +4382,7 @@ instance.web.form.Many2ManyQuickCreate = instance.web.Widget.extend({
|
|||
}).bind('getSuggestions', function(e, data) {
|
||||
var _this = this;
|
||||
var str = !!data ? data.query || '' : '';
|
||||
self.m2m.get_search_result(str).then(function(result) {
|
||||
self.m2m.get_search_result(str).done(function(result) {
|
||||
self.search_result = result;
|
||||
$(_this).trigger('setSuggestions', {result : _.map(result, function(el, i) {
|
||||
return _.extend(el, {index:i});
|
||||
|
@ -4442,15 +4437,15 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
|
|||
this.dataset.read_function = this.options.read_function;
|
||||
this.dataset.create_function = function(data, sup) {
|
||||
var fct = self.options.create_function || sup;
|
||||
return fct.call(this, data).then(function(r) {
|
||||
return fct.call(this, data).done(function(r) {
|
||||
self.trigger('create_completed saved', r);
|
||||
self.created_elements.push(r);
|
||||
});
|
||||
};
|
||||
this.dataset.write_function = function(id, data, options, sup) {
|
||||
var fct = self.options.write_function || sup;
|
||||
return fct.call(this, id, data, options).then(function() {
|
||||
self.trigger('write_completed saved');
|
||||
return fct.call(this, id, data, options).done(function(r) {
|
||||
self.trigger('write_completed saved', r);
|
||||
});
|
||||
};
|
||||
this.dataset.parent_view = this.options.parent_view;
|
||||
|
@ -4498,7 +4493,7 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
|
|||
}));
|
||||
var $snbutton = self.$buttonpane.find(".oe_abstractformpopup-form-save-new");
|
||||
$snbutton.click(function() {
|
||||
$.when(self.view_form.save()).then(function() {
|
||||
$.when(self.view_form.save()).done(function() {
|
||||
self.view_form.reload_mutex.exec(function() {
|
||||
self.view_form.on_button_new();
|
||||
});
|
||||
|
@ -4506,7 +4501,7 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
|
|||
});
|
||||
var $sbutton = self.$buttonpane.find(".oe_abstractformpopup-form-save");
|
||||
$sbutton.click(function() {
|
||||
$.when(self.view_form.save()).then(function() {
|
||||
$.when(self.view_form.save()).done(function() {
|
||||
self.view_form.reload_mutex.exec(function() {
|
||||
self.check_exit();
|
||||
});
|
||||
|
@ -4532,7 +4527,9 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
|
|||
},
|
||||
destroy: function () {
|
||||
this.trigger('closed');
|
||||
this.$el.dialog('close');
|
||||
if (this.$el.is(":data(dialog)")) {
|
||||
this.$el.dialog('close');
|
||||
}
|
||||
this._super();
|
||||
},
|
||||
});
|
||||
|
@ -4582,7 +4579,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend
|
|||
self.rpc('/web/session/eval_domain_and_context', {
|
||||
domains: [],
|
||||
contexts: [this.context]
|
||||
}).then(function (results) {
|
||||
}).done(function (results) {
|
||||
var search_defaults = {};
|
||||
_.each(results.context, function (value_, key) {
|
||||
var match = /^search_default_(.*)$/.exec(key);
|
||||
|
@ -4624,9 +4621,9 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend
|
|||
e.cancel = true;
|
||||
});
|
||||
self.view_list.popup = self;
|
||||
self.view_list.appendTo($(".oe_popup_list", self.$el)).pipe(function() {
|
||||
self.view_list.appendTo($(".oe_popup_list", self.$el)).then(function() {
|
||||
self.view_list.do_show();
|
||||
}).pipe(function() {
|
||||
}).then(function() {
|
||||
self.searchview.do_search();
|
||||
});
|
||||
self.view_list.on("list_view_loaded", self, function() {
|
||||
|
@ -4654,7 +4651,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend
|
|||
domains: domains || [],
|
||||
contexts: contexts || [],
|
||||
group_by_seq: groupbys || []
|
||||
}).then(function (results) {
|
||||
}).done(function (results) {
|
||||
self.view_list.do_search(results.domain, results.context, results.group_by);
|
||||
});
|
||||
},
|
||||
|
@ -5131,7 +5128,7 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
|
|||
},
|
||||
render_value: function() {
|
||||
var self = this;
|
||||
self.get_selection().then(function() {
|
||||
self.get_selection().done(function() {
|
||||
var content = QWeb.render("FieldStatus.content", {widget: self});
|
||||
self.$el.html(content);
|
||||
var colors = JSON.parse((self.node.attrs || {}).statusbar_colors || "{}");
|
||||
|
@ -5155,7 +5152,7 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
|
|||
domain = new instance.web.CompoundDomain(['|'], self.build_domain(), [['id', '=', self.get('value')]]);
|
||||
}
|
||||
var ds = new instance.web.DataSetSearch(this, this.field.relation, self.build_context(), domain);
|
||||
return ds.read_slice(['name'], {}).pipe(function (records) {
|
||||
return ds.read_slice(['name'], {}).then(function (records) {
|
||||
for(var i = 0; i < records.length; i++) {
|
||||
self.selection.push([records[i].id, records[i].name]);
|
||||
}
|
||||
|
@ -5179,10 +5176,10 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
|
|||
var $li = $(ev.currentTarget);
|
||||
var val = parseInt($li.data("id"));
|
||||
if (val != self.get('value')) {
|
||||
this.view.recursive_save().then(function() {
|
||||
this.view.recursive_save().done(function() {
|
||||
var change = {};
|
||||
change[self.name] = val;
|
||||
self.view.dataset.write(self.view.datarecord.id, change).then(function() {
|
||||
self.view.dataset.write(self.view.datarecord.id, change).done(function() {
|
||||
self.view.reload();
|
||||
});
|
||||
});
|
||||
|
@ -5216,7 +5213,7 @@ instance.web.form.FieldMonetary = instance.web.form.FieldFloat.extend({
|
|||
return;
|
||||
}
|
||||
return this.ci_dm.add(new instance.web.Model("res.currency").query(["symbol", "position"])
|
||||
.filter([["id", "=", self.get("currency")]]).first()).pipe(function(res) {
|
||||
.filter([["id", "=", self.get("currency")]]).first()).then(function(res) {
|
||||
self.set({"currency_info": res});
|
||||
});
|
||||
},
|
||||
|
|
|
@ -508,7 +508,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
_.pluck(_(this.columns).filter(function (r) {
|
||||
return r.tag === 'field';
|
||||
}), 'name')
|
||||
).then(function (records) {
|
||||
).done(function (records) {
|
||||
_(records[0]).each(function (value, key) {
|
||||
record.set(key, value, {silent: true});
|
||||
});
|
||||
|
@ -553,7 +553,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
this.no_leaf = !!context['group_by_no_leaf'];
|
||||
this.grouped = !!group_by;
|
||||
|
||||
return this.load_view(context).pipe(
|
||||
return this.load_view(context).then(
|
||||
this.proxy('reload_content'));
|
||||
},
|
||||
/**
|
||||
|
@ -566,7 +566,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
return;
|
||||
}
|
||||
var self = this;
|
||||
return $.when(this.dataset.unlink(ids)).then(function () {
|
||||
return $.when(this.dataset.unlink(ids)).done(function () {
|
||||
_(ids).each(function (id) {
|
||||
self.records.remove(self.records.get(id));
|
||||
});
|
||||
|
@ -976,7 +976,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
|
|||
// to get a correctly displayable value in the field
|
||||
var model = ref_match[1],
|
||||
id = parseInt(ref_match[2], 10);
|
||||
new instance.web.DataSet(this.view, model).name_get([id]).then(function(names) {
|
||||
new instance.web.DataSet(this.view, model).name_get([id]).done(function(names) {
|
||||
if (!names.length) { return; }
|
||||
record.set(column.id, names[0][1]);
|
||||
});
|
||||
|
@ -992,7 +992,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
|
|||
// and let the various registered events handle refreshing the
|
||||
// row
|
||||
new instance.web.DataSet(this.view, column.relation)
|
||||
.name_get([value]).then(function (names) {
|
||||
.name_get([value]).done(function (names) {
|
||||
if (!names.length) { return; }
|
||||
record.set(column.id, names[0]);
|
||||
});
|
||||
|
@ -1000,7 +1000,8 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
|
|||
} else if (column.type === 'many2many') {
|
||||
value = record.get(column.id);
|
||||
// non-resolved (string) m2m values are arrays
|
||||
if (value instanceof Array && !_.isEmpty(value)) {
|
||||
if (value instanceof Array && !_.isEmpty(value)
|
||||
&& !record.get(column.id + '__display')) {
|
||||
var ids;
|
||||
// they come in two shapes:
|
||||
if (value[0] instanceof Array) {
|
||||
|
@ -1015,9 +1016,14 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
|
|||
ids = value;
|
||||
}
|
||||
new instance.web.Model(column.relation)
|
||||
.call('name_get', [ids]).then(function (names) {
|
||||
record.set(column.id, _(names).pluck(1).join(', '));
|
||||
})
|
||||
.call('name_get', [ids]).done(function (names) {
|
||||
// FIXME: nth horrible hack in this poor listview
|
||||
record.set(column.id + '__display',
|
||||
_(names).pluck(1).join(', '));
|
||||
record.set(column.id, ids);
|
||||
});
|
||||
// temp empty value
|
||||
record.set(column.id, false);
|
||||
}
|
||||
}
|
||||
return column.format(record.toForm().data, {
|
||||
|
@ -1385,43 +1391,45 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
|
|||
var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field"}), 'name');
|
||||
var options = { offset: page * limit, limit: limit, context: {bin_size: true} };
|
||||
//TODO xmo: investigate why we need to put the setTimeout
|
||||
$.async_when().then(function() {dataset.read_slice(fields, options).then(function (records) {
|
||||
// FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
|
||||
if (self.records.length) {
|
||||
self.records.reset(null, {silent: true});
|
||||
}
|
||||
if (!self.datagroup.openable) {
|
||||
view.configure_pager(dataset);
|
||||
} else {
|
||||
if (dataset.size() == records.length) {
|
||||
// only one page
|
||||
self.$row.find('td.oe_list_group_pagination').empty();
|
||||
} else {
|
||||
var pages = Math.ceil(dataset.size() / limit);
|
||||
self.$row
|
||||
.find('.oe_list_pager_state')
|
||||
.text(_.str.sprintf(_t("%(page)d/%(page_count)d"), {
|
||||
page: page + 1,
|
||||
page_count: pages
|
||||
}))
|
||||
.end()
|
||||
.find('button[data-pager-action=previous]')
|
||||
.css('visibility',
|
||||
page === 0 ? 'hidden' : '')
|
||||
.end()
|
||||
.find('button[data-pager-action=next]')
|
||||
.css('visibility',
|
||||
page === pages - 1 ? 'hidden' : '');
|
||||
$.async_when().done(function() {
|
||||
dataset.read_slice(fields, options).done(function (records) {
|
||||
// FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
|
||||
if (self.records.length) {
|
||||
self.records.reset(null, {silent: true});
|
||||
}
|
||||
if (!self.datagroup.openable) {
|
||||
view.configure_pager(dataset);
|
||||
} else {
|
||||
if (dataset.size() == records.length) {
|
||||
// only one page
|
||||
self.$row.find('td.oe_list_group_pagination').empty();
|
||||
} else {
|
||||
var pages = Math.ceil(dataset.size() / limit);
|
||||
self.$row
|
||||
.find('.oe_list_pager_state')
|
||||
.text(_.str.sprintf(_t("%(page)d/%(page_count)d"), {
|
||||
page: page + 1,
|
||||
page_count: pages
|
||||
}))
|
||||
.end()
|
||||
.find('button[data-pager-action=previous]')
|
||||
.css('visibility',
|
||||
page === 0 ? 'hidden' : '')
|
||||
.end()
|
||||
.find('button[data-pager-action=next]')
|
||||
.css('visibility',
|
||||
page === pages - 1 ? 'hidden' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.records.add(records, {silent: true});
|
||||
list.render();
|
||||
d.resolve(list);
|
||||
if (_.isEmpty(records)) {
|
||||
view.no_result();
|
||||
}
|
||||
});});
|
||||
self.records.add(records, {silent: true});
|
||||
list.render();
|
||||
d.resolve(list);
|
||||
if (_.isEmpty(records)) {
|
||||
view.no_result();
|
||||
}
|
||||
});
|
||||
});
|
||||
return d.promise();
|
||||
},
|
||||
setup_resequence_rows: function (list, dataset) {
|
||||
|
@ -1477,7 +1485,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
|
|||
// Accounting > Taxes > Taxes, child tax accounts)
|
||||
// when synchronous (without setTimeout)
|
||||
(function (dataset, id, seq) {
|
||||
$.async_when().then(function () {
|
||||
$.async_when().done(function () {
|
||||
var attrs = {};
|
||||
attrs[seqname] = seq;
|
||||
dataset.write(id, attrs);
|
||||
|
@ -1502,7 +1510,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
|
|||
self.render_groups(groups));
|
||||
if (post_render) { post_render(); }
|
||||
}, function (dataset) {
|
||||
self.render_dataset(dataset).then(function (list) {
|
||||
self.render_dataset(dataset).done(function (list) {
|
||||
self.children[null] = list;
|
||||
self.elements =
|
||||
[list.$current.replaceAll($el)[0]];
|
||||
|
@ -1562,7 +1570,7 @@ var DataGroup = instance.web.CallbackEnabled.extend({
|
|||
list: function (fields, ifGroups, ifRecords) {
|
||||
var self = this;
|
||||
var query = this.model.query(fields).order_by(this.sort).group_by(this.group_by);
|
||||
$.when(query).then(function (querygroups) {
|
||||
$.when(query).done(function (querygroups) {
|
||||
// leaf node
|
||||
if (!querygroups) {
|
||||
var ds = new instance.web.DataSetSearch(self, self.model.name, self.model.context(), self.model.domain());
|
||||
|
@ -2013,6 +2021,7 @@ instance.web.list.columns = new instance.web.Registry({
|
|||
'field.handle': 'instance.web.list.Handle',
|
||||
'button': 'instance.web.list.Button',
|
||||
'field.many2onebutton': 'instance.web.list.Many2OneButton',
|
||||
'field.many2many': 'instance.web.list.Many2Many'
|
||||
});
|
||||
instance.web.list.columns.for_ = function (id, field, node) {
|
||||
var description = _.extend({tag: node.tag}, field, node.attrs);
|
||||
|
@ -2206,5 +2215,14 @@ instance.web.list.Many2OneButton = instance.web.list.Column.extend({
|
|||
return QWeb.render('Many2OneButton.cell', {'widget': this});
|
||||
},
|
||||
});
|
||||
instance.web.list.Many2Many = instance.web.list.Column.extend({
|
||||
_format: function (row_data, options) {
|
||||
if (!_.isEmpty(row_data[this.id].value)) {
|
||||
// If value, use __display version for printing
|
||||
row_data[this.id] = row_data[this.id + '__display'];
|
||||
}
|
||||
return this._super(row_data, options);
|
||||
}
|
||||
});
|
||||
};
|
||||
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
|
||||
|
|
|
@ -129,7 +129,7 @@ openerp.web.list_editable = function (instance) {
|
|||
// restartable
|
||||
this.editor = this.make_editor();
|
||||
var editor_ready = this.editor.prependTo(this.$el)
|
||||
.then(this.proxy('setup_events'));
|
||||
.done(this.proxy('setup_events'));
|
||||
|
||||
return $.when(result, editor_ready);
|
||||
} else {
|
||||
|
@ -148,7 +148,7 @@ openerp.web.list_editable = function (instance) {
|
|||
},
|
||||
do_button_action: function (name, id, callback) {
|
||||
var self = this, args = arguments;
|
||||
this.ensure_saved().then(function (done) {
|
||||
this.ensure_saved().done(function (done) {
|
||||
if (!id && done.created) {
|
||||
id = done.record.get('id');
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ openerp.web.list_editable = function (instance) {
|
|||
at: this.prepends_on_create() ? 0 : null});
|
||||
}
|
||||
|
||||
return this.ensure_saved().pipe(function () {
|
||||
return this.ensure_saved().then(function () {
|
||||
var $recordRow = self.groups.get_row_for(record);
|
||||
var cells = self.get_cells_for($recordRow);
|
||||
self.fields_for_resize.splice(0, self.fields_for_resize.length);
|
||||
|
@ -213,7 +213,7 @@ openerp.web.list_editable = function (instance) {
|
|||
// FIXME: need better way to get the field back from bubbling (delegated) DOM events somehow
|
||||
field.$el.attr('data-fieldname', field_name);
|
||||
self.fields_for_resize.push({field: field, cell: cell});
|
||||
}, options).pipe(function () {
|
||||
}, options).then(function () {
|
||||
$recordRow.addClass('oe_edition');
|
||||
self.resize_fields();
|
||||
return record.attributes;
|
||||
|
@ -242,7 +242,9 @@ openerp.web.list_editable = function (instance) {
|
|||
if (!this.editor.is_editing()) { return; }
|
||||
for(var i=0, len=this.fields_for_resize.length; i<len; ++i) {
|
||||
var item = this.fields_for_resize[i];
|
||||
this.resize_field(item.field, item.cell);
|
||||
if (!item.field.get('invisible')) {
|
||||
this.resize_field(item.field, item.cell);
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
@ -254,7 +256,6 @@ openerp.web.list_editable = function (instance) {
|
|||
*/
|
||||
resize_field: function (field, cell) {
|
||||
var $cell = $(cell);
|
||||
var position = $cell.position();
|
||||
|
||||
field.set_dimensions($cell.outerHeight(), $cell.outerWidth());
|
||||
field.$el.position({
|
||||
|
@ -273,7 +274,7 @@ openerp.web.list_editable = function (instance) {
|
|||
form: this.editor.form,
|
||||
cancel: false
|
||||
}, function () {
|
||||
return this.editor.save().pipe(function (attrs) {
|
||||
return this.editor.save().then(function (attrs) {
|
||||
var created = false;
|
||||
var record = self.records.get(attrs.id);
|
||||
if (!record) {
|
||||
|
@ -287,9 +288,9 @@ openerp.web.list_editable = function (instance) {
|
|||
// record which has *just* been saved, so first perform all
|
||||
// onwrites then do a final reload of the record
|
||||
return self.handle_onwrite(record)
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
return self.reload_record(record); })
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
return { created: created, record: record }; });
|
||||
});
|
||||
});
|
||||
|
@ -305,7 +306,7 @@ openerp.web.list_editable = function (instance) {
|
|||
form: this.editor.form,
|
||||
cancel: false
|
||||
}, function () {
|
||||
return this.editor.cancel(force).pipe(function (attrs) {
|
||||
return this.editor.cancel(force).then(function (attrs) {
|
||||
if (attrs.id) {
|
||||
var record = self.records.get(attrs.id);
|
||||
if (!record) {
|
||||
|
@ -349,7 +350,7 @@ openerp.web.list_editable = function (instance) {
|
|||
message: _.str.sprintf("Event %s:before cancelled",
|
||||
event_name)});
|
||||
}
|
||||
return $.when(action.call(this)).then(function () {
|
||||
return $.when(action.call(this)).done(function () {
|
||||
self.trigger.apply(self, [event_name + ':after']
|
||||
.concat(_.toArray(arguments)));
|
||||
});
|
||||
|
@ -379,7 +380,7 @@ openerp.web.list_editable = function (instance) {
|
|||
var on_write_callback = self.fields_view.arch.attrs.on_write;
|
||||
if (!on_write_callback) { return $.when(); }
|
||||
return this.dataset.call(on_write_callback, [source_record.get('id')])
|
||||
.pipe(function (ids) {
|
||||
.then(function (ids) {
|
||||
return $.when.apply(
|
||||
null, _(ids).map(
|
||||
_.bind(self.handle_onwrite_record, self, source_record)));
|
||||
|
@ -440,7 +441,7 @@ openerp.web.list_editable = function (instance) {
|
|||
_next: function (next_record, options) {
|
||||
next_record = next_record || 'succ';
|
||||
var self = this;
|
||||
return this.save_edition().pipe(function (saveInfo) {
|
||||
return this.save_edition().then(function (saveInfo) {
|
||||
if (saveInfo.created) {
|
||||
return self.start_edition();
|
||||
}
|
||||
|
@ -647,7 +648,7 @@ openerp.web.list_editable = function (instance) {
|
|||
var _super = this._super();
|
||||
this.form.embedded_view = this._validate_view(
|
||||
this.delegate.edition_view(this));
|
||||
var form_ready = this.form.appendTo(this.$el).then(
|
||||
var form_ready = this.form.appendTo(this.$el).done(
|
||||
self.form.proxy('do_hide'));
|
||||
return $.when(_super, form_ready);
|
||||
},
|
||||
|
@ -728,9 +729,9 @@ openerp.web.list_editable = function (instance) {
|
|||
var loaded = record
|
||||
? form.trigger('load_record', _.extend({}, record))
|
||||
: form.load_defaults();
|
||||
return $.when(loaded).pipe(function () {
|
||||
return $.when(loaded).then(function () {
|
||||
return form.do_show({reload: false});
|
||||
}).pipe(function () {
|
||||
}).then(function () {
|
||||
self.record = form.datarecord;
|
||||
_(form.fields).each(function (field, name) {
|
||||
configureField(name, field);
|
||||
|
@ -743,7 +744,7 @@ openerp.web.list_editable = function (instance) {
|
|||
var self = this;
|
||||
return this.form
|
||||
.save(this.delegate.prepends_on_create())
|
||||
.pipe(function (result) {
|
||||
.then(function (result) {
|
||||
var created = result.created && !self.record.id;
|
||||
if (created) {
|
||||
self.record.id = result.result;
|
||||
|
|
|
@ -45,7 +45,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
|
|||
view_type: "tree",
|
||||
toolbar: this.view_manager ? !!this.view_manager.sidebar : false,
|
||||
context: this.dataset.get_context()
|
||||
}, this.on_loaded);
|
||||
}).done(this.on_loaded);
|
||||
},
|
||||
/**
|
||||
* Returns the list of fields needed to correctly read objects.
|
||||
|
@ -86,7 +86,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
|
|||
}));
|
||||
this.$el.addClass(this.fields_view.arch.attrs['class']);
|
||||
|
||||
this.dataset.read_slice(this.fields_list()).then(function(records) {
|
||||
this.dataset.read_slice(this.fields_list()).done(function(records) {
|
||||
if (!has_toolbar) {
|
||||
// WARNING: will do a second read on the same ids, but only on
|
||||
// first load so not very important
|
||||
|
@ -192,7 +192,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
|
|||
getdata: function (id, children_ids) {
|
||||
var self = this;
|
||||
|
||||
self.dataset.read_ids(children_ids, this.fields_list()).then(function(records) {
|
||||
self.dataset.read_ids(children_ids, this.fields_list()).done(function(records) {
|
||||
_(records).each(function (record) {
|
||||
self.records[record.id] = record;
|
||||
});
|
||||
|
@ -229,7 +229,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
|
|||
model: this.dataset.model,
|
||||
context: new instance.web.CompoundContext(
|
||||
this.dataset.get_context(), local_context)
|
||||
}).pipe(function (actions) {
|
||||
}).then(function (actions) {
|
||||
if (!actions.length) { return; }
|
||||
var action = actions[0][2];
|
||||
var c = new instance.web.CompoundContext(local_context);
|
||||
|
@ -238,7 +238,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
|
|||
}
|
||||
return self.rpc('/web/session/eval_domain_and_context', {
|
||||
contexts: [c], domains: []
|
||||
}).pipe(function (res) {
|
||||
}).then(function (res) {
|
||||
action.context = res.context;
|
||||
return self.do_action(action);
|
||||
}, null);
|
||||
|
|
|
@ -200,7 +200,12 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
action_loaded;
|
||||
if (state.action) {
|
||||
if (_.isString(state.action) && instance.web.client_actions.contains(state.action)) {
|
||||
var action_client = {type: "ir.actions.client", tag: state.action, params: state};
|
||||
var action_client = {
|
||||
type: "ir.actions.client",
|
||||
tag: state.action,
|
||||
params: state,
|
||||
_push_me: state._push_me,
|
||||
};
|
||||
this.null_action();
|
||||
action_loaded = this.do_action(action_client);
|
||||
} else {
|
||||
|
@ -208,7 +213,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
if (run_action) {
|
||||
this.null_action();
|
||||
action_loaded = this.do_action(state.action);
|
||||
instance.webclient.menu.has_been_loaded.then(function() {
|
||||
instance.webclient.menu.has_been_loaded.done(function() {
|
||||
instance.webclient.menu.open_action(state.action);
|
||||
});
|
||||
}
|
||||
|
@ -226,14 +231,14 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
} else if (state.sa) {
|
||||
// load session action
|
||||
this.null_action();
|
||||
action_loaded = this.rpc('/web/session/get_session_action', {key: state.sa}).pipe(function(action) {
|
||||
action_loaded = this.rpc('/web/session/get_session_action', {key: state.sa}).then(function(action) {
|
||||
if (action) {
|
||||
return self.do_action(action);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$.when(action_loaded || null).then(function() {
|
||||
$.when(action_loaded || null).done(function() {
|
||||
if (self.inner_widget && self.inner_widget.do_load_state) {
|
||||
self.inner_widget.do_load_state(state, warm);
|
||||
}
|
||||
|
@ -251,7 +256,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
return this.do_action(action_client, options);
|
||||
} else if (_.isNumber(action) || _.isString(action)) {
|
||||
var self = this;
|
||||
return self.rpc("/web/action/load", { action_id: action }).pipe(function(result) {
|
||||
return self.rpc("/web/action/load", { action_id: action }).then(function(result) {
|
||||
return self.do_action(result, options);
|
||||
});
|
||||
}
|
||||
|
@ -379,7 +384,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
this.rpc('/web/action/run', {
|
||||
action_id: action.id,
|
||||
context: action.context || {}
|
||||
}).then(function (action) {
|
||||
}).done(function (action) {
|
||||
self.do_action(action, options)
|
||||
});
|
||||
},
|
||||
|
@ -389,7 +394,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
|||
self.rpc("/web/session/eval_domain_and_context", {
|
||||
contexts: [action.context],
|
||||
domains: []
|
||||
}).then(function(res) {
|
||||
}).done(function(res) {
|
||||
action = _.clone(action);
|
||||
action.context = res.context;
|
||||
self.session.get_file({
|
||||
|
@ -487,7 +492,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
|||
} else if (this.searchview
|
||||
&& self.flags.auto_search
|
||||
&& view.controller.searchable !== false) {
|
||||
this.searchview.ready.then(this.searchview.do_search);
|
||||
this.searchview.ready.done(this.searchview.do_search);
|
||||
}
|
||||
|
||||
if (this.searchview) {
|
||||
|
@ -499,7 +504,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
|||
.find('.oe_view_manager_switch a').filter('[data-view-type="' + view_type + '"]')
|
||||
.parent().addClass('active');
|
||||
|
||||
r = $.when(view_promise).then(function () {
|
||||
r = $.when(view_promise).done(function () {
|
||||
_.each(_.keys(self.views), function(view_name) {
|
||||
var controller = self.views[view_name].controller;
|
||||
if (controller) {
|
||||
|
@ -551,11 +556,11 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
|||
var view_promise = controller.appendTo(container);
|
||||
this.views[view_type].controller = controller;
|
||||
this.views[view_type].deferred.resolve(view_type);
|
||||
return $.when(view_promise).then(function() {
|
||||
return $.when(view_promise).done(function() {
|
||||
if (self.searchview
|
||||
&& self.flags.auto_search
|
||||
&& view.controller.searchable !== false) {
|
||||
self.searchview.ready.then(self.searchview.do_search);
|
||||
self.searchview.ready.done(self.searchview.do_search);
|
||||
}
|
||||
self.trigger("controller_inited",view_type,controller);
|
||||
});
|
||||
|
@ -582,7 +587,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
|||
var view_to_select = views[index];
|
||||
var state = self.url_states[view_to_select];
|
||||
self.do_push_state(state || {});
|
||||
$.when(self.switch_mode(view_to_select)).then(function() {
|
||||
$.when(self.switch_mode(view_to_select)).done(function() {
|
||||
self.$el.show();
|
||||
});
|
||||
},
|
||||
|
@ -661,7 +666,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
|
|||
domains: [this.action.domain || []].concat(domains || []),
|
||||
contexts: [action_context].concat(contexts || []),
|
||||
group_by_seq: groupbys || []
|
||||
}).then(function (results) {
|
||||
}).done(function (results) {
|
||||
self.dataset._model = new instance.web.Model(
|
||||
self.dataset.model, results.context, results.domain);
|
||||
var groupby = results.group_by.length
|
||||
|
@ -786,7 +791,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
|
|||
case 'perm_read':
|
||||
var ids = current_view.get_selected_ids();
|
||||
if (ids.length === 1) {
|
||||
this.dataset.call('perm_read', [ids]).then(function(result) {
|
||||
this.dataset.call('perm_read', [ids]).done(function(result) {
|
||||
var dialog = new instance.web.Dialog(this, {
|
||||
title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model),
|
||||
width: 400
|
||||
|
@ -812,7 +817,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
|
|||
});
|
||||
break;
|
||||
case 'fields':
|
||||
this.dataset.call('fields_get', [false, {}]).then(function (fields) {
|
||||
this.dataset.call('fields_get', [false, {}]).done(function (fields) {
|
||||
var $root = $('<dl>');
|
||||
_(fields).each(function (attributes, name) {
|
||||
$root.append($('<dt>').append($('<h4>').text(name)));
|
||||
|
@ -899,7 +904,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
|
|||
switch_mode: function (view_type, no_store, options) {
|
||||
var self = this;
|
||||
|
||||
return $.when(this._super.apply(this, arguments)).then(function () {
|
||||
return $.when(this._super.apply(this, arguments)).done(function () {
|
||||
var controller = self.views[self.active_view].controller;
|
||||
self.$el.find('.oe_debug_view').html(QWeb.render('ViewManagerDebug', {
|
||||
view: controller,
|
||||
|
@ -938,13 +943,13 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
|
|||
defs = [];
|
||||
if (state.view_type && state.view_type !== this.active_view) {
|
||||
defs.push(
|
||||
this.views[this.active_view].deferred.pipe(function() {
|
||||
this.views[this.active_view].deferred.then(function() {
|
||||
return self.switch_mode(state.view_type, true);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
$.when(defs).then(function() {
|
||||
$.when(defs).done(function() {
|
||||
self.views[self.active_view].controller.do_load_state(state, warm);
|
||||
});
|
||||
},
|
||||
|
@ -1051,7 +1056,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
|
|||
},
|
||||
on_item_action_clicked: function(item) {
|
||||
var self = this;
|
||||
self.getParent().sidebar_context().then(function (context) {
|
||||
self.getParent().sidebar_context().done(function (context) {
|
||||
var ids = self.getParent().get_selected_ids();
|
||||
if (ids.length == 0) {
|
||||
instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true });
|
||||
|
@ -1065,7 +1070,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
|
|||
self.rpc("/web/action/load", {
|
||||
action_id: item.action.id,
|
||||
context: additional_context
|
||||
}).then(function(result) {
|
||||
}).done(function(result) {
|
||||
result.context = _.extend(result.context || {},
|
||||
additional_context);
|
||||
result.flags = result.flags || {};
|
||||
|
@ -1087,7 +1092,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
|
|||
} else {
|
||||
var dom = [ ['res_model', '=', dataset.model], ['res_id', '=', model_id], ['type', 'in', ['binary', 'url']] ];
|
||||
var ds = new instance.web.DataSetSearch(this, 'ir.attachment', dataset.get_context(), dom);
|
||||
ds.read_slice(['name', 'url', 'type'], {}).then(this.on_attachments_loaded);
|
||||
ds.read_slice(['name', 'url', 'type'], {}).done(this.on_attachments_loaded);
|
||||
}
|
||||
},
|
||||
on_attachments_loaded: function(attachments) {
|
||||
|
@ -1122,7 +1127,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
|
|||
var self = this;
|
||||
var $e = $(e.currentTarget);
|
||||
if (confirm(_t("Do you really want to delete this attachment ?"))) {
|
||||
(new instance.web.DataSet(this, 'ir.attachment')).unlink([parseInt($e.attr('data-id'), 10)]).then(function() {
|
||||
(new instance.web.DataSet(this, 'ir.attachment')).unlink([parseInt($e.attr('data-id'), 10)]).done(function() {
|
||||
self.do_attachement_update(self.dataset, self.model_id);
|
||||
});
|
||||
}
|
||||
|
@ -1150,7 +1155,7 @@ instance.web.View = instance.web.Widget.extend({
|
|||
var view_loaded;
|
||||
if (this.embedded_view) {
|
||||
view_loaded = $.Deferred();
|
||||
$.async_when().then(function() {
|
||||
$.async_when().done(function() {
|
||||
view_loaded.resolve(self.embedded_view);
|
||||
});
|
||||
} else {
|
||||
|
@ -1164,7 +1169,7 @@ instance.web.View = instance.web.Widget.extend({
|
|||
context: this.dataset.get_context(context)
|
||||
});
|
||||
}
|
||||
return view_loaded.pipe(function(r) {
|
||||
return view_loaded.then(function(r) {
|
||||
self.trigger('view_loaded', r);
|
||||
// add css classes that reflect the (absence of) access rights
|
||||
self.$el.addClass('oe_view')
|
||||
|
@ -1220,7 +1225,7 @@ instance.web.View = instance.web.Widget.extend({
|
|||
return self.rpc('/web/session/eval_domain_and_context', {
|
||||
contexts: [ncontext],
|
||||
domains: []
|
||||
}).pipe(function (results) {
|
||||
}).then(function (results) {
|
||||
action.context = results.context;
|
||||
/* niv: previously we were overriding once more with action_data.context,
|
||||
* I assumed this was not a correct behavior and removed it
|
||||
|
@ -1249,11 +1254,11 @@ instance.web.View = instance.web.Widget.extend({
|
|||
}
|
||||
}
|
||||
args.push(context);
|
||||
return dataset.call_button(action_data.name, args).then(handler);
|
||||
return dataset.call_button(action_data.name, args).done(handler);
|
||||
} else if (action_data.type=="action") {
|
||||
return this.rpc('/web/action/load', { action_id: action_data.name, context: context, do_not_eval: true}).then(handler);
|
||||
return this.rpc('/web/action/load', { action_id: action_data.name, context: context, do_not_eval: true}).done(handler);
|
||||
} else {
|
||||
return dataset.exec_workflow(record_id, action_data.name).then(handler);
|
||||
return dataset.exec_workflow(record_id, action_data.name).done(handler);
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -82,7 +82,7 @@ $(document).ready(function () {
|
|||
});
|
||||
t.test('call', function (openerp) {
|
||||
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||
t.expect(ds.call('frob', ['a', 'b', 42]).then(function (r) {
|
||||
t.expect(ds.call('frob', ['a', 'b', 42]).done(function (r) {
|
||||
strictEqual(r.method, 'frob');
|
||||
|
||||
strictEqual(r.args.length, 3);
|
||||
|
@ -91,7 +91,7 @@ $(document).ready(function () {
|
|||
ok(_.isEmpty(r.kwargs));
|
||||
}));
|
||||
});
|
||||
t.test('name_get').then(function (openerp) {
|
||||
t.test('name_get').done(function (openerp) {
|
||||
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
|
||||
t.expect(ds.name_get([1, 2], null), function (r) {
|
||||
strictEqual(r.method, 'name_get');
|
||||
|
|
|
@ -107,12 +107,12 @@ $(document).ready(function () {
|
|||
});
|
||||
var counter = 0;
|
||||
e.appendTo($fix)
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
return e.edit({}, function () {
|
||||
++counter;
|
||||
});
|
||||
})
|
||||
.pipe(function (form) {
|
||||
.then(function (form) {
|
||||
ok(e.is_editing(), "should be editing");
|
||||
equal(counter, 3, "should have configured all fields");
|
||||
return e.save();
|
||||
|
@ -137,12 +137,12 @@ $(document).ready(function () {
|
|||
});
|
||||
var counter = 0;
|
||||
e.appendTo($fix)
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
return e.edit({}, function () {
|
||||
++counter;
|
||||
});
|
||||
})
|
||||
.pipe(function (form) {
|
||||
.then(function (form) {
|
||||
return e.cancel();
|
||||
})
|
||||
.always(start)
|
||||
|
@ -170,12 +170,12 @@ $(document).ready(function () {
|
|||
var counter = 0;
|
||||
var warnings = 0;
|
||||
e.appendTo($fix)
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
return e.edit({}, function () {
|
||||
++counter;
|
||||
});
|
||||
})
|
||||
.pipe(function (form) {
|
||||
.then(function (form) {
|
||||
return e.save();
|
||||
})
|
||||
.always(start)
|
||||
|
@ -243,16 +243,16 @@ $(document).ready(function () {
|
|||
var l = new instance.web.ListView({}, ds, false, {editable: 'top'});
|
||||
|
||||
l.appendTo($fix)
|
||||
.pipe(l.proxy('reload_content'))
|
||||
.pipe(function () {
|
||||
.then(l.proxy('reload_content'))
|
||||
.then(function () {
|
||||
return l.start_edition();
|
||||
})
|
||||
.always(start)
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
ok(got_defaults, "should have fetched default values for form");
|
||||
return l.save_edition();
|
||||
})
|
||||
.pipe(function (result) {
|
||||
.then(function (result) {
|
||||
ok(result.created, "should yield newly created record");
|
||||
equal(result.record.get('a'), "qux",
|
||||
"should have used default values");
|
||||
|
@ -307,14 +307,14 @@ $(document).ready(function () {
|
|||
var l = new instance.web.ListView({}, ds, false, {editable: 'top'});
|
||||
l.on('edit:before edit:after', o, o.onEvent);
|
||||
l.appendTo($fix)
|
||||
.pipe(l.proxy('reload_content'))
|
||||
.then(l.proxy('reload_content'))
|
||||
.always(start)
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
ok(l.options.editable, "should be editable");
|
||||
equal(o.counter, 0, "should have seen no event yet");
|
||||
return l.start_edition(l.records.get(1));
|
||||
})
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
ok(l.editor.is_editing(), "should be editing");
|
||||
equal(o.counter, 2, "should have seen two edition events");
|
||||
})
|
||||
|
@ -332,14 +332,14 @@ $(document).ready(function () {
|
|||
edit_after = true;
|
||||
});
|
||||
l.appendTo($fix)
|
||||
.pipe(l.proxy('reload_content'))
|
||||
.then(l.proxy('reload_content'))
|
||||
.always(start)
|
||||
.pipe(function () {
|
||||
.then(function () {
|
||||
ok(l.options.editable, "should be editable");
|
||||
return l.start_edition();
|
||||
})
|
||||
// cancelling an event rejects the deferred
|
||||
.pipe($.Deferred().reject(), function () {
|
||||
.then($.Deferred().reject(), function () {
|
||||
ok(!l.editor.is_editing(), "should not be editing");
|
||||
ok(!edit_after, "should not have fired the edit:after event");
|
||||
return $.when();
|
||||
|
|
|
@ -29,10 +29,10 @@ $(document).ready(function () {
|
|||
fail1 = false, fail2 = false;
|
||||
|
||||
var d1 = $.Deferred(), d2 = $.Deferred();
|
||||
dm.add(d1).then(function () { done1 = true; },
|
||||
function () { fail1 = true; });
|
||||
dm.add(d2).then(function () { done2 = true; },
|
||||
function () { fail2 = true; });
|
||||
dm.add(d1).done(function () { done1 = true; })
|
||||
.fail(function () { fail1 = true; });
|
||||
dm.add(d2).done(function () { done2 = true; })
|
||||
.fail(function () { fail2 = true; });
|
||||
|
||||
d2.resolve();
|
||||
d1.resolve();
|
||||
|
@ -50,10 +50,10 @@ $(document).ready(function () {
|
|||
fail1 = false, fail2 = false;
|
||||
|
||||
var d1 = $.Deferred(), d2 = $.Deferred();
|
||||
dm.add(d1).then(function () { done1 = true; },
|
||||
function () { fail1 = true; });
|
||||
dm.add(d2).then(function () { done2 = true; },
|
||||
function () { fail2 = true; });
|
||||
dm.add(d1).done(function () { done1 = true; })
|
||||
.fail(function () { fail1 = true; });
|
||||
dm.add(d2).done(function () { done2 = true; })
|
||||
.fail(function () { fail2 = true; });
|
||||
|
||||
d2.resolve();
|
||||
d1.resolve();
|
||||
|
@ -86,10 +86,10 @@ $(document).ready(function () {
|
|||
fail1 = false, fail2 = false;
|
||||
|
||||
var d1 = $.Deferred(), d2 = $.Deferred();
|
||||
dm.add(d1).then(function () { done1 = true; },
|
||||
function () { fail1 = true; });
|
||||
dm.add(d2).then(function () { done2 = true; },
|
||||
function () { fail2 = true; });
|
||||
dm.add(d1).done(function () { done1 = true; })
|
||||
.fail(function () { fail1 = true; });
|
||||
dm.add(d2).done(function () { done2 = true; })
|
||||
.fail(function () { fail2 = true; });
|
||||
|
||||
setTimeout(function () { d1.resolve(); }, 200);
|
||||
setTimeout(function () { d2.resolve(); }, 100);
|
||||
|
@ -110,10 +110,10 @@ $(document).ready(function () {
|
|||
fail1 = false, fail2 = false;
|
||||
|
||||
var d1 = $.Deferred(), d2 = $.Deferred();
|
||||
dm.add(d1).then(function () { done1 = true; },
|
||||
function () { fail1 = true; });
|
||||
dm.add(d2).then(function () { done2 = true; },
|
||||
function () { fail2 = true; });
|
||||
dm.add(d1).done(function () { done1 = true; })
|
||||
.fail(function () { fail1 = true; });
|
||||
dm.add(d2).done(function () { done2 = true; })
|
||||
.fail(function () { fail2 = true; });
|
||||
|
||||
setTimeout(function () { d1.resolve(); }, 200);
|
||||
setTimeout(function () { d2.resolve(); }, 100);
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<script src="/web/static/lib/backbone/backbone.js" type="text/javascript"></script>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="/web/static/lib/jquery/jquery-1.7.2.js"></script>
|
||||
<script src="/web/static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js"></script>
|
||||
<script src="/web/static/lib/jquery/jquery-1.8.2.js"></script>
|
||||
<script src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
|
||||
<script src="/web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js"></script>
|
||||
|
||||
<script src="/web/static/lib/datejs/globalization/en-US.js"></script>
|
||||
|
|
|
@ -96,7 +96,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
|||
|
||||
if (!this.sidebar && this.options.$sidebar) {
|
||||
this.sidebar = new instance.web_calendar.Sidebar(this);
|
||||
this.has_been_loaded.pipe(this.sidebar.appendTo(this.$el.find('.oe_calendar_sidebar_container')));
|
||||
this.has_been_loaded.then(this.sidebar.appendTo(this.$el.find('.oe_calendar_sidebar_container')));
|
||||
}
|
||||
this.trigger('calendar_view_loaded', data);
|
||||
return this.has_been_loaded.resolve();
|
||||
|
@ -236,7 +236,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
|||
}
|
||||
},
|
||||
reload_event: function(id) {
|
||||
this.dataset.read_ids([id], _.keys(this.fields)).then(this.proxy('events_loaded'));
|
||||
this.dataset.read_ids([id], _.keys(this.fields)).done(this.proxy('events_loaded'));
|
||||
},
|
||||
get_color: function(key) {
|
||||
if (this.color_map[key]) {
|
||||
|
@ -347,12 +347,12 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
|||
ranged_search: function() {
|
||||
var self = this;
|
||||
scheduler.clearAll();
|
||||
$.when(this.has_been_loaded, this.ready).then(function() {
|
||||
$.when(this.has_been_loaded, this.ready).done(function() {
|
||||
self.dataset.read_slice(_.keys(self.fields), {
|
||||
offset: 0,
|
||||
domain: self.get_range_domain(),
|
||||
context: self.last_search[1]
|
||||
}).then(function(events) {
|
||||
}).done(function(events) {
|
||||
self.dataset_events = events;
|
||||
self.events_loaded(events);
|
||||
});
|
||||
|
@ -367,7 +367,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
|||
},
|
||||
do_show: function () {
|
||||
var self = this;
|
||||
$.when(this.has_been_loaded).then(function() {
|
||||
$.when(this.has_been_loaded).done(function() {
|
||||
self.$el.show();
|
||||
self.do_push_state({});
|
||||
});
|
||||
|
@ -387,7 +387,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
|||
var index = this.dataset.get_id_index(event_id);
|
||||
if (index !== null) {
|
||||
event_id = this.dataset.ids[index];
|
||||
this.dataset.write(event_id, data, {}).then(function() {
|
||||
this.dataset.write(event_id, data, {}).done(function() {
|
||||
self.refresh_minical();
|
||||
});
|
||||
}
|
||||
|
@ -395,13 +395,13 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
|||
quick_create: function(event_id, event_obj) {
|
||||
var self = this;
|
||||
var data = this.get_event_data(event_obj);
|
||||
this.dataset.create(data).then(function(r) {
|
||||
this.dataset.create(data).done(function(r) {
|
||||
var id = r;
|
||||
self.dataset.ids.push(id);
|
||||
scheduler.changeEventId(event_id, id);
|
||||
self.refresh_minical();
|
||||
self.reload_event(id);
|
||||
}, function(r, event) {
|
||||
}).fail(function(r, event) {
|
||||
event.preventDefault();
|
||||
self.slow_create(event_id, event_obj);
|
||||
});
|
||||
|
@ -472,7 +472,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).then(function() {
|
||||
this.dataset.unlink(event_id).done(function() {
|
||||
self.refresh_minical();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
return this.rpc("/web_diagram/diagram/load", {"model": this.model, "view_id": this.view_id}).then(function(r) {
|
||||
return this.rpc("/web_diagram/diagram/load", {"model": this.model, "view_id": this.view_id}).done(function(r) {
|
||||
self.load_diagram(r);
|
||||
});
|
||||
},
|
||||
|
@ -105,7 +105,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
});
|
||||
|
||||
this.rpc(
|
||||
'/web_diagram/diagram/get_diagram_info',params).then(function(result) {
|
||||
'/web_diagram/diagram/get_diagram_info',params).done(function(result) {
|
||||
self.draw_diagram(result);
|
||||
}
|
||||
);
|
||||
|
@ -256,7 +256,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
);
|
||||
|
||||
pop.on('write_completed', self, function() {
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
|
||||
});
|
||||
|
||||
var form_fields = [self.parent_field];
|
||||
|
@ -290,7 +290,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
self.context || self.dataset.context
|
||||
);
|
||||
pop.on("elements_selected", self, function(element_ids) {
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
|
||||
});
|
||||
|
||||
var form_controller = pop.view_form;
|
||||
|
@ -320,7 +320,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
}
|
||||
);
|
||||
pop.on('write_completed', self, function() {
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -342,7 +342,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
this.context || this.dataset.context
|
||||
);
|
||||
pop.on("elements_selected", self, function(element_ids) {
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded);
|
||||
self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
|
||||
});
|
||||
// We want to destroy the dummy edge after a creation cancel. This destroys it even if we save the changes.
|
||||
// This is not a problem since the diagram is completely redrawn on saved changes.
|
||||
|
@ -390,7 +390,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
|
||||
pager_action_trigger: function(){
|
||||
var loaded = this.dataset.read_index(_.keys(this.fields_view.fields))
|
||||
.pipe(this.on_diagram_loaded);
|
||||
.then(this.on_diagram_loaded);
|
||||
this.do_update_pager();
|
||||
return loaded;
|
||||
},
|
||||
|
|
|
@ -87,12 +87,12 @@
|
|||
dummy_circle.animate({'r': close_button_radius }, 400, 'linear');
|
||||
|
||||
if(entity_type == "node"){
|
||||
$.when(GraphNode.destruction_callback(entity)).then(function () {
|
||||
$.when(GraphNode.destruction_callback(entity)).done(function () {
|
||||
//console.log("remove node",entity);
|
||||
entity.remove();
|
||||
});
|
||||
}else if(entity_type == "edge"){
|
||||
$.when(GraphEdge.destruction_callback(entity)).then(function () {
|
||||
$.when(GraphEdge.destruction_callback(entity)).done(function () {
|
||||
//console.log("remove edge",entity);
|
||||
entity.remove();
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({
|
|||
var self = this;
|
||||
this.fields_view = fields_view_get;
|
||||
this.$el.addClass(this.fields_view.arch.attrs['class']);
|
||||
return this.rpc("/web/searchview/fields_get", {"model": this.dataset.model}).pipe(function(fields_get) {
|
||||
return this.rpc("/web/searchview/fields_get", {"model": this.dataset.model}).then(function(fields_get) {
|
||||
self.fields = fields_get.fields;
|
||||
self.has_been_loaded.resolve();
|
||||
});
|
||||
|
@ -46,11 +46,11 @@ instance.web_gantt.GanttView = instance.web.View.extend({
|
|||
}));
|
||||
fields = _.uniq(fields.concat(n_group_bys));
|
||||
|
||||
return $.when(this.has_been_loaded).pipe(function() {
|
||||
return $.when(this.has_been_loaded).then(function() {
|
||||
return self.dataset.read_slice(fields, {
|
||||
domain: domains,
|
||||
context: contexts
|
||||
}).pipe(function(data) {
|
||||
}).then(function(data) {
|
||||
return self.on_data_loaded(data, n_group_bys);
|
||||
});
|
||||
});
|
||||
|
@ -62,7 +62,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({
|
|||
on_data_loaded: function(tasks, group_bys) {
|
||||
var self = this;
|
||||
var ids = _.pluck(tasks, "id");
|
||||
return this.dataset.name_get(ids).pipe(function(names) {
|
||||
return this.dataset.name_get(ids).then(function(names) {
|
||||
var ntasks = _.map(tasks, function(task) {
|
||||
return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task);
|
||||
});
|
||||
|
|
|
@ -94,7 +94,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
if (self.legend == "top") { self.legend = "inside"; }
|
||||
self.forcehtml = true;
|
||||
|
||||
self.graph_get_data().then(function (result) {
|
||||
self.graph_get_data().done(function (result) {
|
||||
self.graph_render_all(result).download.saveImage('png');
|
||||
}).always(function () {
|
||||
self.forcehtml = false;
|
||||
|
@ -243,7 +243,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
var result = [];
|
||||
var ticks = {};
|
||||
|
||||
return obj.call("fields_view_get", [view_id, 'graph']).pipe(function(tmp) {
|
||||
return obj.call("fields_view_get", [view_id, 'graph']).then(function(tmp) {
|
||||
view_get = tmp;
|
||||
fields = view_get['fields'];
|
||||
var toload = _.select(group_by, function(x) { return fields[x] === undefined });
|
||||
|
@ -251,7 +251,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
return obj.call("fields_get", [toload, context]);
|
||||
else
|
||||
return $.when([]);
|
||||
}).pipe(function (fields_to_add) {
|
||||
}).then(function (fields_to_add) {
|
||||
_.extend(fields, fields_to_add);
|
||||
|
||||
var tree = $($.parseXML(view_get['arch']));
|
||||
|
@ -307,7 +307,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
}
|
||||
|
||||
if (mode === "pie") {
|
||||
return obj.call("read_group", [domain, yaxis.concat([xaxis[0]]), [xaxis[0]]], {context: context}).pipe(function(res) {
|
||||
return obj.call("read_group", [domain, yaxis.concat([xaxis[0]]), [xaxis[0]]], {context: context}).then(function(res) {
|
||||
_.each(res, function(record) {
|
||||
result.push({
|
||||
'data': [[_convert(xaxis[0], record[xaxis[0]]), record[yaxis[0]]]],
|
||||
|
@ -318,11 +318,11 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
} else if ((! stacked) || (xaxis.length < 2)) {
|
||||
var defs = [];
|
||||
_.each(xaxis, function(x) {
|
||||
defs.push(obj.call("read_group", [domain, yaxis.concat([x]), [x]], {context: context}).pipe(function(res) {
|
||||
defs.push(obj.call("read_group", [domain, yaxis.concat([x]), [x]], {context: context}).then(function(res) {
|
||||
return [x, res];
|
||||
}));
|
||||
});
|
||||
return $.when.apply($, defs).pipe(function() {
|
||||
return $.when.apply($, defs).then(function() {
|
||||
_.each(_.toArray(arguments), function(res) {
|
||||
var x = res[0];
|
||||
res = res[1];
|
||||
|
@ -336,15 +336,15 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
});
|
||||
} else {
|
||||
xaxis.reverse();
|
||||
return obj.call("read_group", [domain, yaxis.concat(xaxis.slice(0, 1)), xaxis.slice(0, 1)], {context: context}).pipe(function(axis) {
|
||||
return obj.call("read_group", [domain, yaxis.concat(xaxis.slice(0, 1)), xaxis.slice(0, 1)], {context: context}).then(function(axis) {
|
||||
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}).pipe(function(res) {
|
||||
defs.push(obj.call("read_group", [domain, yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).then(function(res) {
|
||||
return [x, key, res];
|
||||
}));
|
||||
});
|
||||
return $.when.apply($, defs).pipe(function() {
|
||||
return $.when.apply($, defs).then(function() {
|
||||
_.each(_.toArray(arguments), function(res) {
|
||||
var x = res[0];
|
||||
var key = res[1];
|
||||
|
@ -359,7 +359,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
});
|
||||
});
|
||||
}
|
||||
}).pipe(function() {
|
||||
}).then(function() {
|
||||
var res = {
|
||||
'data': result,
|
||||
'ticks': _.map(ticks, function(el, key) { return [el, key] })
|
||||
|
@ -374,7 +374,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
|||
_.extend(this, options.data);
|
||||
|
||||
return this.graph_get_data()
|
||||
.then(this.proxy('graph_render_all'));
|
||||
.done(this.proxy('graph_render_all'));
|
||||
},
|
||||
|
||||
graph_render_all: function (data) {
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
padding: 0;
|
||||
margin: 0px;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title, .openerp .oe_kanban_view .oe_kanban_group_folded.oe_kanban_column > *, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_aggregates, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_add {
|
||||
.openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title, .openerp .oe_kanban_view .oe_kanban_group_folded.oe_kanban_column *, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_aggregates, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_add {
|
||||
display: none;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title_vertical {
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
padding: 0
|
||||
margin: 0px
|
||||
.oe_kanban_group_folded
|
||||
.oe_kanban_group_title, &.oe_kanban_column > *, .oe_kanban_aggregates, .oe_kanban_add
|
||||
.oe_kanban_group_title, &.oe_kanban_column *, .oe_kanban_aggregates, .oe_kanban_add
|
||||
display: none
|
||||
.oe_kanban_group_title_vertical
|
||||
display: block
|
||||
|
|
|
@ -198,7 +198,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
var form = am.dialog_widget.views.form.controller;
|
||||
form.on("on_button_cancel", am.dialog, am.dialog.close);
|
||||
form.on('record_created', self, function(r) {
|
||||
(new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).then(function(new_record) {
|
||||
(new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).done(function(new_record) {
|
||||
am.dialog.close();
|
||||
var domain = self.dataset.domain.slice(0);
|
||||
domain.push([self.group_by, '=', new_record[0][0]]);
|
||||
|
@ -212,7 +212,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
aggregates: {},
|
||||
};
|
||||
var new_group = new instance.web_kanban.KanbanGroup(self, [], datagroup, dataset);
|
||||
self.do_add_groups([new_group]).then(function() {
|
||||
self.do_add_groups([new_group]).done(function() {
|
||||
$(window).scrollTo(self.groups.slice(-1)[0].$el, { axis: 'x' });
|
||||
});
|
||||
});
|
||||
|
@ -224,14 +224,14 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
this.search_domain = domain;
|
||||
this.search_context = context;
|
||||
this.search_group_by = group_by;
|
||||
$.when(this.has_been_loaded).then(function() {
|
||||
$.when(this.has_been_loaded).done(function() {
|
||||
self.group_by = group_by.length ? group_by[0] : self.fields_view.arch.attrs.default_group_by;
|
||||
self.group_by_field = self.fields_view.fields[self.group_by] || {};
|
||||
self.grouped_by_m2o = (self.group_by_field.type === 'many2one');
|
||||
self.$buttons.find('.oe_alternative').toggle(self.grouped_by_m2o);
|
||||
self.$el.toggleClass('oe_kanban_grouped_by_m2o', self.grouped_by_m2o);
|
||||
var grouping = new instance.web.Model(self.dataset.model, context, domain).query().group_by(self.group_by);
|
||||
$.when(grouping).then(function(groups) {
|
||||
$.when(grouping).done(function(groups) {
|
||||
if (groups) {
|
||||
self.do_process_groups(groups);
|
||||
} else {
|
||||
|
@ -252,7 +252,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
var dataset = new instance.web.DataSetSearch(self, self.dataset.model,
|
||||
new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain());
|
||||
return dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit })
|
||||
.pipe(function(records) {
|
||||
.then(function(records) {
|
||||
self.dataset.ids.push.apply(self.dataset.ids, dataset.ids);
|
||||
groups_array[index] = new instance.web_kanban.KanbanGroup(self, records, group, dataset);
|
||||
if (!remaining--) {
|
||||
|
@ -268,16 +268,16 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
this.$el.removeClass('oe_kanban_grouped').addClass('oe_kanban_ungrouped');
|
||||
this.add_group_mutex.exec(function() {
|
||||
var def = $.Deferred();
|
||||
self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).then(function(records) {
|
||||
self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).done(function(records) {
|
||||
self.do_clear_groups();
|
||||
var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset);
|
||||
self.do_add_groups([kgroup]).then(function() {
|
||||
self.do_add_groups([kgroup]).done(function() {
|
||||
if (_.isEmpty(records)) {
|
||||
self.no_result();
|
||||
}
|
||||
def.resolve();
|
||||
});
|
||||
}).then(null, function() {
|
||||
}).done(null, function() {
|
||||
def.reject();
|
||||
});
|
||||
return def;
|
||||
|
@ -306,7 +306,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
return group.insertBefore($last_td);
|
||||
}
|
||||
});
|
||||
return $.when.apply(null, groups_started).then(function () {
|
||||
return $.when.apply(null, groups_started).done(function () {
|
||||
self.on_groups_started();
|
||||
self.$el.appendTo($parent);
|
||||
_.each(self.groups, function(group) {
|
||||
|
@ -375,7 +375,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
var tmp_group = self.groups.splice(start_index, 1)[0];
|
||||
self.groups.splice(stop_index, 0, tmp_group);
|
||||
var new_sequence = _.pluck(self.groups, 'value');
|
||||
(new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).then(function(r) {
|
||||
(new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).done(function(r) {
|
||||
if (r === false) {
|
||||
console.error("Kanban: could not resequence model '%s'. Probably no 'sequence' field.", self.group_by_field.relation);
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
record.group = new_group;
|
||||
var data = {};
|
||||
data[this.group_by] = new_group.value;
|
||||
this.dataset.write(record.id, data, {}).then(function() {
|
||||
this.dataset.write(record.id, data, {}).done(function() {
|
||||
record.do_reload();
|
||||
new_group.do_save_sequences();
|
||||
}).fail(function(error, evt) {
|
||||
|
@ -497,7 +497,7 @@ instance.web_kanban.KanbanView.postprocessing_widget_many2many_tags = function(s
|
|||
if(model_list_id[model].length>0){
|
||||
var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']");
|
||||
var dataset = new instance.web.DataSetSearch(self, model, self.session.context);
|
||||
dataset.name_get(_.uniq( model_list_id[model] )).then(
|
||||
dataset.name_get(_.uniq( model_list_id[model] )).done(
|
||||
function(result) {
|
||||
for(var t=0;t<result.length;t++){
|
||||
block.filter(function(){ return this.getAttribute("data").match(new RegExp('(^|,)'+result[t][0]+'(,|$)')); })
|
||||
|
@ -557,7 +557,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
|||
this.$records = null;
|
||||
|
||||
this.records = [];
|
||||
this.$has_been_started.then(function() {
|
||||
this.$has_been_started.done(function() {
|
||||
self.do_add_records(records);
|
||||
});
|
||||
},
|
||||
|
@ -638,10 +638,16 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
|||
},
|
||||
do_show_more: function(evt) {
|
||||
var self = this;
|
||||
this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), {
|
||||
return this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), {
|
||||
'limit': self.view.limit,
|
||||
'offset': self.dataset_offset += self.view.limit
|
||||
}).then(this.do_add_records);
|
||||
}).then(function(records) {
|
||||
records.forEach(function(r) {
|
||||
self.view.dataset.ids.push(r.id);
|
||||
});
|
||||
self.do_add_records(records);
|
||||
return records;
|
||||
});
|
||||
},
|
||||
do_add_records: function(records, prepend) {
|
||||
var self = this;
|
||||
|
@ -704,7 +710,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
|||
do_action_delete: function() {
|
||||
var self = this;
|
||||
if (confirm(_t("Are you sure to remove this column ?"))) {
|
||||
(new instance.web.DataSet(self, self.view.group_by_field.relation)).unlink([self.value]).then(function(r) {
|
||||
(new instance.web.DataSet(self, self.view.group_by_field.relation)).unlink([self.value]).done(function(r) {
|
||||
self.view.do_reload();
|
||||
});
|
||||
}
|
||||
|
@ -724,7 +730,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
|||
quick_created: function (record) {
|
||||
var id = record, self = this;
|
||||
this.dataset.read_ids([id], this.view.fields_keys)
|
||||
.then(function (records) {
|
||||
.done(function (records) {
|
||||
self.view.dataset.ids.push(id);
|
||||
self.do_add_records(records, true);
|
||||
});
|
||||
|
@ -838,13 +844,13 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
|
|||
|
||||
if (this.$el.find('.oe_kanban_global_click,.oe_kanban_global_click_edit').length) {
|
||||
this.$el.on('click', function(ev) {
|
||||
if (!ev.isTrigger && !$(ev.target).data('events')) {
|
||||
if (!ev.isTrigger && !$._data(ev.target, 'events')) {
|
||||
var trigger = true;
|
||||
var elem = ev.target;
|
||||
var ischild = true;
|
||||
var children = [];
|
||||
while (elem) {
|
||||
var events = $(elem).data('events');
|
||||
var events = $._data(elem, 'events');
|
||||
if (elem == ev.currentTarget) {
|
||||
ischild = false;
|
||||
}
|
||||
|
@ -899,7 +905,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
|
|||
var color_field = $(this).parents('.oe_kanban_colorpicker').first().data('field') || 'color';
|
||||
var data = {};
|
||||
data[color_field] = $(this).data('color');
|
||||
self.view.dataset.write(self.id, data, {}).then(function() {
|
||||
self.view.dataset.write(self.id, data, {}).done(function() {
|
||||
self.record[color_field] = $(this).data('color');
|
||||
self.do_reload();
|
||||
});
|
||||
|
@ -909,7 +915,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
|
|||
do_action_delete: function($action) {
|
||||
var self = this;
|
||||
function do_it() {
|
||||
return $.when(self.view.dataset.unlink([self.id])).then(function() {
|
||||
return $.when(self.view.dataset.unlink([self.id])).done(function() {
|
||||
self.group.remove_record(self.id);
|
||||
self.destroy();
|
||||
});
|
||||
|
@ -933,7 +939,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
|
|||
},
|
||||
do_reload: function() {
|
||||
var self = this;
|
||||
this.view.dataset.read_ids([this.id], this.view.fields_keys.concat(['__last_update'])).then(function(records) {
|
||||
this.view.dataset.read_ids([this.id], this.view.fields_keys.concat(['__last_update'])).done(function(records) {
|
||||
if (records.length) {
|
||||
self.set_record(records[0]);
|
||||
self.renderElement();
|
||||
|
@ -1063,7 +1069,7 @@ instance.web_kanban.QuickCreate = instance.web.Widget.extend({
|
|||
this._dataset.call(
|
||||
'name_create', [self.$input.val() || false, new instance.web.CompoundContext(
|
||||
this._dataset.get_context(), this._context)])
|
||||
.pipe(function(record) {
|
||||
.then(function(record) {
|
||||
self.$input.val("");
|
||||
self.trigger('added', record[0]);
|
||||
}, function(error, event) {
|
||||
|
|
|
@ -18,7 +18,7 @@ openerp.web_tests = function (instance) {
|
|||
start: function () {
|
||||
$.when(
|
||||
this.dataset.read_slice(),
|
||||
this.form.appendTo(this.$el)).then(this.on_everything_loaded);
|
||||
this.form.appendTo(this.$el)).done(this.on_everything_loaded);
|
||||
},
|
||||
on_everything_loaded: function (slice) {
|
||||
var records = slice[0].records;
|
||||
|
|
|
@ -70,7 +70,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
this.main_view_id = this.parent.fields_view.view_id;
|
||||
this.action_manager = new instance.web.ActionManager(this);
|
||||
this.action_manager.appendTo(this.view_edit_dialog.$el);
|
||||
$.when(this.action_manager.do_action(action)).then(function() {
|
||||
$.when(this.action_manager.do_action(action)).done(function() {
|
||||
var viewmanager = self.action_manager.inner_widget;
|
||||
var controller = viewmanager.views[viewmanager.active_view].controller;
|
||||
controller.on('view_loaded', self, function(){
|
||||
|
@ -102,7 +102,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
if (warn) {
|
||||
self.on_valid_create_view(self.create_view_widget);
|
||||
} else {
|
||||
$.when(self.do_save_view(view_values)).then(function() {
|
||||
$.when(self.do_save_view(view_values)).done(function() {
|
||||
self.create_view_dialog.close();
|
||||
var controller = self.action_manager.inner_widget.views[self.action_manager.inner_widget.active_view].controller;
|
||||
controller.reload_content();
|
||||
|
@ -135,7 +135,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
var field_dataset = new instance.web.DataSetSearch(this, this.model, null, null);
|
||||
var model_dataset = new instance.web.DataSetSearch(this, 'ir.model', null, null);
|
||||
var view_string = "", field_name = false, self = this;
|
||||
field_dataset.call( 'fields_get', []).then(function(fields) {
|
||||
field_dataset.call( 'fields_get', []).done(function(fields) {
|
||||
_.each(['name', 'x_name'], function(value) {
|
||||
if (_.include(_.keys(fields), value)) {
|
||||
field_name = value;
|
||||
|
@ -143,7 +143,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
if (field_name) {
|
||||
model_dataset.read_slice(['name','field_id'], {"domain": [['model','=',self.model]]}).then(function(records) {
|
||||
model_dataset.read_slice(['name','field_id'], {"domain": [['model','=',self.model]]}).done(function(records) {
|
||||
if (records) {view_string = records[0].name;}
|
||||
var arch = _.str.sprintf("<?xml version='1.0'?>\n<%s string='%s'>\n\t<field name='%s'/>\n</%s>", values.view_type, view_string, field_name, values.view_type);
|
||||
var vals = {'model': self.model, 'name': values.view_name, 'priority': values.priority, 'type': values.view_type, 'arch': arch};
|
||||
|
@ -182,7 +182,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
var self = this;
|
||||
if (confirm(_t("Do you really want to remove this view?"))) {
|
||||
var controller = this.action_manager.inner_widget.views[this.action_manager.inner_widget.active_view].controller;
|
||||
this.dataset.unlink([this.main_view_id]).then(function() {
|
||||
this.dataset.unlink([this.main_view_id]).done(function() {
|
||||
controller.reload_content();
|
||||
self.main_view_id = self.parent.fields_view.view_id;
|
||||
});
|
||||
|
@ -245,12 +245,12 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
get_arch: function() {
|
||||
var self = this;
|
||||
var view_arch_list = [];
|
||||
this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type','priority']).then(function(arch) {
|
||||
this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type','priority']).done(function(arch) {
|
||||
if (arch.length) {
|
||||
var arch_object = self.parse_xml(arch[0].arch, self.main_view_id);
|
||||
self.main_view_type = arch[0].type == 'tree'? 'list': arch[0].type;
|
||||
view_arch_list.push({"view_id": self.main_view_id, "arch": arch[0].arch,"priority":arch[0].priority});
|
||||
self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}).then(function(result) {
|
||||
self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}).done(function(result) {
|
||||
_.each(result, function(res) {
|
||||
view_arch_list.push({"view_id": res.id, "arch": res.arch,"priority":res.priority});
|
||||
self.inherit_view(arch_object, res);
|
||||
|
@ -455,7 +455,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
var priority = _.detect(self.one_object['arch'], function(val) {return val.view_id == view_id;});
|
||||
var arch = _.str.sprintf("<?xml version='1.0'?>\n\t <field name='%s' position='after'> </field>", val[1]);
|
||||
var vals = {'model': self.model, 'name': view_name, 'priority': priority.priority + 1, 'type': "form", 'arch': arch,'inherit_id':self.main_view_id};
|
||||
this.dataset.create(vals).then(function(id) {
|
||||
this.dataset.create(vals).done(function(id) {
|
||||
var arch_to_obj = self.parse_xml(arch,id);
|
||||
obj.child_id.push(arch_to_obj[0]);
|
||||
self.one_object['parent_child_id'] = self.parent_child_list(self.one_object['main_object'],[]);
|
||||
|
@ -538,7 +538,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false;
|
||||
property_to_check.push(value);
|
||||
});
|
||||
field_dataset.call( 'fields_get', []).then(function(result) {
|
||||
field_dataset.call( 'fields_get', []).done(function(result) {
|
||||
var fields = _.keys(result);
|
||||
fields.push(" "),fields.sort();
|
||||
self.on_add_node(property_to_check, fields);
|
||||
|
@ -890,7 +890,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
var arch_val = self.get_object_by_id(this.one_object.clicked_tr_id,this.one_object['main_object'], []);
|
||||
this.edit_node_dialog.$el.append('<table id="rec_table" style="width:400px" class="oe_form"></table>');
|
||||
this.edit_widget = [];
|
||||
self.ready = $.when(self.on_groups(properties)).then(function () {
|
||||
self.ready = $.when(self.on_groups(properties)).done(function () {
|
||||
_PROPERTIES_ATTRIBUTES['groups']['selection'] = self.groups;
|
||||
var values = _.keys( instance.web.form.widgets.map);
|
||||
values.push('');
|
||||
|
@ -993,7 +993,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
table_selector.find("td[id^=]").attr("width","100px");
|
||||
self.add_node_dialog.$el.find('#new_field').click(function() {
|
||||
model_data = new instance.web.DataSetSearch(self,'ir.model', null, null);
|
||||
model_data.read_slice([], {domain: [['model','=', self.model]]}).then(function(result) {
|
||||
model_data.read_slice([], {domain: [['model','=', self.model]]}).done(function(result) {
|
||||
self.render_new_field(result[0]);
|
||||
});
|
||||
});
|
||||
|
@ -1011,7 +1011,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
|||
}
|
||||
};
|
||||
var action_manager = new instance.web.ActionManager(self);
|
||||
$.when(action_manager.do_action(action)).then(function() {
|
||||
$.when(action_manager.do_action(action)).done(function() {
|
||||
var controller = action_manager.dialog_widget.views['form'].controller;
|
||||
controller.on("on_button_cancel", self, function(){
|
||||
action_manager.destroy();
|
||||
|
|