[merge]
bzr revid: nicolas.vanhoren@openerp.com-20120124152239-yjtsn0j2yt4gif5e
This commit is contained in:
commit
31cdf276a2
3
Makefile
3
Makefile
|
@ -29,3 +29,6 @@ doc:
|
|||
cloc:
|
||||
cloc addons/*/common/*.py addons/*/controllers/*.py addons/*/static/src/*.js addons/*/static/src/js/*.js addons/*/static/src/css/*.css addons/*/static/src/xml/*.xml
|
||||
|
||||
blamestat:
|
||||
echo addons/*/common/*.py addons/*/controllers/*.py addons/*/static/src/js/*.js addons/*/static/src/css/*.css addons/*/static/src/xml/*.xml | xargs -t -n 1 bzr blame -v --long --all | awk '{print $2}' | sort | uniq -c | sort -n
|
||||
|
||||
|
|
|
@ -145,21 +145,22 @@ class JsonRequest(WebRequest):
|
|||
jsonp = args.get('jsonp')
|
||||
requestf = None
|
||||
request = None
|
||||
request_id = args.get('id')
|
||||
|
||||
if jsonp and self.httprequest.method == 'POST':
|
||||
# jsonp 2 steps step1 POST: save call
|
||||
self.init(args)
|
||||
req.session.jsonp_requests[args.get('id')] = self.httprequest.form['r']
|
||||
self.session.jsonp_requests[request_id] = self.httprequest.form['r']
|
||||
headers=[('Content-Type', 'text/plain; charset=utf-8')]
|
||||
r = werkzeug.wrappers.Response(request_id, headers=headers)
|
||||
return r
|
||||
elif jsonp and args.get('r'):
|
||||
# jsonp method GET
|
||||
request = args.get('r')
|
||||
elif jsonp and args.get('id'):
|
||||
elif jsonp and request_id:
|
||||
# jsonp 2 steps step2 GET: run and return result
|
||||
self.init(args)
|
||||
request = self.session.jsonp_requests.pop(args.get(id), "")
|
||||
request = self.session.jsonp_requests.pop(request_id, "")
|
||||
else:
|
||||
# regular jsonrpc2
|
||||
requestf = self.httprequest.stream
|
||||
|
@ -354,7 +355,7 @@ def session_context(request, storage_path, session_cookie='sessionid'):
|
|||
# Remove all OpenERPSession instances with no uid, they're generated
|
||||
# either by login process or by HTTP requests without an OpenERP
|
||||
# session id, and are generally noise
|
||||
removed_sessions = []
|
||||
removed_sessions = set()
|
||||
for key, value in request.session.items():
|
||||
if (isinstance(value, session.OpenERPSession)
|
||||
and not value._uid
|
||||
|
@ -362,7 +363,7 @@ def session_context(request, storage_path, session_cookie='sessionid'):
|
|||
and value._creation_time + (60*5) < time.time() # FIXME do not use a fixed value
|
||||
):
|
||||
_logger.debug('remove session %s', key)
|
||||
removed_sessions.append(key)
|
||||
removed_sessions.add(key)
|
||||
del request.session[key]
|
||||
|
||||
with session_lock:
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html style="height: 100%%">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>OpenERP</title>
|
||||
<link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
|
||||
%(css)s
|
||||
%(js)s
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var s = new openerp.init(%(modules)s);
|
||||
var webclient = new s.web.WebClient();
|
||||
webclient.$element = $(document.body);
|
||||
webclient.start();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="openerp" id="oe">
|
||||
<!-- should add a loading message? -->
|
||||
</body>
|
||||
</html>
|
|
@ -6,6 +6,7 @@ import csv
|
|||
import glob
|
||||
import itertools
|
||||
import operator
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
import simplejson
|
||||
|
@ -84,9 +85,24 @@ def concat_files(file_list, reader=None, intersperse=""):
|
|||
files_concat = intersperse.join(files_content)
|
||||
return files_concat,files_timestamp
|
||||
|
||||
html_template = None
|
||||
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "main.html")) as html_file:
|
||||
html_template = html_file.read()
|
||||
html_template = """<!DOCTYPE html>
|
||||
<html style="height: 100%%">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>OpenERP</title>
|
||||
<link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
|
||||
%(css)s
|
||||
%(js)s
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var s = new openerp.init(%(modules)s);
|
||||
%(init)s
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="openerp" id="oe"></body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
class WebClient(openerpweb.Controller):
|
||||
_cp_path = "/web/webclient"
|
||||
|
@ -192,6 +208,7 @@ class WebClient(openerpweb.Controller):
|
|||
'js': js,
|
||||
'css': css,
|
||||
'modules': simplejson.dumps(self.server_wide_modules(req)),
|
||||
'init': 'new s.web.WebClient().start();',
|
||||
}
|
||||
return r
|
||||
|
||||
|
@ -323,9 +340,14 @@ class Database(openerpweb.Controller):
|
|||
def backup(self, req, backup_db, backup_pwd, token):
|
||||
db_dump = base64.b64decode(
|
||||
req.session.proxy("db").dump(backup_pwd, backup_db))
|
||||
filename = "%(db)s_%(timestamp)s.dump" % {
|
||||
'db': backup_db,
|
||||
'timestamp': datetime.datetime.utcnow().strftime(
|
||||
"%Y-%m-%d_%H-%M-%SZ")
|
||||
}
|
||||
return req.make_response(db_dump,
|
||||
[('Content-Type', 'application/octet-stream; charset=binary'),
|
||||
('Content-Disposition', 'attachment; filename="' + backup_db + '.dump"')],
|
||||
('Content-Disposition', 'attachment; filename="' + filename + '"')],
|
||||
{'fileToken': int(token)}
|
||||
)
|
||||
|
||||
|
@ -858,7 +880,7 @@ class DataSet(openerpweb.Controller):
|
|||
:return: result of the onchange call with all domains parsed
|
||||
"""
|
||||
result = self.call_common(req, model, method, args, context_id=context_id)
|
||||
if 'domain' not in result:
|
||||
if not result or 'domain' not in result:
|
||||
return result
|
||||
|
||||
result['domain'] = dict(
|
||||
|
|
|
@ -8,14 +8,14 @@ msgstr ""
|
|||
"Project-Id-Version: openerp-web\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2011-12-20 18:48+0100\n"
|
||||
"PO-Revision-Date: 2011-12-21 15:10+0000\n"
|
||||
"Last-Translator: Goran Kliska <gkliska@gmail.com>\n"
|
||||
"PO-Revision-Date: 2012-01-23 17:37+0000\n"
|
||||
"Last-Translator: Goran Cvijanović <goranc@gmail.com>\n"
|
||||
"Language-Team: Croatian <hr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-01-04 05:17+0000\n"
|
||||
"X-Generator: Launchpad (build 14616)\n"
|
||||
"X-Launchpad-Export-Date: 2012-01-24 05:44+0000\n"
|
||||
"X-Generator: Launchpad (build 14713)\n"
|
||||
|
||||
#: addons/web/static/src/js/chrome.js:162
|
||||
#: addons/web/static/src/js/chrome.js:175
|
||||
|
@ -107,7 +107,7 @@ msgstr "Neispravno traženje"
|
|||
|
||||
#: addons/web/static/src/js/search.js:403
|
||||
msgid "triggered from search view"
|
||||
msgstr ""
|
||||
msgstr "pokrenuto iz ekrana za pretraživanje"
|
||||
|
||||
#: addons/web/static/src/js/search.js:490
|
||||
#, python-format
|
||||
|
@ -206,7 +206,7 @@ msgstr "je laž"
|
|||
|
||||
#: addons/web/static/src/js/view_editor.js:42
|
||||
msgid "ViewEditor"
|
||||
msgstr ""
|
||||
msgstr "Uređivač"
|
||||
|
||||
#: addons/web/static/src/js/view_editor.js:46
|
||||
#: addons/web/static/src/js/view_list.js:17
|
||||
|
@ -538,20 +538,23 @@ msgid ""
|
|||
"We think that daily job activities can be more intuitive, efficient, "
|
||||
"automated, .. and even fun."
|
||||
msgstr ""
|
||||
"Mi smatramo da dnevne poslovne aktivnosti mogu biti intuitivnije, "
|
||||
"efikasnije, automatizirane, .. i zabavne."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "OpenERP's vision to be:"
|
||||
msgstr ""
|
||||
msgstr "Vizija OpenERP-a da postane:"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Full featured"
|
||||
msgstr ""
|
||||
msgstr "Pune funkcionalnosti"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid ""
|
||||
"Today's enterprise challenges are multiple. We provide one module for each "
|
||||
"need."
|
||||
msgstr ""
|
||||
"Mnoštvo je izazova danas pred tvrtkama. Mi imamo modul za svaku od potreba."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Open Source"
|
||||
|
@ -562,15 +565,18 @@ msgid ""
|
|||
"To Build a great product, we rely on the knowledge of thousands of "
|
||||
"contributors."
|
||||
msgstr ""
|
||||
"Za izgradnju vrhunskog rješenja, osanjamo se na znanja tisuće kontributora."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "User Friendly"
|
||||
msgstr ""
|
||||
msgstr "prilagođen korisniku"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid ""
|
||||
"In order to be productive, people need clean and easy to use interface."
|
||||
msgstr ""
|
||||
"Da bi bili produktivni, ljudi trebaju uredno i jednostavno korisničko "
|
||||
"sučelje."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "("
|
||||
|
@ -618,7 +624,7 @@ msgstr "Debug pogled#"
|
|||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "- Fields View Get"
|
||||
msgstr ""
|
||||
msgstr "Dohvat polja ekrana"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "- Edit"
|
||||
|
@ -630,11 +636,11 @@ msgstr "Pogled"
|
|||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "- Edit SearchView"
|
||||
msgstr ""
|
||||
msgstr "Uredi ekran za pretraživanje"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "- Edit Action"
|
||||
msgstr ""
|
||||
msgstr "- Uredi akciju"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Field"
|
||||
|
@ -662,11 +668,11 @@ msgstr "Dupliciraj"
|
|||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Unhandled widget"
|
||||
msgstr ""
|
||||
msgstr "Nepodržani ekranski dodatak"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Notebook Page \""
|
||||
msgstr ""
|
||||
msgstr "Stranica \""
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "\""
|
||||
|
@ -674,7 +680,7 @@ msgstr "\""
|
|||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Modifiers:"
|
||||
msgstr ""
|
||||
msgstr "Izmjene:"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "?"
|
||||
|
@ -778,7 +784,7 @@ msgstr "Gumb"
|
|||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "(no string)"
|
||||
msgstr ""
|
||||
msgstr "(prazno)"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Special:"
|
||||
|
@ -822,7 +828,7 @@ msgstr "(Zamjenit će postojeći filter istog naziva)"
|
|||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Select Dashboard to add this filter to:"
|
||||
msgstr ""
|
||||
msgstr "Odaberite panel za dodati ovaj filter:"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Title of new Dashboard item:"
|
||||
|
@ -867,6 +873,10 @@ msgid ""
|
|||
" You can export all data or only the fields that can be "
|
||||
"reimported after modification."
|
||||
msgstr ""
|
||||
"Ovaj pomoćni program će izvesti u CSV datoteku sve podatke koji "
|
||||
"zadovoljavaju postavljene uvjete.\n"
|
||||
" Možete izvesti sve kolone ili samo one koje se mogu ponovno "
|
||||
"učitati nakon izmjena."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Export Type:"
|
||||
|
@ -937,6 +947,10 @@ msgid ""
|
|||
"Select a .CSV file to import. If you need a sample of file to import,\n"
|
||||
" you should use the export tool with the \"Import Compatible\" option."
|
||||
msgstr ""
|
||||
"Odaberite .CSV datoteku za uvoz. Ukoliko trebate primjer za izgled "
|
||||
"datoteke,\n"
|
||||
" možete napraviti izvoz podataka koristeći \"Kompatibilnost za uvoz\" "
|
||||
"opciju."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "CSV File:"
|
||||
|
@ -984,7 +998,7 @@ msgstr "Uvoz nije izvršen:"
|
|||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "Here is a preview of the file we could not import:"
|
||||
msgstr ""
|
||||
msgstr "Ovo je pregled datoteke koja se nije mogla uvesti:"
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid "OpenERP Web"
|
||||
|
@ -1031,6 +1045,12 @@ msgid ""
|
|||
"supply chain,\n"
|
||||
" project management, production, services, CRM, etc..."
|
||||
msgstr ""
|
||||
"je slobodan poslovni softver dizajniran za unapređenje\n"
|
||||
" produktivnost i profitabilnost kroz integraciju podataka. "
|
||||
"Povezuje, unapređuje i\n"
|
||||
" upravlja poslovnim procesima u područjima poput prodaje, "
|
||||
"financija, nabave,\n"
|
||||
" upravljanja projektima, proizvodnje, usluga, CRM, itd."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid ""
|
||||
|
@ -1043,9 +1063,16 @@ msgid ""
|
|||
" production system and migration to a new version to be "
|
||||
"straightforward."
|
||||
msgstr ""
|
||||
"Sustav je neovisan o platformi i može se instalirati na Windows, Mac OS X,\n"
|
||||
" i različitim verzijama Linux i drugih Unix zasnovanih "
|
||||
"distribucija. Arhitektura omogućava\n"
|
||||
" brzo dodavanje novih funkcionalnosti, izmjene na produkcijskom "
|
||||
"sustavu i,\n"
|
||||
" olakšanu migraciju na nove verzije."
|
||||
|
||||
#: addons/web/static/src/xml/base.xml:0
|
||||
msgid ""
|
||||
"Depending on your needs, OpenERP is available through a web or application "
|
||||
"client."
|
||||
msgstr ""
|
||||
"Ovisno o potrebama, OpenERP je dostupan kao web ili klasična aplikacija."
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
<t t-jquery="hr:eq(1)" t-operation="replace"><footer></footer></t>
|
||||
</t>
|
||||
<t t-extend="jquery-extend">
|
||||
<t t-jquery="footer" t-operation="inner"><b>END</b></t>
|
||||
<t t-jquery="footer" t-operation="inner"><b>[[end]]</b></t>
|
||||
</t>
|
||||
|
||||
<t t-name="jquery-extend-clone" t-extend="jquery-extend">
|
||||
<t t-jquery="ul" t-operation="append"><li>CLONED TEMPLATE</li></t>
|
||||
<t t-jquery="ul" t-operation="append"><li>[[cloned template]]</li></t>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<templates>
|
||||
<templates xml:space="preserve">
|
||||
<t t-name="repetition-text-content" t-foreach="seq">*</t>
|
||||
<t t-name="repetition-dom-content" t-foreach="seq"><b/></t>
|
||||
<b t-name="repetition-self" t-foreach="seq"/>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen"/>
|
||||
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/base/static/lib/jquery/jquery-1.5.2.js"></script>
|
||||
<script type="text/javascript" src="qweb2.js"></script>
|
||||
|
||||
<script>
|
||||
|
@ -14,7 +13,7 @@
|
|||
return s.replace(/(^\s+|\s+$)/g, '');
|
||||
}
|
||||
function render(template, context) {
|
||||
return trim(QWeb.render(template, context));
|
||||
return trim(QWeb.render(template, context)).toLowerCase();
|
||||
}
|
||||
$(document).ready(function() {
|
||||
module("Basic output tests", {
|
||||
|
@ -209,9 +208,9 @@
|
|||
test('Basic foreach repetition', function () {
|
||||
equals(QWeb.render('repetition-text-content', {seq:seq}), '*****',
|
||||
"Repetition of text content via foreach");
|
||||
equals(QWeb.render('repetition-dom-content', {seq:seq}), '<b/><b/><b/><b/><b/>',
|
||||
equals(QWeb.render('repetition-dom-content', {seq:seq}).toLowerCase(), '<b/><b/><b/><b/><b/>',
|
||||
"Repetition of node content via foreach");
|
||||
equals(QWeb.render('repetition-self', {seq:seq}), '<b/><b/><b/><b/><b/>',
|
||||
equals(QWeb.render('repetition-self', {seq:seq}).toLowerCase(), '<b/><b/><b/><b/><b/>',
|
||||
"A node with a foreach repeats itself");
|
||||
});
|
||||
test("Foreach scope content", function () {
|
||||
|
@ -249,9 +248,9 @@
|
|||
});
|
||||
|
||||
test("jQuery extend", function () {
|
||||
equals(render('jquery-extend', {}), '<hr/><ul class="main"><li>1</li><li>2</li><li>3</li></ul><footer><b>END</b></footer>',
|
||||
equals(render('jquery-extend', {}), '<hr/><ul class="main"><li>1</li><li>2</li><li>3</li></ul><footer><b>[[end]]</b></footer>',
|
||||
"Extend template with jQuery");
|
||||
equals(render('jquery-extend-clone', {}), '<ul><li>one</li><li>CLONED TEMPLATE</li></ul>',
|
||||
equals(render('jquery-extend-clone', {}), '<ul><li>one</li><li>[[cloned template]]</li></ul>',
|
||||
"Clone template");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -93,10 +93,16 @@ var QWeb2 = {
|
|||
}
|
||||
return r.join('');
|
||||
} else {
|
||||
if (node.xml !== undefined) {
|
||||
return node.xml;
|
||||
} else {
|
||||
if (typeof XMLSerializer !== 'undefined') {
|
||||
return (new XMLSerializer()).serializeToString(node);
|
||||
} else {
|
||||
switch(node.nodeType) {
|
||||
case 1: return node.outerHTML;
|
||||
case 3: return node.data;
|
||||
case 4: return '<![CDATA[' + node.data + ']]>';
|
||||
case 8: return '<!-- ' + node.data + '-->';
|
||||
}
|
||||
throw new Error('Unknown node type ' + node.nodeType);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -265,11 +271,16 @@ QWeb2.Engine = (function() {
|
|||
}
|
||||
req.open('GET', s, false);
|
||||
req.send(null);
|
||||
if (req.responseXML) {
|
||||
if (req.responseXML.documentElement.nodeName == "parsererror") {
|
||||
return this.tools.exception(req.responseXML.documentElement.childNodes[0].nodeValue);
|
||||
var xDoc = req.responseXML;
|
||||
if (xDoc) {
|
||||
if (xDoc.documentElement.nodeName == "parsererror") {
|
||||
return this.tools.exception(xDoc.documentElement.childNodes[0].nodeValue);
|
||||
}
|
||||
return req.responseXML;
|
||||
if (xDoc.xml !== undefined) {
|
||||
// MSIE
|
||||
return this.convert_xml_to_html(xDoc.documentElement);
|
||||
}
|
||||
return xDoc;
|
||||
} else {
|
||||
return this.load_xml_string(req.responseText);
|
||||
}
|
||||
|
@ -295,7 +306,25 @@ QWeb2.Engine = (function() {
|
|||
xDoc.async = false;
|
||||
xDoc.preserveWhiteSpace = true;
|
||||
xDoc.loadXML(s);
|
||||
return xDoc;
|
||||
return this.convert_xml_to_html(xDoc.documentElement);
|
||||
},
|
||||
convert_xml_to_html: function (node) {
|
||||
switch (node.nodeType) {
|
||||
case 3:
|
||||
case 4:
|
||||
return document.createTextNode(node.data);
|
||||
case 8: return document.createComment(node.data);
|
||||
}
|
||||
|
||||
var hnode = document.createElement(node.nodeName);
|
||||
for(var i=0, alen=node.attributes.length; i < alen; ++i) {
|
||||
var attr = node.attributes[i];
|
||||
hnode.setAttribute(attr.name, attr.value);
|
||||
}
|
||||
for(var j=0, clen=node.childNodes.length; j < clen; ++j) {
|
||||
hnode.appendChild(this.convert_xml_to_html(node.childNodes[j]));
|
||||
}
|
||||
return hnode;
|
||||
},
|
||||
has_template : function(template) {
|
||||
return !!this.templates[template];
|
||||
|
@ -373,12 +402,7 @@ QWeb2.Engine = (function() {
|
|||
if (!this.jQuery) {
|
||||
return this.tools.exception("Can't extend template " + template + " without jQuery");
|
||||
}
|
||||
var template_dest = this.templates[template],
|
||||
msie_trololo = false;
|
||||
if (template_dest.xml !== undefined) {
|
||||
template_dest = this.jQuery(template_dest.xml);
|
||||
msie_trololo = true;
|
||||
}
|
||||
var template_dest = this.templates[template];
|
||||
for (var i = 0, ilen = extend_node.childNodes.length; i < ilen; i++) {
|
||||
var child = extend_node.childNodes[i];
|
||||
if (child.nodeType === 1) {
|
||||
|
@ -421,9 +445,6 @@ QWeb2.Engine = (function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (msie_trololo) {
|
||||
this.templates[template] = template_dest[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
return Engine;
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
arg = argv[cursor];
|
||||
for (k = 0; k < match[2].length; k++) {
|
||||
if (!arg.hasOwnProperty(match[2][k])) {
|
||||
throw(sprintf('[_.sprintf] property "%s" does not exist', match[2][k]));
|
||||
throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k]));
|
||||
}
|
||||
arg = arg[match[2][k]];
|
||||
}
|
||||
|
@ -85,7 +85,7 @@
|
|||
}
|
||||
|
||||
if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
|
||||
throw(sprintf('[_.sprintf] expecting number but found %s', get_type(arg)));
|
||||
throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg)));
|
||||
}
|
||||
switch (match[8]) {
|
||||
case 'b': arg = arg.toString(2); break;
|
||||
|
@ -134,12 +134,12 @@
|
|||
field_list.push(field_match[1]);
|
||||
}
|
||||
else {
|
||||
throw('[_.sprintf] huh?');
|
||||
throw new Error('[_.sprintf] huh?');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw('[_.sprintf] huh?');
|
||||
throw new Error('[_.sprintf] huh?');
|
||||
}
|
||||
match[2] = field_list;
|
||||
}
|
||||
|
@ -147,12 +147,12 @@
|
|||
arg_names |= 2;
|
||||
}
|
||||
if (arg_names === 3) {
|
||||
throw('[_.sprintf] mixing positional and named placeholders is not (yet) supported');
|
||||
throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported');
|
||||
}
|
||||
parse_tree.push(match);
|
||||
}
|
||||
else {
|
||||
throw('[_.sprintf] huh?');
|
||||
throw new Error('[_.sprintf] huh?');
|
||||
}
|
||||
_fmt = _fmt.substring(match[0].length);
|
||||
}
|
||||
|
|
|
@ -5,9 +5,8 @@ openerp.web.chrome = function(openerp) {
|
|||
var QWeb = openerp.web.qweb,
|
||||
_t = openerp.web._t;
|
||||
|
||||
openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Notification# */{
|
||||
openerp.web.Notification = openerp.web.OldWidget.extend(/** @lends openerp.web.Notification# */{
|
||||
template: 'Notification',
|
||||
identifier_prefix: 'notification-',
|
||||
|
||||
init: function() {
|
||||
this._super.apply(this, arguments);
|
||||
|
@ -36,9 +35,8 @@ openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Not
|
|||
|
||||
});
|
||||
|
||||
openerp.web.Dialog = openerp.web.Widget.extend(/** @lends openerp.web.Dialog# */{
|
||||
openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# */{
|
||||
dialog_title: "",
|
||||
identifier_prefix: 'dialog',
|
||||
/**
|
||||
* @constructs openerp.web.Dialog
|
||||
* @extends openerp.web.OldWidget
|
||||
|
@ -208,11 +206,11 @@ openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading# */{
|
||||
openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loading# */{
|
||||
template: 'Loading',
|
||||
/**
|
||||
* @constructs openerp.web.Loading
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param parent
|
||||
* @param element_id
|
||||
|
@ -267,11 +265,11 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading#
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database# */{
|
||||
openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Database# */{
|
||||
template: "DatabaseManager",
|
||||
/**
|
||||
* @constructs openerp.web.Database
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param parent
|
||||
* @param element_id
|
||||
|
@ -551,14 +549,13 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{
|
||||
openerp.web.Login = openerp.web.OldWidget.extend(/** @lends openerp.web.Login# */{
|
||||
remember_credentials: true,
|
||||
|
||||
template: "Login",
|
||||
identifier_prefix: 'oe-app-login-',
|
||||
/**
|
||||
* @constructs openerp.web.Login
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param parent
|
||||
* @param element_id
|
||||
|
@ -649,12 +646,11 @@ openerp.web.Login = openerp.web.Widget.extend(/** @lends openerp.web.Login# */{
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.Header = openerp.web.Widget.extend(/** @lends openerp.web.Header# */{
|
||||
openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header# */{
|
||||
template: "Header",
|
||||
identifier_prefix: 'oe-app-header-',
|
||||
/**
|
||||
* @constructs openerp.web.Header
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param parent
|
||||
*/
|
||||
|
@ -830,10 +826,10 @@ openerp.web.Header = openerp.web.Widget.extend(/** @lends openerp.web.Header# *
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
|
||||
openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */{
|
||||
/**
|
||||
* @constructs openerp.web.Menu
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param parent
|
||||
* @param element_id
|
||||
|
@ -1045,10 +1041,10 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClient */{
|
||||
openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebClient */{
|
||||
/**
|
||||
* @constructs openerp.web.WebClient
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param element_id
|
||||
*/
|
||||
|
@ -1061,6 +1057,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
|
|||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
this.$element = $(document.body);
|
||||
if (jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) {
|
||||
this.$element.addClass("kitten-mode-activated");
|
||||
this.$element.delegate('img.oe-record-edit-link-img', 'hover', function(e) {
|
||||
|
@ -1182,7 +1179,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.EmbeddedClient = openerp.web.Widget.extend({
|
||||
openerp.web.EmbeddedClient = openerp.web.OldWidget.extend({
|
||||
template: 'EmptyComponent',
|
||||
init: function(action_id, options) {
|
||||
this._super();
|
||||
|
|
|
@ -892,8 +892,6 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
|
|||
* MyWidget = openerp.base.Widget.extend({
|
||||
* // the name of the QWeb template to use for rendering
|
||||
* template: "MyQWebTemplate",
|
||||
* // identifier prefix, it is useful to put an obvious one for debugging
|
||||
* identifier_prefix: 'my-id-prefix-',
|
||||
*
|
||||
* init: function(parent) {
|
||||
* this._super(parent);
|
||||
|
@ -932,13 +930,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
|
|||
* @type string
|
||||
*/
|
||||
template: null,
|
||||
/**
|
||||
* The prefix used to generate an id automatically. Should be redefined in
|
||||
* subclasses. If it is not defined, a generic identifier will be used.
|
||||
*
|
||||
* @type string
|
||||
*/
|
||||
identifier_prefix: 'generic-identifier-',
|
||||
/**
|
||||
* Tag name when creating a default $element.
|
||||
* @type string
|
||||
|
@ -958,15 +949,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
|
|||
* with the DOM insertion methods provided by the current implementation of Widget. So
|
||||
* for new components this argument should not be provided any more.
|
||||
*/
|
||||
init: function(parent, /** @deprecated */ element_id) {
|
||||
init: function(parent) {
|
||||
this._super();
|
||||
this.session = openerp.connection;
|
||||
// if given an element_id, try to get the associated DOM element and save
|
||||
// a reference in this.$element. Else just generate a unique identifier.
|
||||
this.element_id = element_id;
|
||||
this.element_id = this.element_id || _.uniqueId(this.identifier_prefix);
|
||||
var tmp = document.getElementById(this.element_id);
|
||||
this.$element = tmp ? $(tmp) : $(document.createElement(this.tag_name));
|
||||
|
||||
this.widget_parent = parent;
|
||||
this.widget_children = [];
|
||||
|
@ -1128,17 +1113,14 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
|
|||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @class
|
||||
* @extends openerp.web.Widget
|
||||
* @deprecated
|
||||
* For retro compatibility only, the only difference with is that render() uses
|
||||
* directly ``this`` instead of context with a ``widget`` key.
|
||||
*/
|
||||
openerp.web.OldWidget = openerp.web.Widget.extend(/** @lends openerp.web.OldWidget# */{
|
||||
render: function (additional) {
|
||||
return openerp.web.qweb.render(this.template, _.extend(_.extend({}, this), additional || {}));
|
||||
}
|
||||
openerp.web.OldWidget = openerp.web.Widget.extend({
|
||||
init: function(parent, /** @deprecated */ element_id) {
|
||||
this._super(parent);
|
||||
this.element_id = element_id;
|
||||
this.element_id = this.element_id || _.uniqueId('widget-');
|
||||
var tmp = document.getElementById(this.element_id);
|
||||
this.$element = tmp ? $(tmp) : $(document.createElement(this.tag_name));
|
||||
},
|
||||
});
|
||||
|
||||
openerp.web.TranslationDataBase = openerp.web.Class.extend(/** @lends openerp.web.TranslationDataBase# */{
|
||||
|
|
|
@ -18,7 +18,7 @@ openerp.web.serialize_sort = function (criterion) {
|
|||
}).join(', ');
|
||||
};
|
||||
|
||||
openerp.web.DataGroup = openerp.web.Widget.extend( /** @lends openerp.web.DataGroup# */{
|
||||
openerp.web.DataGroup = openerp.web.OldWidget.extend( /** @lends openerp.web.DataGroup# */{
|
||||
/**
|
||||
* Management interface between views and grouped collections of OpenERP
|
||||
* records.
|
||||
|
@ -30,9 +30,9 @@ openerp.web.DataGroup = openerp.web.Widget.extend( /** @lends openerp.web.DataG
|
|||
* content of the current grouping level.
|
||||
*
|
||||
* @constructs openerp.web.DataGroup
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param {openerp.web.Widget} parent widget
|
||||
* @param {openerp.web.OldWidget} parent widget
|
||||
* @param {String} model name of the model managed by this DataGroup
|
||||
* @param {Array} domain search domain for this DataGroup
|
||||
* @param {Object} context context of the DataGroup's searches
|
||||
|
@ -233,14 +233,13 @@ openerp.web.StaticDataGroup = openerp.web.GrouplessDataGroup.extend( /** @lends
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet# */{
|
||||
identifier_prefix: "dataset",
|
||||
openerp.web.DataSet = openerp.web.OldWidget.extend( /** @lends openerp.web.DataSet# */{
|
||||
/**
|
||||
* DateaManagement interface between views and the collection of selected
|
||||
* OpenERP records (represents the view's state?)
|
||||
*
|
||||
* @constructs openerp.web.DataSet
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param {String} model the OpenERP model this dataset will manage
|
||||
*/
|
||||
|
@ -309,7 +308,7 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet
|
|||
* domain and context.
|
||||
*
|
||||
* @param {Array} [fields] fields to read and return, by default all fields are returned
|
||||
* @params {Object} options
|
||||
* @params {Object} [options]
|
||||
* @param {Number} [options.offset=0] The index from which selected records should be returned
|
||||
* @param {Number} [options.limit=null] The maximum number of records to return
|
||||
* @returns {$.Deferred}
|
||||
|
@ -504,11 +503,11 @@ openerp.web.DataSetStatic = openerp.web.DataSet.extend({
|
|||
this.ids = ids || [];
|
||||
},
|
||||
read_slice: function (fields, options) {
|
||||
options = options || {};
|
||||
fields = fields || {};
|
||||
// TODO remove fields from options
|
||||
var self = this,
|
||||
offset = options.offset || 0,
|
||||
limit = options.limit || false,
|
||||
fields = fields || false;
|
||||
var offset = options.offset || 0,
|
||||
limit = options.limit || false;
|
||||
var end_pos = limit && limit !== -1 ? offset + limit : this.ids.length;
|
||||
return this.read_ids(this.ids.slice(offset, end_pos), fields);
|
||||
},
|
||||
|
@ -560,8 +559,8 @@ openerp.web.DataSetSearch = openerp.web.DataSet.extend(/** @lends openerp.web.D
|
|||
* @returns {$.Deferred}
|
||||
*/
|
||||
read_slice: function (fields, options) {
|
||||
options = options || {};
|
||||
var self = this;
|
||||
var options = options || {};
|
||||
var offset = options.offset || 0;
|
||||
return this.rpc('/web/dataset/search_read', {
|
||||
model: this.model,
|
||||
|
|
|
@ -3,11 +3,11 @@ var QWeb = openerp.web.qweb,
|
|||
_t = openerp.web._t,
|
||||
_lt = openerp.web._lt;
|
||||
|
||||
openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.SearchView# */{
|
||||
openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.SearchView# */{
|
||||
template: "EmptyComponent",
|
||||
/**
|
||||
* @constructs openerp.web.SearchView
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param parent
|
||||
* @param element_id
|
||||
|
@ -499,13 +499,13 @@ openerp.web.search.Invalid = openerp.web.Class.extend( /** @lends openerp.web.se
|
|||
);
|
||||
}
|
||||
});
|
||||
openerp.web.search.Widget = openerp.web.Widget.extend( /** @lends openerp.web.search.Widget# */{
|
||||
openerp.web.search.Widget = openerp.web.OldWidget.extend( /** @lends openerp.web.search.Widget# */{
|
||||
template: null,
|
||||
/**
|
||||
* Root class of all search widgets
|
||||
*
|
||||
* @constructs openerp.web.search.Widget
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param view the ancestor view of this widget
|
||||
*/
|
||||
|
@ -1038,9 +1038,8 @@ openerp.web.search.ManyToOneField = openerp.web.search.CharField.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.search.ExtendedSearch = openerp.web.OldWidget.extend({
|
||||
openerp.web.search.ExtendedSearch = openerp.web.search.Widget.extend({
|
||||
template: 'SearchView.extended_search',
|
||||
identifier_prefix: 'extended-search',
|
||||
init: function (parent, model) {
|
||||
this._super(parent);
|
||||
this.model = model;
|
||||
|
@ -1051,7 +1050,7 @@ openerp.web.search.ExtendedSearch = openerp.web.OldWidget.extend({
|
|||
this.check_last_element();
|
||||
},
|
||||
start: function () {
|
||||
this.$element = $("#" + this.element_id);
|
||||
this._super();
|
||||
this.$element.closest("table.oe-searchview-render-line").css("display", "none");
|
||||
var self = this;
|
||||
this.rpc("/web/searchview/fields_get",
|
||||
|
@ -1107,7 +1106,6 @@ openerp.web.search.ExtendedSearch = openerp.web.OldWidget.extend({
|
|||
|
||||
openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({
|
||||
template: 'SearchView.extended_search.group',
|
||||
identifier_prefix: 'extended-search-group',
|
||||
init: function (parent, fields) {
|
||||
this._super(parent);
|
||||
this.fields = fields;
|
||||
|
@ -1119,7 +1117,6 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({
|
|||
prop.start();
|
||||
},
|
||||
start: function () {
|
||||
this.$element = $("#" + this.element_id);
|
||||
var _this = this;
|
||||
this.add_prop();
|
||||
this.$element.find('.searchview_extended_add_proposition').click(function () {
|
||||
|
@ -1153,7 +1150,6 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({
|
|||
|
||||
openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** @lends openerp.web.search.ExtendedSearchProposition# */{
|
||||
template: 'SearchView.extended_search.proposition',
|
||||
identifier_prefix: 'extended-search-proposition',
|
||||
/**
|
||||
* @constructs openerp.web.search.ExtendedSearchProposition
|
||||
* @extends openerp.web.OldWidget
|
||||
|
@ -1254,7 +1250,6 @@ openerp.web.search.ExtendedSearchProposition.Field = openerp.web.OldWidget.exten
|
|||
});
|
||||
openerp.web.search.ExtendedSearchProposition.Char = openerp.web.search.ExtendedSearchProposition.Field.extend({
|
||||
template: 'SearchView.extended_search.proposition.char',
|
||||
identifier_prefix: 'extended-search-proposition-char',
|
||||
operators: [
|
||||
{value: "ilike", text: _lt("contains")},
|
||||
{value: "not ilike", text: _lt("doesn't contain")},
|
||||
|
@ -1271,7 +1266,6 @@ openerp.web.search.ExtendedSearchProposition.Char = openerp.web.search.ExtendedS
|
|||
});
|
||||
openerp.web.search.ExtendedSearchProposition.DateTime = openerp.web.search.ExtendedSearchProposition.Field.extend({
|
||||
template: 'SearchView.extended_search.proposition.empty',
|
||||
identifier_prefix: 'extended-search-proposition-datetime',
|
||||
operators: [
|
||||
{value: "=", text: _lt("is equal to")},
|
||||
{value: "!=", text: _lt("is not equal to")},
|
||||
|
@ -1291,7 +1285,6 @@ openerp.web.search.ExtendedSearchProposition.DateTime = openerp.web.search.Exten
|
|||
});
|
||||
openerp.web.search.ExtendedSearchProposition.Date = openerp.web.search.ExtendedSearchProposition.Field.extend({
|
||||
template: 'SearchView.extended_search.proposition.empty',
|
||||
identifier_prefix: 'extended-search-proposition-date',
|
||||
operators: [
|
||||
{value: "=", text: _lt("is equal to")},
|
||||
{value: "!=", text: _lt("is not equal to")},
|
||||
|
@ -1311,7 +1304,6 @@ openerp.web.search.ExtendedSearchProposition.Date = openerp.web.search.ExtendedS
|
|||
});
|
||||
openerp.web.search.ExtendedSearchProposition.Integer = openerp.web.search.ExtendedSearchProposition.Field.extend({
|
||||
template: 'SearchView.extended_search.proposition.integer',
|
||||
identifier_prefix: 'extended-search-proposition-integer',
|
||||
operators: [
|
||||
{value: "=", text: _lt("is equal to")},
|
||||
{value: "!=", text: _lt("is not equal to")},
|
||||
|
@ -1333,7 +1325,6 @@ openerp.web.search.ExtendedSearchProposition.Id = openerp.web.search.ExtendedSea
|
|||
});
|
||||
openerp.web.search.ExtendedSearchProposition.Float = openerp.web.search.ExtendedSearchProposition.Field.extend({
|
||||
template: 'SearchView.extended_search.proposition.float',
|
||||
identifier_prefix: 'extended-search-proposition-float',
|
||||
operators: [
|
||||
{value: "=", text: _lt("is equal to")},
|
||||
{value: "!=", text: _lt("is not equal to")},
|
||||
|
@ -1352,7 +1343,6 @@ openerp.web.search.ExtendedSearchProposition.Float = openerp.web.search.Extended
|
|||
});
|
||||
openerp.web.search.ExtendedSearchProposition.Selection = openerp.web.search.ExtendedSearchProposition.Field.extend({
|
||||
template: 'SearchView.extended_search.proposition.selection',
|
||||
identifier_prefix: 'extended-search-proposition-selection',
|
||||
operators: [
|
||||
{value: "=", text: _lt("is")},
|
||||
{value: "!=", text: _lt("is not")}
|
||||
|
@ -1366,7 +1356,6 @@ openerp.web.search.ExtendedSearchProposition.Selection = openerp.web.search.Exte
|
|||
});
|
||||
openerp.web.search.ExtendedSearchProposition.Boolean = openerp.web.search.ExtendedSearchProposition.Field.extend({
|
||||
template: 'SearchView.extended_search.proposition.boolean',
|
||||
identifier_prefix: 'extended-search-proposition-boolean',
|
||||
operators: [
|
||||
{value: "=", text: _lt("is true")},
|
||||
{value: "!=", text: _lt("is false")}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
openerp.web.view_editor = function(openerp) {
|
||||
var _t = openerp.web._t;
|
||||
var QWeb = openerp.web.qweb;
|
||||
openerp.web.ViewEditor = openerp.web.Widget.extend({
|
||||
openerp.web.ViewEditor = openerp.web.OldWidget.extend({
|
||||
init: function(parent, element_id, dataset, view, options) {
|
||||
this._super(parent);
|
||||
this.element_id = element_id
|
||||
|
@ -806,7 +806,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
|
|||
'widget' : {'name':'widget', 'string': 'widget', 'type': 'selection'},
|
||||
'colors' : {'name':'colors', 'string': 'Colors', 'type': 'char'},
|
||||
'editable' : {'name':'editable', 'string': 'Editable', 'type': 'selection', 'selection': [["",""],["top","Top"],["bottom", "Bottom"]]},
|
||||
'groups' : {'name':'groups', 'string': 'Groups', 'type': 'seleciton_multi'}
|
||||
'groups' : {'name':'groups', 'string': 'Groups', 'type': 'selection_multi'}
|
||||
};
|
||||
var arch_val = self.get_object_by_id(this.one_object.clicked_tr_id,this.one_object['main_object'], []);
|
||||
this.edit_node_dialog.$element.append('<table id="rec_table" style="width:400px" class="oe_forms"></table>');
|
||||
|
@ -1131,7 +1131,7 @@ var _ICONS = ['','STOCK_ABOUT', 'STOCK_ADD', 'STOCK_APPLY', 'STOCK_BOLD',
|
|||
];
|
||||
openerp.web.ViewEditor.property_widget = new openerp.web.Registry({
|
||||
'boolean' : 'openerp.web.ViewEditor.FieldBoolean',
|
||||
'seleciton_multi' : 'openerp.web.ViewEditor.FieldSelectMulti',
|
||||
'selection_multi' : 'openerp.web.ViewEditor.FieldSelectMulti',
|
||||
'selection' : 'openerp.web.ViewEditor.FieldSelect',
|
||||
'char' : 'openerp.web.ViewEditor.FieldChar',
|
||||
'float' : 'openerp.web.ViewEditor.FieldFloat'
|
||||
|
|
|
@ -13,7 +13,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
|
|||
searchable: false,
|
||||
readonly : false,
|
||||
form_template: "FormView",
|
||||
identifier_prefix: 'formview-',
|
||||
display_name: _lt('Form'),
|
||||
/**
|
||||
* @constructs openerp.web.FormView
|
||||
|
@ -386,11 +385,11 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
|
|||
on_button_save: function() {
|
||||
var self = this;
|
||||
return this.do_save().then(function(result) {
|
||||
self.do_prev_view(result.created);
|
||||
self.do_prev_view({'created': result.created, 'default': 'page'});
|
||||
});
|
||||
},
|
||||
on_button_cancel: function() {
|
||||
return this.do_prev_view();
|
||||
return this.do_prev_view({'default': 'page'});
|
||||
},
|
||||
on_button_new: function() {
|
||||
var self = this;
|
||||
|
@ -620,7 +619,7 @@ openerp.web.FormDialog = openerp.web.Dialog.extend({
|
|||
/** @namespace */
|
||||
openerp.web.form = {};
|
||||
|
||||
openerp.web.form.SidebarAttachments = openerp.web.Widget.extend({
|
||||
openerp.web.form.SidebarAttachments = openerp.web.OldWidget.extend({
|
||||
init: function(parent, form_view) {
|
||||
var $section = parent.add_section(_t('Attachments'), 'attachments');
|
||||
this.$div = $('<div class="oe-sidebar-attachments"></div>');
|
||||
|
@ -737,12 +736,11 @@ openerp.web.form.compute_domain = function(expr, fields) {
|
|||
return _.all(stack, _.identity);
|
||||
};
|
||||
|
||||
openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form.Widget# */{
|
||||
openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.form.Widget# */{
|
||||
template: 'Widget',
|
||||
identifier_prefix: 'formview-widget-',
|
||||
/**
|
||||
* @constructs openerp.web.form.Widget
|
||||
* @extends openerp.web.Widget
|
||||
* @extends openerp.web.OldWidget
|
||||
*
|
||||
* @param view
|
||||
* @param node
|
||||
|
@ -1388,7 +1386,7 @@ openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web.DateTimeWidget = openerp.web.Widget.extend({
|
||||
openerp.web.DateTimeWidget = openerp.web.OldWidget.extend({
|
||||
template: "web.datetimepicker",
|
||||
jqueryui_object: 'datetimepicker',
|
||||
type_of_date: "datetime",
|
||||
|
@ -2593,7 +2591,6 @@ openerp.web.form.Many2ManyListView = openerp.web.ListView.extend(/** @lends open
|
|||
* @extends openerp.web.OldWidget
|
||||
*/
|
||||
openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends openerp.web.form.SelectCreatePopup# */{
|
||||
identifier_prefix: "selectcreatepopup",
|
||||
template: "SelectCreatePopup",
|
||||
/**
|
||||
* options:
|
||||
|
@ -2811,7 +2808,6 @@ openerp.web.form.SelectCreateListView = openerp.web.ListView.extend({
|
|||
* @extends openerp.web.OldWidget
|
||||
*/
|
||||
openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp.web.form.FormOpenPopup# */{
|
||||
identifier_prefix: "formopenpopup",
|
||||
template: "FormOpenPopup",
|
||||
/**
|
||||
* options:
|
||||
|
@ -2917,6 +2913,7 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({
|
|||
}
|
||||
};
|
||||
this.get_fields_values = view.get_fields_values;
|
||||
this.get_selected_ids = view.get_selected_ids;
|
||||
this.do_onchange = this.on_form_changed = this.on_nop;
|
||||
this.dataset = this.view.dataset;
|
||||
this.widgets_counter = 0;
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
openerp.web.view_help = function(openerp) {
|
||||
|
||||
openerp.web.ProcessView = openerp.web.Widget.extend({
|
||||
openerp.web.ProcessView = openerp.web.OldWidget.extend({
|
||||
});
|
||||
|
||||
openerp.web.HelpView = openerp.web.Widget.extend({
|
||||
openerp.web.HelpView = openerp.web.OldWidget.extend({
|
||||
});
|
||||
|
||||
};
|
||||
|
|
|
@ -212,7 +212,8 @@ openerp.web.list_editable = function (openerp) {
|
|||
e.stopImmediatePropagation();
|
||||
})
|
||||
.keyup(function () {
|
||||
return self.on_row_keyup.apply(self, arguments); });
|
||||
return self.on_row_keyup.apply(self, arguments); })
|
||||
.keydown(function (e) { e.stopPropagation(); });
|
||||
if (row) {
|
||||
$new_row.replaceAll(row);
|
||||
} else if (self.options.editable) {
|
||||
|
|
|
@ -198,7 +198,14 @@ openerp.web.page = function (openerp) {
|
|||
if (!this.value) {
|
||||
return null;
|
||||
}
|
||||
return _.str.sprintf('%s,%d', this.field.relation, this.value[0]);
|
||||
var id;
|
||||
if (typeof this.value === 'number') {
|
||||
// name_get has not run yet
|
||||
id = this.value;
|
||||
} else {
|
||||
id = this.value[0];
|
||||
}
|
||||
return _.str.sprintf('%s,%d', this.field.relation, id);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@ session.web.client_actions = new session.web.Registry();
|
|||
*/
|
||||
session.web.views = new session.web.Registry();
|
||||
|
||||
session.web.ActionManager = session.web.Widget.extend({
|
||||
identifier_prefix: "actionmanager",
|
||||
session.web.ActionManager = session.web.OldWidget.extend({
|
||||
init: function(parent) {
|
||||
this._super(parent);
|
||||
this.inner_action = null;
|
||||
|
@ -208,12 +207,11 @@ session.web.ActionManager = session.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.ViewManager# */{
|
||||
identifier_prefix: "viewmanager",
|
||||
session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.ViewManager# */{
|
||||
template: "ViewManager",
|
||||
/**
|
||||
* @constructs session.web.ViewManager
|
||||
* @extends session.web.Widget
|
||||
* @extends session.web.OldWidget
|
||||
*
|
||||
* @param parent
|
||||
* @param dataset
|
||||
|
@ -354,17 +352,19 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View
|
|||
* navigation history (the navigation history is appended to via
|
||||
* on_mode_switch)
|
||||
*
|
||||
* @param {Boolean} [created=false] returning from a creation
|
||||
* @param {Object} [options]
|
||||
* @param {Boolean} [options.created=false] resource was created
|
||||
* @param {String} [options.default=null] view to switch to if no previous view
|
||||
* @returns {$.Deferred} switching end signal
|
||||
*/
|
||||
on_prev_view: function (created) {
|
||||
on_prev_view: function (options) {
|
||||
var current_view = this.views_history.pop();
|
||||
var previous_view = this.views_history[this.views_history.length - 1];
|
||||
if (created && current_view === 'form' && previous_view === 'list') {
|
||||
var previous_view = this.views_history[this.views_history.length - 1] || options['default'];
|
||||
if (options.created && current_view === 'form' && previous_view === 'list') {
|
||||
// APR special case: "If creation mode from list (and only from a list),
|
||||
// after saving, go to page view (don't come back in list)"
|
||||
return this.on_mode_switch('page');
|
||||
} else if (created && !previous_view && this.action && this.action.flags.default_view === 'form') {
|
||||
} else if (options.created && !previous_view && this.action && this.action.flags.default_view === 'form') {
|
||||
// APR special case: "If creation from dashboard, we have no previous view
|
||||
return this.on_mode_switch('page');
|
||||
}
|
||||
|
@ -763,7 +763,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
|
|||
}
|
||||
});
|
||||
|
||||
session.web.Sidebar = session.web.Widget.extend({
|
||||
session.web.Sidebar = session.web.OldWidget.extend({
|
||||
init: function(parent, element_id) {
|
||||
this._super(parent, element_id);
|
||||
this.items = {};
|
||||
|
@ -1040,7 +1040,7 @@ session.web.TranslateDialog = session.web.Dialog.extend({
|
|||
}
|
||||
});
|
||||
|
||||
session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
|
||||
session.web.View = session.web.OldWidget.extend(/** @lends session.web.View# */{
|
||||
template: "EmptyComponent",
|
||||
// name displayed in view switchers
|
||||
display_name: '',
|
||||
|
@ -1170,8 +1170,12 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
|
|||
},
|
||||
/**
|
||||
* Cancels the switch to the current view, switches to the previous one
|
||||
*
|
||||
* @param {Object} [options]
|
||||
* @param {Boolean} [options.created=false] resource was created
|
||||
* @param {String} [options.default=null] view to switch to if no previous view
|
||||
*/
|
||||
do_prev_view: function () {
|
||||
do_prev_view: function (options) {
|
||||
},
|
||||
do_search: function(view) {
|
||||
},
|
||||
|
@ -1212,7 +1216,7 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
|
|||
|
||||
session.web.json_node_to_xml = function(node, human_readable, indent) {
|
||||
// For debugging purpose, this function will convert a json node back to xml
|
||||
// Maybe usefull for xml view editor
|
||||
// Maybe useful for xml view editor
|
||||
indent = indent || 0;
|
||||
var sindent = (human_readable ? (new Array(indent + 1).join('\t')) : ''),
|
||||
r = sindent + '<' + node.tag,
|
||||
|
|
|
@ -682,7 +682,9 @@
|
|||
</td>
|
||||
</t>
|
||||
<th t-if="options.selectable" class="oe-record-selector" width="1">
|
||||
<input t-att-type="options.radio? 'radio': 'checkbox'" name ="radiogroup" t-att-checked="options.select_view_id == record.get('id')? true: null"/>
|
||||
<t t-set="checked" t-value="options.select_view_id == record.get('id') ? 'checked' : null"/>
|
||||
<input t-if="options.radio" type="radio" name="radiogroup" t-att-checked="checked"/>
|
||||
<input t-if="!options.radio" type="checkbox" name="radiogroup" t-att-checked="checked"/>
|
||||
</th>
|
||||
<th t-if="options.isClarkGable" class="oe-record-edit-link" width="1">
|
||||
<img src="/web/static/src/img/pencil.gif" width="12" height="12" class="oe-record-edit-link-img"/>
|
||||
|
@ -747,7 +749,7 @@
|
|||
<input type="file" class="oe-binary-file" name="ufile" title="Add attachment"
|
||||
t-att-onclick="view.datarecord.id ? null : 'alert(\'No record selected ! You can only attach to existing record.\'); return false;'"/>
|
||||
</form>
|
||||
<iframe t-attf-id="#{element_id}_iframe" t-attf-name="#{element_id}_iframe" style="display: none"> </iframe>
|
||||
<iframe t-attf-id="#{element_id}_iframe" t-attf-name="#{element_id}_iframe" style="display: none"/>
|
||||
</div>
|
||||
</div>
|
||||
<br style="clear: both"/>
|
||||
|
@ -1084,7 +1086,7 @@
|
|||
<img t-att-src='_s + "/web/static/src/img/throbber.gif"' width="16" height="16"/>
|
||||
<b>Uploading ...</b>
|
||||
</div>
|
||||
<iframe t-att-id="widget.iframe" t-att-name="widget.iframe" style="display: none"> </iframe>
|
||||
<iframe t-att-id="widget.iframe" t-att-name="widget.iframe" style="display: none"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -1134,7 +1136,7 @@
|
|||
<td class="oe-binary-progress" style="display: none" nowrap="true">
|
||||
<img t-att-src='_s + "/web/static/src/img/throbber.gif"' width="16" height="16"/>
|
||||
<b>Uploading ...</b>
|
||||
<iframe t-att-id="widget.iframe" t-att-name="widget.iframe" style="display: none"> </iframe>
|
||||
<iframe t-att-id="widget.iframe" t-att-name="widget.iframe" style="display: none"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -1329,7 +1331,7 @@
|
|||
</t>
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.group">
|
||||
<div t-att-id="element_id" class="searchview_extended_group">
|
||||
<div t-att-id="widget.element_id" class="searchview_extended_group">
|
||||
<select class="searchview_extended_group_choice">
|
||||
<option value="any">Any of the following conditions must match</option>
|
||||
<option value="all">All the following conditions must match</option>
|
||||
|
@ -1345,11 +1347,11 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.proposition">
|
||||
<div t-att-id="element_id">
|
||||
<div t-att-id="widget.element_id">
|
||||
<select class="searchview_extended_prop_field">
|
||||
<t t-foreach="attrs.fields" t-as="field">
|
||||
<t t-foreach="widget.attrs.fields" t-as="field">
|
||||
<option t-if="typeof field.store === 'undefined' || field.store || field.fnct_search"
|
||||
t-att="{'selected': field === attrs.selected ? 'selected' : null}"
|
||||
t-att="{'selected': field === widget.attrs.selected ? 'selected' : null}"
|
||||
t-att-value="field.name">
|
||||
<t t-esc="field.string"/>
|
||||
</option>
|
||||
|
@ -1362,41 +1364,41 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.proposition.char">
|
||||
<input t-att-id="element_id" class="field_char"/>
|
||||
<input t-att-id="widget.element_id" class="field_char"/>
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.proposition.empty">
|
||||
<span t-att-id="element_id"></span>
|
||||
<span t-att-id="widget.element_id"></span>
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.proposition.integer">
|
||||
<input type="number" t-att-id="element_id" class="field_integer" step="1"/>
|
||||
<input type="number" t-att-id="widget.element_id" class="field_integer" step="1"/>
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.proposition.float">
|
||||
<input type="number" t-att-id="element_id" class="field_float" step="0.01"/>
|
||||
<input type="number" t-att-id="widget.element_id" class="field_float" step="0.01"/>
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.proposition.boolean">
|
||||
</t>
|
||||
<t t-name="SearchView.extended_search.proposition.selection">
|
||||
<select t-att-id="element_id">
|
||||
<t t-foreach="field.selection" t-as="element">
|
||||
<select t-att-id="widget.element_id">
|
||||
<t t-foreach="widget.field.selection" t-as="element">
|
||||
<option t-att-value="element[0]"><t t-esc="element[1]"/></option>
|
||||
</t>
|
||||
</select>
|
||||
</t>
|
||||
<t t-name="SelectCreatePopup">
|
||||
<div t-att-id="element_id">
|
||||
<div t-att-id="widget.element_id">
|
||||
<table style="width:100%">
|
||||
<tr style="width:100%">
|
||||
<td style="width:100%">
|
||||
<div t-att-id="element_id + '_search'" style="width:100%"></div>
|
||||
<div t-att-id="widget.element_id + '_search'" style="width:100%"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="width:100%">
|
||||
<td style="width:100%">
|
||||
<div t-att-id="element_id + '_view_list'" style="width:100%"></div>
|
||||
<div t-att-id="widget.element_id + '_view_list'" style="width:100%"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div t-att-id="element_id + '_view_form'" style="width:100%"></div>
|
||||
<div t-att-id="widget.element_id + '_view_form'" style="width:100%"></div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="SelectCreatePopup.search.buttons">
|
||||
|
@ -1414,8 +1416,8 @@
|
|||
<button type="button" class="oe_button oe_selectcreatepopup-form-close">Cancel</button>
|
||||
</t>
|
||||
<t t-name="FormOpenPopup">
|
||||
<div t-att-id="element_id">
|
||||
<div t-att-id="element_id + '_view_form'" style="width:100%"></div>
|
||||
<div t-att-id="widget.element_id">
|
||||
<div t-att-id="widget.element_id + '_view_form'" style="width:100%"></div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="FormOpenPopup.form.buttons">
|
||||
|
|
|
@ -461,7 +461,7 @@ openerp.web_calendar.CalendarFormDialog = openerp.web.Dialog.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_calendar.SidebarResponsible = openerp.web.Widget.extend({
|
||||
openerp.web_calendar.SidebarResponsible = openerp.web.OldWidget.extend({
|
||||
init: function(parent, view) {
|
||||
var $section = parent.add_section(_t('Responsible'), 'responsible');
|
||||
this.$div = $('<div></div>');
|
||||
|
@ -499,7 +499,7 @@ openerp.web_calendar.SidebarResponsible = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_calendar.SidebarNavigator = openerp.web.Widget.extend({
|
||||
openerp.web_calendar.SidebarNavigator = openerp.web.OldWidget.extend({
|
||||
init: function(parent, view) {
|
||||
var $section = parent.add_section(_t('Navigator'), 'navigator');
|
||||
this._super(parent, $section.attr('id'));
|
||||
|
|
|
@ -395,7 +395,7 @@ openerp.web_dashboard.Widget = openerp.web.View.extend(/** @lends openerp.web_da
|
|||
* install (if none is installed yet) or a list of root menu items
|
||||
*/
|
||||
openerp.web.client_actions.add('default_home', 'session.web_dashboard.ApplicationTiles');
|
||||
openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({
|
||||
openerp.web_dashboard.ApplicationTiles = openerp.web.OldWidget.extend({
|
||||
template: 'web_dashboard.ApplicationTiles',
|
||||
init: function(parent) {
|
||||
this._super(parent);
|
||||
|
@ -440,7 +440,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({
|
|||
* This client action display a list of applications to install.
|
||||
*/
|
||||
openerp.web.client_actions.add( 'board.application.installer', 'openerp.web_dashboard.ApplicationInstaller');
|
||||
openerp.web_dashboard.ApplicationInstaller = openerp.web.Widget.extend({
|
||||
openerp.web_dashboard.ApplicationInstaller = openerp.web.OldWidget.extend({
|
||||
template: 'web_dashboard.ApplicationInstaller',
|
||||
start: function () {
|
||||
// TODO menu hide
|
||||
|
|
|
@ -179,6 +179,7 @@ openerp.web_gantt.GanttViewOld = openerp.web.View.extend({
|
|||
this.date_start = this.fields_view.arch.attrs.date_start,
|
||||
this.date_delay = this.fields_view.arch.attrs.date_delay,
|
||||
this.date_stop = this.fields_view.arch.attrs.date_stop,
|
||||
this.progress = this.fields_view.arch.attrs.progress,
|
||||
this.day_length = this.fields_view.arch.attrs.day_length || 8;
|
||||
|
||||
this.color_field = this.fields_view.arch.attrs.color,
|
||||
|
@ -288,6 +289,7 @@ openerp.web_gantt.GanttViewOld = openerp.web.View.extend({
|
|||
var id = res['id'];
|
||||
var text = res[this.text];
|
||||
var start_date = res[this.date_start];
|
||||
var progress = res[this.progress] || 100;
|
||||
|
||||
if (this.date_stop != undefined){
|
||||
if (res[this.date_stop] != false){
|
||||
|
@ -323,7 +325,7 @@ openerp.web_gantt.GanttViewOld = openerp.web.View.extend({
|
|||
var mod_id = i+ "_" +j;
|
||||
parents[grp_key] = mod_id;
|
||||
child_event[mod_id] = {};
|
||||
all_events[mod_id] = {'parent': "", 'evt':[mod_id , grp_key, start_date, start_date, 100, ""]};
|
||||
all_events[mod_id] = {'parent': "", 'evt':[mod_id , grp_key, start_date, start_date, progress, ""]};
|
||||
}
|
||||
else{
|
||||
mod_id = parents[grp_key];
|
||||
|
@ -335,7 +337,7 @@ openerp.web_gantt.GanttViewOld = openerp.web.View.extend({
|
|||
child_event[mod_id][grp_key] = ch_mod_id;
|
||||
child_event[ch_mod_id] = {};
|
||||
temp_id = ch_mod_id;
|
||||
all_events[ch_mod_id] = {'parent': mod_id, 'evt':[ch_mod_id , grp_key, start_date, start_date, 100, ""]};
|
||||
all_events[ch_mod_id] = {'parent': mod_id, 'evt':[ch_mod_id , grp_key, start_date, start_date, progress, ""]};
|
||||
mod_id = ch_mod_id;
|
||||
}
|
||||
else{
|
||||
|
@ -344,15 +346,15 @@ openerp.web_gantt.GanttViewOld = openerp.web.View.extend({
|
|||
}
|
||||
}
|
||||
}
|
||||
all_events[id] = {'parent': temp_id, 'evt':[id , text, start_date, duration, 100, ""]};
|
||||
all_events[id] = {'parent': temp_id, 'evt':[id , text, start_date, duration, progress, ""]};
|
||||
final_events.push(id);
|
||||
}
|
||||
else {
|
||||
if (i == 0) {
|
||||
var mod_id = "_" + i;
|
||||
all_events[mod_id] = {'parent': "", 'evt': [mod_id, this.name, start_date, start_date, 100, ""]};
|
||||
all_events[mod_id] = {'parent': "", 'evt': [mod_id, this.name, start_date, start_date, progress, ""]};
|
||||
}
|
||||
all_events[id] = {'parent': mod_id, 'evt':[id , text, start_date, duration, 100, ""]};
|
||||
all_events[id] = {'parent': mod_id, 'evt':[id , text, start_date, duration, progress, ""]};
|
||||
final_events.push(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_kanban.KanbanGroup = openerp.web.Widget.extend({
|
||||
openerp.web_kanban.KanbanGroup = openerp.web.OldWidget.extend({
|
||||
template: 'KanbanView.group_header',
|
||||
init: function (parent, records, value, title, aggregates) {
|
||||
var self = this;
|
||||
|
@ -352,7 +352,7 @@ openerp.web_kanban.KanbanGroup = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_kanban.KanbanRecord = openerp.web.Widget.extend({
|
||||
openerp.web_kanban.KanbanRecord = openerp.web.OldWidget.extend({
|
||||
template: 'KanbanView.record',
|
||||
init: function (parent, record) {
|
||||
this._super(parent);
|
||||
|
|
|
@ -11,7 +11,7 @@ openerp.web_mobile.mobilewebclient = function(element_id) {
|
|||
return client;
|
||||
};
|
||||
|
||||
openerp.web_mobile.MobileWebClient = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.MobileWebClient = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "WebClient",
|
||||
|
||||
|
@ -31,7 +31,7 @@ openerp.web_mobile.MobileWebClient = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_mobile.Login = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.Login = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "Login",
|
||||
|
||||
|
@ -119,7 +119,7 @@ openerp.web_mobile.Login = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_mobile.Header = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.Header = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "Header",
|
||||
|
||||
|
@ -131,7 +131,7 @@ openerp.web_mobile.Header = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_mobile.Footer = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.Footer = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "Footer",
|
||||
|
||||
|
@ -143,7 +143,7 @@ openerp.web_mobile.Footer = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.Shortcuts = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "Shortcuts",
|
||||
|
||||
|
@ -182,7 +182,7 @@ openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_mobile.Menu = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.Menu = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "Menu",
|
||||
|
||||
|
@ -248,7 +248,7 @@ openerp.web_mobile.Menu = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_mobile.Secondary = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.Secondary = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "Menu.secondary",
|
||||
|
||||
|
@ -305,7 +305,7 @@ openerp.web_mobile.Secondary = openerp.web.Widget.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.web_mobile.Options = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.Options = openerp.web.OldWidget.extend({
|
||||
|
||||
template: "Options",
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
openerp.web_mobile.form_mobile = function (openerp) {
|
||||
|
||||
openerp.web_mobile.FormView = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.FormView = openerp.web.OldWidget.extend({
|
||||
|
||||
template: 'FormView',
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
openerp.web_mobile.list_mobile = function (openerp) {
|
||||
|
||||
openerp.web_mobile.ListView = openerp.web.Widget.extend({
|
||||
openerp.web_mobile.ListView = openerp.web.OldWidget.extend({
|
||||
|
||||
template: 'ListView',
|
||||
|
||||
|
|
|
@ -241,14 +241,13 @@ openerp.web_process = function (openerp) {
|
|||
dataset.call('get',
|
||||
['action', 'tree_but_open',[['ir.ui.menu', id]], dataset.context],
|
||||
function(res) {
|
||||
self.$element.empty();
|
||||
var action = res[0][res[0].length - 1];
|
||||
self.rpc("/web/action/load", {
|
||||
action_id: action.id,
|
||||
context: dataset.context
|
||||
}, function(result) {
|
||||
var action_manager = new openerp.web.ActionManager(self);
|
||||
action_manager.appendTo(self.widget_parent.$element);
|
||||
action_manager.replace(self.$element);
|
||||
action_manager.do_action(result.result);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@ openerp.web_tests = function (db) {
|
|||
db.web.client_actions.add(
|
||||
'buncha-forms', 'instance.web_tests.BunchaForms');
|
||||
db.web_tests = {};
|
||||
db.web_tests.BunchaForms = db.web.Widget.extend({
|
||||
db.web_tests.BunchaForms = db.web.OldWidget.extend({
|
||||
init: function (parent) {
|
||||
this._super(parent);
|
||||
this.dataset = new db.web.DataSetSearch(this, 'test.listview.relations');
|
||||
|
|
|
@ -163,8 +163,6 @@ override). Creating a subclass looks like this:
|
|||
var MyWidget = openerp.base.Widget.extend({
|
||||
// QWeb template to use when rendering the object
|
||||
template: "MyQWebTemplate",
|
||||
// autogenerated id prefix, specificity helps when debugging
|
||||
identifier_prefix: 'my-id-prefix-',
|
||||
|
||||
init: function(parent) {
|
||||
this._super(parent);
|
||||
|
|
Loading…
Reference in New Issue