[MERGE] Merge openerp-web in mobile.

bzr revid: bth@tinyerp.com-20111103115454-gdi35nq4pyf3ukqe
This commit is contained in:
Bhumi Thakkar (Open ERP)
2011-11-03 17:24:54 +05:30
96 changed files with 2180 additions and 531 deletions
+2
View File
@@ -11,6 +11,7 @@
"static/lib/datejs/sugarpak.js",
"static/lib/datejs/extras.js",
"static/lib/jquery/jquery-1.6.2.js",
"static/lib/jquery.MD5/jquery.md5.js",
"static/lib/jquery.form/jquery.form.js",
"static/lib/jquery.validate/jquery.validate.js",
"static/lib/jquery.ba-bbq/jquery.ba-bbq.js",
@@ -42,6 +43,7 @@
"static/src/js/view_list.js",
"static/src/js/view_list_editable.js",
"static/src/js/view_tree.js",
"static/src/js/view_editor.js"
],
'css' : [
"static/lib/jquery.superfish/css/superfish.css",
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:29+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:29+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
@@ -0,0 +1,32 @@
# jQuery MD5 Plugin
## Usage
Create ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value:
var md5 = $.md5('value');
Create ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key');
Create raw [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value:
var md5 = $.md5('value', null, true);
Create raw [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key', true);
## Requirements
None.
If [jQuery](http://jquery.com/) is not available, the md5 function will be added to the global object:
var md5 = md5('value');
## License
Released under the [MIT license](http://creativecommons.org/licenses/MIT/).
## Source Code & Download
* Browse and checkout the [source code](https://github.com/blueimp/jQuery-MD5).
* [Download](https://github.com/blueimp/jQuery-MD5/archives/master) the project to add the plugin to your website.
@@ -0,0 +1,32 @@
jQuery MD5 Plugin
=================
Usage
-----
Create (hex-encoded) MD5 hash of a given string value:
var md5 = $.md5('value');
Create (hex-encoded) HMAC-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key');
Create raw MD5 hash of a given string value:
var md5 = $.md5('value', null, true);
Create raw HMAC-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key', true);
Requirements
------------
None.
If jQuery is not available, the md5 function will be added to the global object:
var md5 = md5('value');
License
-------
Released under the MIT license:
http://creativecommons.org/licenses/MIT/
Source Code & Download
----------------------
https://github.com/blueimp/jQuery-MD5
@@ -0,0 +1,269 @@
/*
* jQuery MD5 Plugin 1.2.1
* https://github.com/blueimp/jQuery-MD5
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://creativecommons.org/licenses/MIT/
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*jslint bitwise: true */
/*global unescape, jQuery */
(function ($) {
'use strict';
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt) {
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
}
function md5_ff(a, b, c, d, x, s, t) {
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t) {
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t) {
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t) {
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binl_md5(x, len) {
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var i, olda, oldb, oldc, oldd,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
for (i = 0; i < x.length; i += 16) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = md5_ff(a, b, c, d, x[i], 7, -680876936);
d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i], 20, -373897302);
a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
d = md5_hh(d, a, b, c, x[i], 11, -358537222);
c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i], 6, -198630844);
d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return [a, b, c, d];
}
/*
* Convert an array of little-endian words to a string
*/
function binl2rstr(input) {
var i,
output = '';
for (i = 0; i < input.length * 32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
}
return output;
}
/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl(input) {
var i,
output = [];
output[(input.length >> 2) - 1] = undefined;
for (i = 0; i < output.length; i += 1) {
output[i] = 0;
}
for (i = 0; i < input.length * 8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
}
return output;
}
/*
* Calculate the MD5 of a raw string
*/
function rstr_md5(s) {
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
}
/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstr_hmac_md5(key, data) {
var i,
bkey = rstr2binl(key),
ipad = [],
opad = [],
hash;
ipad[15] = opad[15] = undefined;
if (bkey.length > 16) {
bkey = binl_md5(bkey, key.length * 8);
}
for (i = 0; i < 16; i += 1) {
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex(input) {
var hex_tab = '0123456789abcdef',
output = '',
x,
i;
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F) +
hex_tab.charAt(x & 0x0F);
}
return output;
}
/*
* Encode a string as utf-8
*/
function str2rstr_utf8(input) {
return unescape(encodeURIComponent(input));
}
/*
* Take string arguments and return either raw or hex encoded strings
*/
function raw_md5(s) {
return rstr_md5(str2rstr_utf8(s));
}
function hex_md5(s) {
return rstr2hex(raw_md5(s));
}
function raw_hmac_md5(k, d) {
return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));
}
function hex_hmac_md5(k, d) {
return rstr2hex(raw_hmac_md5(k, d));
}
$.md5 = function (string, key, raw) {
if (!key) {
if (!raw) {
return hex_md5(string);
} else {
return raw_md5(string);
}
}
if (!raw) {
return hex_hmac_md5(key, string);
} else {
return raw_hmac_md5(key, string);
}
};
}(typeof jQuery === 'function' ? jQuery : this));
@@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery MD5 Plugin Tests 1.1
* https://github.com/blueimp/jQuery-MD5
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://creativecommons.org/licenses/MIT/
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery MD5 Plugin Tests</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css">
</head>
<body>
<h1 id="qunit-header">jQuery MD5 Plugin Tests</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>
(function ($) {
'use strict';
var nojquery = /nojquery=true/.test(location.search);
$('<label><input type="checkbox">nojquery<\/label>').click(function () {
location.search = nojquery ? '' : '?nojquery=true';
}).appendTo('body').children(':first').attr('checked', nojquery);
if (nojquery) {
window.jQuery = null;
}
}(window.jQuery));
</script>
<script src="../jquery.md5.js"></script>
<script src="http://code.jquery.com/qunit/git/qunit.js"></script>
<script src="tests.js"></script>
</body>
</html>
@@ -0,0 +1,57 @@
/*
* jQuery MD5 Plugin Tests 1.1
* https://github.com/blueimp/jQuery-MD5
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://creativecommons.org/licenses/MIT/
*/
/*global jQuery, module, test, strictEqual */
(function ($) {
'use strict';
module('Hex-encoded MD5');
test('Creating hex-encoded MD5 hash of an ASCII value', function () {
strictEqual($.md5('value'), '2063c1608d6e0baf80249c42e2be5804');
});
test('Creating hex-encoded MD5 hash of an UTF-8 value', function () {
strictEqual($.md5('日本'), '4dbed2e657457884e67137d3514119b3');
});
module('Hex-encoded HMAC-MD5');
test('Creating hex-encoded HMAC-MD5 hash of an ASCII value and key', function () {
strictEqual($.md5('value', 'key'), '01433efd5f16327ea4b31144572c67f6');
});
test('Creating hex-encoded HMAC-MD5 hash of an UTF-8 value and key', function () {
strictEqual($.md5('日本', '日本'), 'c78b8c7357926981cc04740bd3e9d015');
});
module('Raw MD5');
test('Creating raw MD5 hash of an ASCII value', function () {
strictEqual($.md5('value', null, true), ' c\xc1`\x8dn\x0b\xaf\x80$\x9cB\xe2\xbeX\x04');
});
test('Creating raw MD5 hash of an UTF-8 value', function () {
strictEqual($.md5('日本', null, true), 'M\xbe\xd2\xe6WEx\x84\xe6q7\xd3QA\x19\xb3');
});
module('Raw HMAC-MD5');
test('Creating raw HMAC-MD5 hash of an ASCII value and key', function () {
strictEqual($.md5('value', 'key', true), '\x01C>\xfd_\x162~\xa4\xb3\x11DW,g\xf6');
});
test('Creating raw HMAC-MD5 hash of an UTF-8 value and key', function () {
strictEqual($.md5('日本', '日本', true), '\xc7\x8b\x8csW\x92i\x81\xcc\x04t\x0b\xd3\xe9\xd0\x15');
});
}(typeof jQuery === 'function' ? jQuery : this));
+40 -2
View File
@@ -846,7 +846,7 @@ label.error {
.openerp .oe_frame.oe_forms {
clear: both;
}
.openerp table.oe_frame td {
.openerp table.oe_frame {
color: #4c4c4c;
}
.openerp td.oe_form_frame_cell {
@@ -874,7 +874,6 @@ label.error {
}
.openerp .oe_forms label.oe_label, .openerp .oe_forms label.oe_label_help {
text-align: right;
margin: 3px 0 0 10px;
}
.openerp label.oe_label_help span {
@@ -885,6 +884,18 @@ label.error {
top: -4px;
padding: 0 2px;
}
.openerp .oe_align_left {
text-align: left;
}
.openerp .oe_align_right {
text-align: right;
}
.openerp .oe_align_center {
text-align: center;
}
.openerp .oe_forms .oe_form_paragraph {
margin: 3px 0 0 0;
}
/* Inputs */
.openerp .oe_forms input[type="text"], .openerp .oe_forms input[type="password"], .openerp .oe_forms select, .openerp .oe_forms textarea {
@@ -1410,3 +1421,30 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
border-color: rgba(0,0,0,0);
border-left-color: #B5B9FF;
}
.openerp .oe_view_editor {
border-collapse: collapse;
padding: 0;
align: left;
width: 100%;
}
.openerp .oe_view_editor_colum{
font-size: 90%;
font-weight: normal;
padding: 0;
border-bottom: 1px solid #CFCCCC;
}
.openerp .oe_view_editor_row:hover{
background-color: #F3F3F3;
}
.openerp .oe_view_editor_tree_grid{
text-align: left;
white-space: nowrap;
border-collapse: collapse;
width: 100%;
}
.openerp .oe_view_editor_tree_grid a:hover {
color: blue;
}
.openerp .oe_view_editor_tree_grid a {
display: block;
}
+1 -1
View File
@@ -59,7 +59,7 @@ openerp.web = function(instance) {
openerp.web.formats(instance);
openerp.web.chrome(instance);
openerp.web.data(instance);
var files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import"];
var files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import","view_editor"];
for(var i=0; i<files.length; i++) {
if(openerp.web[files[i]]) {
openerp.web[files[i]](instance);
+22 -6
View File
@@ -29,11 +29,11 @@ openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Not
warn: function(title, text) {
this.$element.notify('create', 'oe_notification_alert', {
title: title,
text: text,
text: text
}, {
expires: false,
expires: false
});
},
}
});
@@ -195,10 +195,20 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading#
init: function(parent, element_id) {
this._super(parent, element_id);
this.count = 0;
this.blocked_ui = false;
this.session.on_rpc_request.add_first(this.on_rpc_event, 1);
this.session.on_rpc_response.add_last(this.on_rpc_event, -1);
},
on_rpc_event : function(increment) {
var self = this;
if (!this.count && increment === 1) {
// Block UI after 3s
this.long_running_timer = setTimeout(function () {
self.blocked_ui = true;
$.blockUI();
}, 3000);
}
this.count += increment;
if (this.count) {
//this.$element.html(QWeb.render("Loading", {}));
@@ -206,6 +216,12 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading#
this.$element.show();
this.widget_parent.$element.addClass('loading');
} else {
clearTimeout(this.long_running_timer);
// Don't unblock if blocked by somebody else
if (self.blocked_ui) {
this.blocked_ui = false;
$.unblockUI();
}
this.$element.fadeOut();
this.widget_parent.$element.removeClass('loading');
}
@@ -343,7 +359,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
self.$option_id.find("form[name=create_db_form]").validate({
submitHandler: function (form) {
var fields = $(form).serializeArray();
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
self.rpc("/web/database/create", {'fields': fields}, function(result) {
if (result.error) {
$.unblockUI();
@@ -392,7 +408,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
.html(QWeb.render("BackupDB", self))
.find("form[name=backup_db_form]").validate({
submitHandler: function (form) {
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
self.session.get_file({
form: form,
error: function (body) {
@@ -413,7 +429,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
self.$option_id.find("form[name=restore_db_form]").validate({
submitHandler: function (form) {
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
$(form).ajaxSubmit({
url: '/web/database/restore',
type: 'POST',
+7
View File
@@ -1043,9 +1043,16 @@ openerp.web.TranslationDataBase = openerp.web.Class.extend(/** @lends openerp.we
}
});
if ($.blockUI) {
$.blockUI.defaults.baseZ = 1100;
$.blockUI.defaults.message = '<img src="/web/static/src/img/throbber2.gif">';
}
openerp.web._t = new openerp.web.TranslationDataBase().build_translation_function();
openerp.web.qweb = new QWeb2.Engine();
openerp.web.qweb.debug = (window.location.search.indexOf('?debug') !== -1);
openerp.web.qweb.default_dict = {
'_' : _
}
openerp.web.qweb.format_text_node = function(s) {
// Note that 'this' is the Qweb Node of the text
var translation = this.node.parentNode.attributes['t-translation'];
+2 -8
View File
@@ -27,14 +27,8 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
return _.sprintf('%d', value);
case 'float':
var precision = descriptor.digits ? descriptor.digits[1] : 2;
var int_part = Math.floor(value);
var dec_part = _.sprintf(
'%.' + precision + 'f',
Math.abs(value) % 1).substring(2);
return _.sprintf('%d%s%s',
int_part,
openerp.web._t.database.parameters.decimal_point,
dec_part);
return _.sprintf('%.' + precision + 'f', value)
.replace('.', openerp.web._t.database.parameters.decimal_point);
case 'float_time':
return _.sprintf("%02d:%02d",
Math.floor(value),
+516
View File
@@ -0,0 +1,516 @@
openerp.web.view_editor = function(openerp) {
var QWeb = openerp.web.qweb;
openerp.web.ViewEditor = openerp.web.Widget.extend({
init: function(parent, element_id, dataset, view, options) {
this._super(parent);
this.element_id = element_id
this.parent = parent
this.dataset = dataset;
this.model = dataset.model;
this.xml_id = 0;
},
start: function() {
this.init_view_editor();
},
init_view_editor: function() {
var self = this;
var action = {
name:'ViewEditor',
context:this.session.user_context,
domain: [["model", "=", this.dataset.model]],
res_model : 'ir.ui.view',
views : [[false, 'list']],
type: 'ir.actions.act_window',
target: "current",
limit : 80,
auto_search : true,
flags: {
sidebar: false,
deletable: false,
views_switcher: false,
action_buttons:false,
search_view:false,
pager:false,
radio: true
},
};
this.view_edit_dialog = new openerp.web.Dialog(this, {
modal: true,
title: 'ViewEditor',
width: 750,
height: 500,
buttons: {
"Create": function(){
//to do
},
"Edit": function(){
self.xml_id=0;
self.get_data();
},
"Close": function(){
self.view_edit_dialog.close();
}
},
});
this.view_edit_dialog.start().open();
var action_manager = new openerp.web.ActionManager(this);
action_manager.appendTo(this.view_edit_dialog);
action_manager.do_action(action);
},
check_attr: function(xml, tag, level) {
var obj = {'child_id': [], 'id': this.xml_id++, 'level': level+1, 'att_list': [], 'name': ""};
var render_name = "<" + tag;
obj.att_list.push(tag);
$(xml).each(function() {
_.each(this.attributes, function(attrs){
if (tag != 'button') {
if (attrs.nodeName == "string" || attrs.nodeName == "name" || attrs.nodeName == "index") {
render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"' ;
}
} else {
if (attrs.nodeName == "name") {
render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"';
}
}
obj.att_list.push( [attrs.nodeName,attrs.nodeValue] );
});
render_name+= ">";
});
obj.name = render_name;
return obj;
},
save_object: function(val, parent_list, child_obj_list) {
var self = this;
var check_id = parent_list[0];
var p_list = parent_list.slice(1);
if (val.child_id.length != 0) {
_.each(val.child_id, function(val, key) {
if (val.id == check_id) {
if (p_list.length!=0) {
self.save_object(val, p_list, child_obj_list);
} else {
val.child_id = child_obj_list;
return false;
}
}
});
} else {
val.child_id = child_obj_list;
}
},
xml_node_create: function(xml, root, parent_list, parent_id, main_object){
var self = this;
var child_obj_list = [];
var children_list = $(xml).filter(root).children();
var parents = $(children_list[0]).parents().get();
_.each(children_list, function (child_node) {
child_obj_list.push(self.check_attr(child_node,child_node.tagName.toLowerCase(),parents.length));
});
if (children_list.length != 0) {
if (parents.length <= parent_list.length) {
parent_list.splice(parents.length - 1);
}
parent_list.push(parent_id);
self.save_object(main_object[0], parent_list.slice(1), child_obj_list);
}
for (var i = 0; i < children_list.length; i++) {
self.xml_node_create
(children_list[i], children_list[i].tagName.toLowerCase(),
parent_list, child_obj_list[i].id, main_object);
}
return main_object;
},
parse_xml: function(arch, view_id) {
var root = $(arch).filter(":first")[0];
var tag = root.tagName.toLowerCase();
var obj ={'child_id':[],'id':this.xml_id++,'level':0,'att_list':[],'name':"<view view_id='"+view_id+"'>"};
var root_object = this.check_attr(root,tag,0);
obj.child_id = this.xml_node_create(arch, tag, [], this.xml_id-1, [root_object], [])
return [obj];
},
get_data: function() {
var self = this;
var view_arch_list = [];
self.main_view_id =((this.view_edit_dialog.$element.find("input[name='radiogroup']:checked").parent()).parent()).attr('data-id');
var ve_dataset = new openerp.web.DataSet(this, 'ir.ui.view');
ve_dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type'], function (arch) {
one_object = self.parse_xml(arch[0].arch,self.main_view_id);
self.main_view_type = arch[0].type
view_arch_list.push({"view_id" : self.main_view_id, "arch" : arch[0].arch});
dataset = new openerp.web.DataSetSearch(self, 'ir.ui.view', null, null);
dataset.read_slice([], {domain : [['inherit_id','=', parseInt(self.main_view_id)]]}, function (result) {
_.each(result, function(res) {
view_arch_list.push({"view_id":res.id,"arch":res.arch});
self.inherit_view(one_object, res);
});
return self.edit_view({"main_object": one_object,
"parent_child_id": self.parent_child_list(one_object, []),
"arch": view_arch_list});
});
});
},
parent_child_list : function(one_object, p_list) {
var self = this;
_.each(one_object , function(element){
if(element.child_id.length != 0){
p_list.push({"key":element.id,"value":_.pluck(element.child_id, 'id')});
self.parent_child_list(element.child_id, p_list);
}
});
return p_list;
},
inherit_view : function(one_object, result) {
var self = this;
var root = $(result.arch).filter('*');
var xml_list = [];
if (root[0].tagName.toLowerCase() == "data") {
xml_list = $(root[0]).children();
} else {
xml_list.push(root[0]);
}
_.each(xml_list , function(xml){
var parent_id;
var check_list = [];
var xpath_object = self.parse_xml(xml,result.id);
if (xml.tagName.toLowerCase() == "xpath" ) {
var part_expr = _.without($(xml).attr('expr').split("/"),"");
_.each(part_expr,function(part){
check_list.push(_.without($.trim(part.replace(/[^a-zA-Z 0-9 _]+/g,'!')).split("!"),""));
});
} else {
var temp = [];
_.each(xpath_object[0].child_id[0].att_list, function(list){
if(!_.include(list, "position")){
temp.push(list);
}
});
check_list = [_.flatten(temp)];
}
self.full_path_search(check_list ,one_object ,xpath_object);
});
},
full_path_search: function(check_list ,val ,xpath_object) {
var self = this;
if(xpath_object.length!=0){
var check = check_list[0];
var obj;
switch (check.length) {
case 2:
if(parseInt(check[1])){
var list_1 = _.select(val,function(element){
var main_list = _.flatten(element.att_list);
return _.include(main_list, check[0]);
});
obj = val[_.indexOf(val,list_1[parseInt(check[1])-1])];
} else {
obj = _.detect(val, function(element){
var main_list = _.flatten(element.att_list);
return _.include(main_list, check[0]);
});
}
break;
case 3:
obj = _.detect(val,function(element){
var main_list = _.flatten(element.att_list);
check = _.uniq(check);
var insert = _.intersection(main_list,check);
if(insert.length == check.length ){return element;}
});
break;
case 1:
var list_1 = _.select(val,function(element){
var main_list = _.flatten(element.att_list);
return _.include(main_list, check[0]);
});
if(list_1.length != 0){
(check_list.length == 1)? obj = list_1[0] : check_list.shift();
}
break;
}
if(obj) {
check_list.shift();
if (check_list.length !=0){
self.full_path_search(check_list ,obj.child_id ,xpath_object);
} else {
var level = obj.level+1;
self.increase_level(xpath_object[0], level)
obj.child_id.push(xpath_object[0]);
xpath_object.pop();
return;
}
}
else {
_.each(val,function(element){
self.full_path_search(check_list ,element.child_id ,xpath_object);
});
}
}
},
increase_level: function(val, level) {
var self = this;
val.level = level;
_.each(val.child_id, function(val, key) {
self.increase_level(val, level + 1);
});
},
edit_view: function(one_object) {
var self = this;
this.edit_xml_dialog = new openerp.web.Dialog(this,{
modal: true,
title: 'View Editor',
width: 750,
height: 500,
buttons: {
"Inherited View": function(){
//todo
},
"Preview": function(){
var action = {
context:self.session.user_context,
res_model : self.model,
views : [[self.main_view_id, self.main_view_type]],
type: 'ir.actions.act_window',
target: "new",
flags: {
sidebar: false,
views_switcher: false,
action_buttons:false,
search_view:false,
pager:false,
},
};
var action_manager = new openerp.web.ActionManager(self);
action_manager.do_action(action);
},
"Close": function(){
self.edit_xml_dialog.close();
}
}
});
this.edit_xml_dialog.start().open();
this.edit_xml_dialog.$element.html(QWeb.render('view_editor', {
'data': one_object['main_object'],
}));
this.edit_xml_dialog.$element.find("tr[id^='viewedit-']").click(function() {
self.edit_xml_dialog.$element.find("tr[id^='viewedit-']").removeClass('ui-selected');
$(this).addClass('ui-selected');
});
this.edit_xml_dialog.$element.find("img[id^='parentimg-']").click(function() {
if ($(this).attr('src') == '/web/static/src/img/collapse.gif') {
$(this).attr('src', '/web/static/src/img/expand.gif');
self.on_expand(this);
} else {
$(this).attr('src', '/web/static/src/img/collapse.gif');
var id = this.id.split('-')[1];
self.on_collapse(this,one_object['parent_child_id'], one_object['main_object']);
}
});
this.edit_xml_dialog.$element.find("img[id^='side-']").click(function() {
var side = $(this).closest("tr[id^='viewedit-']")
var id_tr = (side.attr('id')).split('-')[1];
var img = side.find("img[id='parentimg-"+id_tr+"']").attr('src'); ;
var level = parseInt(side.attr('level'));
var list_shift =[];
var last_tr;
var cur_tr = side;
list_shift.push(side);
var next_tr;
var ls = side;
var view_id;
var view_xml_id;
while(1){
ls = ls.prev();
if((self.edit_xml_dialog.$element.find(ls).find('a').text()).search("view_id") != -1
&& parseInt(ls.attr('level')) < level){
view_id = parseInt(($(ls).find('a').text()).replace(/[^0-9]+/g,''));
view_xml_id = (ls.attr('id')).split('-')[1];
break;
}
}
switch (this.id) {
case "side-add":
break;
case "side-remove":
break;
case "side-edit":
break;
case "side-up":
while (1) {
var prev_tr = cur_tr.prev();
if(level >= parseInt(prev_tr.attr('level')) || prev_tr.length == 0) {
last_tr = prev_tr;
break;
}
cur_tr = prev_tr;
}
if (img) {
while (1) {
next_tr = side.next();
if ( parseInt(next_tr.attr('level')) <= level || next_tr.length == 0) {
break;
} else {
list_shift.push(next_tr);
side = next_tr;
}
}
}
if (last_tr.length != 0 && parseInt(last_tr.attr('level')) == level &&
(self.edit_xml_dialog.$element.find(last_tr).find('a').text()).search("view_id") == -1) {
_.each(list_shift, function(rec) {
$(last_tr).before(rec);
});
self.save_move_arch(one_object, view_id, view_xml_id, id_tr, level, "up");
}
break;
case "side-down":
if (img) {
while (1) {
next_tr = cur_tr.next();
if ( parseInt(next_tr.attr('level')) <= level || next_tr.length == 0) {
last_tr = next_tr;
break;
} else {
list_shift.push(next_tr);
cur_tr = next_tr;
}
}
}
else {
last_tr = cur_tr.next();
}
if((self.edit_xml_dialog.$element.find(last_tr).find('a').text()).search("view_id") != -1){
return;
}
if (last_tr.length != 0 && parseInt(last_tr.attr('level')) == level) {
var last_tr_id = (last_tr.attr('id')).split('-')[1];
img = last_tr.find("img[id='parentimg-" + last_tr_id + "']").attr('src');
if (img) {
self.edit_xml_dialog.$element.find("img[id='parentimg-" + last_tr_id + "']").
attr('src', '/web/static/src/img/expand.gif');
while (1) {
var next_tr = last_tr.next();
if (next_tr.attr('level') <= level || next_tr.length == 0) break;
next_tr.hide();
last_tr = next_tr;
}
}
list_shift.reverse();
_.each(list_shift, function(rec) {
$(last_tr).after(rec);
});
self.save_move_arch(one_object, view_id, view_xml_id, id_tr, level, "down");
}
break;
}
});
},
save_move_arch: function(one_object, view_id, view_xml_id, id_tr, level, move_direct){
var self = this;
var arch = _.detect(one_object['arch'],function(element){
return element.view_id == view_id;
});
var obj = self.get_view_object(view_xml_id, one_object['main_object'], []);
if(($(arch.arch).filter("data")).length != 0 && view_xml_id != 0){
var check_list = _.flatten(obj[0].child_id[0].att_list);
arch.arch = _.detect($(arch.arch).children(), function(xml_child){
var temp_obj = self.check_attr(xml_child, xml_child.tagName.toLowerCase());
var main_list = _.flatten(temp_obj.att_list);
check_list = _.uniq(check_list);
var insert = _.intersection(main_list,check_list);
if(insert.length == check_list.length ){return xml_child;}
});
}
return self.get_node(arch.arch, obj[0].child_id[0], parseInt(id_tr), [], parseInt(level),
parseInt(view_id), arch, move_direct);
},
get_view_object: function(view_xml_id, one_object,result){
var self = this;
if(result.length==0){
var check = _.detect(one_object , function(obj){
return view_xml_id==obj.id;
});
if(check){result.push(check);};
_.each(one_object, function(obj){
self.get_view_object(view_xml_id, obj.child_id, result);
});
}
return result;
},
get_node: function(arch1, obj, id, child_list, level, view_id, arch, move_direct){
var self = this;
var children_list = $(arch1).children();
var list_obj_xml = _.zip(children_list,obj.child_id);
if (id) {
if (obj.id == id) {
var id;
var parent = $(arch1).parents();
var index = _.indexOf(child_list, obj)
var re_insert_obj = child_list.splice(index, 1);
if (move_direct == "down") {
var next = $(arch1).next();
$(next).after(arch1);
child_list.splice(index+1, 0, re_insert_obj[0]);
} else {
var prev = $(arch1).prev();
$(prev).before(arch1);
child_list.splice(index-1, 0, re_insert_obj[0]);
}
parent = parent[parent.length-1];
var convert_to_utf = self.xml2Str(parent);
if (convert_to_utf) {
convert_to_utf = convert_to_utf.replace('xmlns="http://www.w3.org/1999/xhtml"', "");
convert_to_utf = '<?xml version="1.0"?>' + convert_to_utf;
arch.arch = convert_to_utf;
dataset = new openerp.web.DataSet(this, 'ir.ui.view');
dataset.write(parseInt(view_id),{"arch":convert_to_utf}, function(r) {
});
}
}
if (obj.level <= level) {
_.each(list_obj_xml, function(child_node) {
self.get_node(child_node[0], child_node[1], id, obj.child_id, level, view_id, arch, move_direct);
});
}
}
},
xml2Str: function(xmlNode) {
try {
return (new XMLSerializer()).serializeToString(xmlNode);
}
catch (e) {
try {
return xmlNode.xml;
}
catch (e) {
return false;
}
}
},
on_expand: function(expand_img){
var level = parseInt($(expand_img).closest("tr[id^='viewedit-']").attr('level'));
var cur_tr = $(expand_img).closest("tr[id^='viewedit-']");
while (1) {
var nxt_tr = cur_tr.next();
if (parseInt(nxt_tr.attr('level')) > level){
cur_tr = nxt_tr;
nxt_tr.hide();
} else return nxt_tr;
}
},
on_collapse: function(collapse_img, parent_child_id, id, main_object) {
var self = this;
var id = collapse_img.id.split('-')[1];
var datas = _.detect(parent_child_id,function(res) {
return res.key == id;
});
_.each(datas.value, function(rec) {
var tr = self.edit_xml_dialog.$element.find("tr[id='viewedit-"+rec+"']");
tr.find("img[id='parentimg-"+rec+"']").attr('src','/web/static/src/img/expand.gif');
tr.show();
});
}
});
};
+188 -66
View File
@@ -89,7 +89,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
this.fields_view = data;
var frame = new (this.registry.get_object('frame'))(this, this.fields_view.arch);
this.rendered = QWeb.render(this.form_template, { 'frame': frame, 'view': this });
this.rendered = QWeb.render(this.form_template, { 'frame': frame, 'widget': this });
}
this.$element.html(this.rendered);
_.each(this.widgets, function(w) {
@@ -105,17 +105,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
this.$form_header.find('button.oe_form_button_cancel').click(this.do_cancel);
this.$form_header.find('button.oe_form_button_new').click(this.on_button_new);
this.$form_header.find('button.oe_form_button_duplicate').click(this.on_button_duplicate);
this.$form_header.find('button.oe_form_button_toggle').click(function () {
self.translatable_fields = [];
self.widgets = {};
self.fields = {};
self.$form_header.find('button').unbind('click');
self.registry = self.registry === openerp.web.form.widgets
? openerp.web.form.readonly
: openerp.web.form.widgets;
self.on_loaded(self.fields_view);
self.reload();
});
this.$form_header.find('button.oe_form_button_toggle').click(this.on_toggle_readonly);
if (this.options.sidebar && this.options.sidebar_id) {
this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id);
@@ -127,6 +117,18 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
}
this.has_been_loaded.resolve();
},
on_toggle_readonly: function() {
var self = this;
self.translatable_fields = [];
self.widgets = {};
self.fields = {};
self.$form_header.find('button').unbind('click');
self.registry = self.registry === openerp.web.form.widgets
? openerp.web.form.readonly
: openerp.web.form.widgets;
self.on_loaded(self.fields_view);
self.reload();
},
do_show: function () {
var promise;
if (this.dataset.index === null) {
@@ -715,6 +717,16 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form.
this.invisible = this.modifiers['invisible'] === true;
this.classname = 'oe_form_' + this.type;
this.align = parseFloat(this.node.attrs.align);
if (isNaN(this.align) || this.align === 1) {
this.align = 'right';
} else if (this.align === 0) {
this.align = 'left';
} else {
this.align = 'center';
}
this.width = this.node.attrs.width;
},
start: function() {
@@ -1044,8 +1056,7 @@ openerp.web.form.WidgetLabel = openerp.web.form.Widget.extend({
this._super(view, node);
// TODO fme: support for attrs.align
if (this.node.tag == 'label' && (this.node.attrs.colspan || (this.string && this.string.length > 32))) {
if (this.node.tag == 'label' && (this.align === 'left' || this.node.attrs.colspan || (this.string && this.string.length > 32))) {
this.template = "WidgetParagraph";
this.colspan = parseInt(this.node.attrs.colspan || 1, 10);
} else {
@@ -1170,6 +1181,10 @@ openerp.web.form.Field = openerp.web.form.Widget.extend(/** @lends openerp.web.f
openerp.web.form.FieldChar = openerp.web.form.Field.extend({
template: 'FieldChar',
init: function (view, node) {
this._super(view, node);
this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1';
},
start: function() {
this._super.apply(this, arguments);
this.$element.find('input').change(this.on_ui_change);
@@ -1814,7 +1829,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
self.original_value = undefined;
self._change_int_ext_value(rval);
};
if(typeof(value) === "number") {
if (value && !(value instanceof Array)) {
var dataset = new openerp.web.DataSetStatic(this, this.field.relation, self.build_context());
dataset.name_get([value], function(data) {
real_set_value(data[0]);
@@ -1917,7 +1932,8 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
multi_selection: false,
init: function(view, node) {
this._super(view, node);
this.is_started = $.Deferred();
this.is_loaded = $.Deferred();
this.initial_is_loaded = this.is_loaded;
this.is_setted = $.Deferred();
this.form_last_update = $.Deferred();
this.init_form_last_update = this.form_last_update;
@@ -1935,8 +1951,18 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
self.on_ui_change();
});
this.is_setted.then(function() {
self.load_views();
});
},
is_readonly: function() {
return this.readonly || this.force_readonly;
},
load_views: function() {
var self = this;
var modes = this.node.attrs.mode;
modes = !!modes ? modes.split(",") : ["tree", "form"];
modes = !!modes ? modes.split(",") : ["tree"];
var views = [];
_.each(modes, function(mode) {
var view = {
@@ -1949,25 +1975,38 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
}
if(view.view_type === "list") {
view.options.selectable = self.multi_selection;
if (self.is_readonly()) {
view.options.addable = null;
view.options.deletable = null;
}
} else if (view.view_type === "form") {
view.options.not_interactible_on_create = true;
}
views.push(view);
});
this.views = views;
this.viewmanager = new openerp.web.ViewManager(this, this.dataset, views);
this.viewmanager.registry = openerp.web.views.clone({
list: 'openerp.web.form.One2ManyListView',
form: 'openerp.web.form.One2ManyFormView'
form: 'openerp.web.FormView'
});
var once = $.Deferred().then(function() {
self.init_form_last_update.resolve();
});
var def = $.Deferred().then(function() {
self.initial_is_loaded.resolve();
});
this.viewmanager.on_controller_inited.add_last(function(view_type, controller) {
if (view_type == "list") {
controller.o2m = self;
if (self.is_readonly())
controller.set_editable(false);
} else if (view_type == "form") {
if (self.is_readonly()) {
controller.on_toggle_readonly();
$(controller.$element.find(".oe_form_buttons")[0]).children().remove();
}
controller.on_record_loaded.add_last(function() {
once.resolve();
});
@@ -1978,33 +2017,40 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
} else if (view_type == "graph") {
self.reload_current_view()
}
self.is_started.resolve();
def.resolve();
});
this.viewmanager.on_mode_switch.add_first(function() {
self.save_form_view();
this.viewmanager.on_mode_switch.add_first(function(n_mode, b, c, d, e) {
$.when(self.save_form_view()).then(function() {
if(n_mode === "list")
setTimeout(function() {self.reload_current_view();}, 0);
});
});
this.is_setted.then(function() {
setTimeout(function () {
self.viewmanager.appendTo(self.$element);
}, 0);
});
return def;
},
reload_current_view: function() {
var self = this;
var view = self.viewmanager.views[self.viewmanager.active_view].controller;
if(self.viewmanager.active_view === "list") {
view.reload_content();
} else if (self.viewmanager.active_view === "form") {
if (this.dataset.index === null && this.dataset.ids.length >= 1) {
this.dataset.index = 0;
self.is_loaded = self.is_loaded.pipe(function() {
var view = self.viewmanager.views[self.viewmanager.active_view].controller;
if(self.viewmanager.active_view === "list") {
return view.reload_content();
} else if (self.viewmanager.active_view === "form") {
if (self.dataset.index === null && self.dataset.ids.length >= 1) {
self.dataset.index = 0;
}
var act = function() {
return view.do_show();
}
self.form_last_update = self.form_last_update.pipe(act, act);
return self.form_last_update;
} else if (self.viewmanager.active_view === "graph") {
return view.do_search(self.build_domain(), self.dataset.get_context(), []);
}
var act = function() {
return view.do_show();
}
this.form_last_update = this.form_last_update.pipe(act, act);;
} else if (self.viewmanager.active_view === "graph") {
view.do_search(this.build_domain(), this.dataset.get_context(), []);
}
});
},
set_value: function(value) {
value = value || [];
@@ -2061,9 +2107,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
if (this.dataset.index === null && this.dataset.ids.length > 0) {
this.dataset.index = 0;
}
$.when(this.is_started).then(function() {
self.reload_current_view();
});
self.reload_current_view();
this.is_setted.resolve();
},
get_value: function() {
@@ -2127,7 +2171,18 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
},
update_dom: function() {
this._super.apply(this, arguments);
this.$element.toggleClass('disabled', this.readonly);
var self = this;
if (this.previous_readonly !== this.readonly) {
this.previous_readonly = this.readonly;
if (this.viewmanager) {
this.is_loaded = this.is_loaded.pipe(function() {
self.viewmanager.stop();
return $.when(self.load_views()).then(function() {
self.reload_current_view();
});
});
}
}
}
});
@@ -2138,9 +2193,6 @@ openerp.web.form.One2ManyDataSet = openerp.web.BufferedDataSet.extend({
}
});
openerp.web.form.One2ManyFormView = openerp.web.FormView.extend({
});
openerp.web.form.One2ManyListView = openerp.web.ListView.extend({
do_add_record: function () {
if (this.options.editable) {
@@ -2179,7 +2231,8 @@ openerp.web.form.One2ManyListView = openerp.web.ListView.extend({
read_function: function() {
return self.o2m.dataset.read_ids.apply(self.o2m.dataset, arguments);
},
form_view_options: {'not_interactible_on_create':true}
form_view_options: {'not_interactible_on_create':true},
readonly: self.o2m.is_readonly()
});
pop.on_write.add(function(id, data) {
self.o2m.dataset.write(id, data, {}, function(r) {
@@ -2195,7 +2248,9 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
init: function(view, node) {
this._super(view, node);
this.list_id = _.uniqueId("many2many");
this.is_started = $.Deferred();
this.is_loaded = $.Deferred();
this.initial_is_loaded = this.is_loaded;
this.is_setted = $.Deferred();
},
start: function() {
this._super.apply(this, arguments);
@@ -2207,18 +2262,10 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
this.dataset.on_unlink.add_last(function(ids) {
self.on_ui_change();
});
this.list_view = new openerp.web.form.Many2ManyListView(this, this.dataset, false, {
'addable': 'Add',
'selectable': self.multi_selection
});
this.list_view.m2m_field = this;
this.list_view.on_loaded.add_last(function() {
self.is_started.resolve();
this.is_setted.then(function() {
self.load_view();
});
setTimeout(function () {
self.list_view.appendTo($("#" + self.list_id));
}, 0);
},
set_value: function(value) {
value = value || [];
@@ -2228,16 +2275,56 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
this._super(value);
this.dataset.set_ids(value);
var self = this;
$.when(this.is_started).then(function() {
self.list_view.reload_content();
});
self.reload_content();
this.is_setted.resolve();
},
get_value: function() {
return [commands.replace_with(this.dataset.ids)];
},
validate: function() {
this.invalid = false;
// TODO niv
},
is_readonly: function() {
return this.readonly || this.force_readonly;
},
load_view: function() {
var self = this;
this.list_view = new openerp.web.form.Many2ManyListView(this, this.dataset, false, {
'addable': self.is_readonly() ? null : 'Add',
'deletable': self.is_readonly() ? false : true,
'selectable': self.multi_selection
});
this.list_view.m2m_field = this;
var loaded = $.Deferred();
this.list_view.on_loaded.add_last(function() {
self.initial_is_loaded.resolve();
loaded.resolve();
});
setTimeout(function () {
self.list_view.appendTo($("#" + self.list_id));
}, 0);
return loaded;
},
reload_content: function() {
var self = this;
this.is_loaded = this.is_loaded.pipe(function() {
return self.list_view.reload_content();
});
},
update_dom: function() {
this._super.apply(this, arguments);
var self = this;
if (this.previous_readonly !== this.readonly) {
this.previous_readonly = this.readonly;
if (this.list_view) {
this.is_loaded = this.is_loaded.pipe(function() {
self.list_view.stop();
return $.when(self.load_view()).then(function() {
self.reload_content();
});
});
}
}
}
});
@@ -2341,10 +2428,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
this.searchview.stop();
}
this.searchview = new openerp.web.SearchView(this,
this.dataset, false, {
"selectable": !this.options.disable_multiple_selection,
"deletable": false
});
this.dataset, false, {});
this.searchview.on_search.add(function(domains, contexts, groupbys) {
if (self.initial_ids) {
self.do_search(domains.concat([[["id", "in", self.initial_ids]], self.domain]),
@@ -2371,7 +2455,9 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
});
self.view_list = new openerp.web.form.SelectCreateListView(self,
self.dataset, false,
_.extend({'deletable': false}, self.options.list_view_options || {}));
_.extend({'deletable': false,
'selectable': !self.options.disable_multiple_selection
}, self.options.list_view_options || {}));
self.view_list.popup = self;
self.view_list.appendTo($("#" + self.element_id + "_view_list")).pipe(function() {
self.view_list.do_show();
@@ -2490,6 +2576,7 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
* - read_function
* - parent_view
* - form_view_options
* - readonly
*/
show_element: function(model, row_id, context, options) {
this.model = model;
@@ -2529,7 +2616,13 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
this.view_form.set_embedded_view(this.options.alternative_form_view);
}
this.view_form.appendTo(this.$element.find("#" + this.element_id + "_view_form"));
var once = $.Deferred().then(function() {
if (self.options.readonly) {
self.view_form.on_toggle_readonly();
}
});
this.view_form.on_loaded.add_last(function() {
once.resolve();
var $buttons = self.view_form.$element.find(".oe_form_buttons");
$buttons.html(QWeb.render("FormOpenPopup.form.buttons"));
var $nbutton = $buttons.find(".oe_formopenpopup-form-save");
@@ -2542,6 +2635,10 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
$cbutton.click(function() {
self.stop();
});
if (self.options.readonly) {
$nbutton.hide();
$cbutton.text(_t("Close"));
}
self.view_form.do_show();
});
this.dataset.on_write.add(this.on_write);
@@ -2829,9 +2926,16 @@ openerp.web.form.FieldReadonly = openerp.web.form.Field.extend({
});
openerp.web.form.FieldCharReadonly = openerp.web.form.FieldReadonly.extend({
template: 'FieldChar.readonly',
init: function(view, node) {
this._super(view, node);
this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1';
},
set_value: function (value) {
this._super.apply(this, arguments);
var show_value = openerp.web.format_value(value, this, '');
if (this.password) {
show_value = new Array(show_value.length + 1).join('*');
}
this.$element.find('div').text(show_value);
return show_value;
}
@@ -2894,9 +2998,17 @@ openerp.web.form.FieldMany2OneReadonly = openerp.web.form.FieldCharReadonly.exte
self.update_dom();
self.on_value_changed();
var real_set_value = function(rval) {
self.$element.find('div').text(rval ? rval[1] : '');
self.value = rval;
var div = $(self.$element.find('div'));
div.html('<a href="javascript:void(0)"></a>');
var a = $(div.find("a"));
a.text(rval ? rval[1] : '');
a.click(function() {
var pop = new openerp.web.form.FormOpenPopup(self.view);
pop.show_element(self.field.relation, self.value[0],self.build_context(), {readonly:true});
});
};
if(typeof(value) === "number") {
if (value && !(value instanceof Array)) {
var dataset = new openerp.web.DataSetStatic(
this, this.field.relation, self.build_context());
dataset.name_get([value], function(data) {
@@ -2941,6 +3053,13 @@ openerp.web.form.widgets = new openerp.web.Registry({
'binary': 'openerp.web.form.FieldBinaryFile',
'statusbar': 'openerp.web.form.FieldStatus'
});
openerp.web.form.FieldMany2ManyReadonly = openerp.web.form.FieldMany2Many.extend({
force_readonly: true
});
openerp.web.form.FieldOne2ManyReadonly = openerp.web.form.FieldOne2Many.extend({
force_readonly: true
});
openerp.web.form.readonly = openerp.web.form.widgets.clone({
'char': 'openerp.web.form.FieldCharReadonly',
'email': 'openerp.web.form.FieldEmailReadonly',
@@ -2951,6 +3070,9 @@ openerp.web.form.readonly = openerp.web.form.widgets.clone({
'datetime': 'openerp.web.form.FieldCharReadonly',
'selection' : 'openerp.web.form.FieldSelectionReadonly',
'many2one': 'openerp.web.form.FieldMany2OneReadonly',
'many2many' : 'openerp.web.form.FieldMany2ManyReadonly',
'one2many' : 'openerp.web.form.FieldOne2ManyReadonly',
'one2many_list' : 'openerp.web.form.FieldOne2ManyReadonly',
'boolean': 'openerp.web.form.FieldBooleanReadonly',
'float': 'openerp.web.form.FieldCharReadonly',
'integer': 'openerp.web.form.FieldCharReadonly',
+53 -4
View File
@@ -11,7 +11,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
// whether the column headers should be displayed
'header': true,
// display addition button, with that label
'addable': _t("New"),
'addable': _t("Create"),
// whether the list view can be sorted, note that once a view has been
// sorted it can not be reordered anymore
'sortable': true,
@@ -201,8 +201,15 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
this.setup_columns(this.fields_view.fields, grouped);
this.$element.html(QWeb.render("ListView", this));
// Head hook
this.$element.find('.all-record-selector').click(function(){
self.$element.find('.oe-record-selector input').prop('checked',
self.$element.find('.all-record-selector').prop('checked') || false);
var selection = self.groups.get_selection();
$(self.groups).trigger(
'selected', [selection.ids, selection.records]);
});
this.$element.find('.oe-list-add')
.click(this.do_add_record)
.attr('disabled', grouped && this.options.editable);
@@ -424,10 +431,13 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
},
/**
* re-renders the content of the list view
*
* @returns {$.Deferred} promise to content reloading
*/
reload_content: function () {
var self = this;
this.records.reset();
var reloaded = $.Deferred();
this.$element.find('.oe-listview-content').append(
this.groups.render(function () {
if (self.dataset.index == null) {
@@ -438,7 +448,9 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
}
}
self.compute_aggregates();
reloaded.resolve();
}));
return reloaded.promise();
},
/**
* Handler for the result of eval_domain_and_context, actually perform the
@@ -512,6 +524,17 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
return field.name === name;
});
if (!action) { return; }
var c = new openerp.web.CompoundContext();
c.set_eval_context(_.extend({
active_id: id,
active_ids: [id],
active_model: this.dataset.model
}, this.records.get(id).toContext()));
if (action.context) {
c.add(action.context);
}
action.context = c;
this.do_execute_action(action, this.dataset, id, callback);
},
/**
@@ -1201,6 +1224,10 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L
var options = { offset: page * limit, limit: limit };
//TODO xmo: investigate why we need to put the setTimeout
setTimeout(function() {dataset.read_slice(fields, options , 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 {
@@ -1430,6 +1457,25 @@ var Record = openerp.web.Class.extend(/** @lends Record# */{
}
return {data: form_data};
},
/**
* Converts the current record to a format expected by context evaluations
* (identical to record.attributes, except m2o fields are their integer
* value rather than a pair)
*/
toContext: function () {
var output = {}, attrs = this.attributes;
for(var k in attrs) {
var val = attrs[k];
if (typeof val !== 'object') {
output[k] = val;
} else if (val instanceof Array) {
output[k] = val[0];
} else {
throw new Error("Can't convert value " + val + " to context");
}
}
return output;
}
});
Record.include(Events);
@@ -1541,7 +1587,8 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{
* @param {Array} [records]
* @returns this
*/
reset: function (records) {
reset: function (records, options) {
options = options || {};
_(this._proxies).each(function (proxy) {
proxy.reset();
});
@@ -1552,7 +1599,9 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{
if (records) {
this.add(records);
}
this.trigger('reset', this);
if (!options.silent) {
this.trigger('reset', this);
}
return this;
},
/**
+64 -23
View File
@@ -78,6 +78,17 @@ openerp.web.list_editable = function (openerp) {
// tree/@editable takes priority on everything else if present.
this.options.editable = data.arch.attrs.editable || this.options.editable;
return this._super(data, grouped);
},
/**
* Ensures the editable list is saved (saves any pending edition if
* needed, or tries to)
*
* Returns a deferred to the end of the saving.
*
* @returns {$.Deferred}
*/
ensure_saved: function () {
return this.groups.ensure_saved();
}
});
@@ -86,6 +97,18 @@ openerp.web.list_editable = function (openerp) {
new_record: function () {
// TODO: handle multiple children
this.children[null].new_record();
},
/**
* Ensures descendant editable List instances are all saved if they have
* pending editions.
*
* @returns {$.Deferred}
*/
ensure_saved: function () {
return $.when.apply(null,
_.invoke(
_.values(this.children),
'ensure_saved'));
}
});
@@ -254,9 +277,11 @@ openerp.web.list_editable = function (openerp) {
* sibling if asked.
*
* @param {Boolean} [edit_next=false] should the next row become editable
* @returns {$.Deferred}
*/
save_row: function (edit_next) {
var self = this;
//noinspection JSPotentiallyInvalidConstructorUsage
var self = this, done = $.Deferred();
this.edition_form.do_save(function (result) {
if (result.created && !self.edition_id) {
self.records.add({id: result.result},
@@ -267,28 +292,44 @@ openerp.web.list_editable = function (openerp) {
next_record = self.records.at(
self.records.indexOf(edited_record) + 1);
self.handle_onwrite(self.edition_id);
self.cancel_pending_edition().then(function () {
$(self).trigger('saved', [self.dataset]);
if (!edit_next) {
return;
}
if (result.created) {
self.new_record();
return;
}
var next_record_id;
if (next_record) {
next_record_id = next_record.get('id');
self.dataset.index = _(self.dataset.ids)
.indexOf(next_record_id);
} else {
self.dataset.index = 0;
next_record_id = self.records.at(0).get('id');
}
self.edit_record(next_record_id);
});
}, this.options.editable === 'top');
$.when(
self.handle_onwrite(self.edition_id),
self.cancel_pending_edition().then(function () {
$(self).trigger('saved', [self.dataset]);
if (!edit_next) {
return;
}
if (result.created) {
self.new_record();
return;
}
var next_record_id;
if (next_record) {
next_record_id = next_record.get('id');
self.dataset.index = _(self.dataset.ids)
.indexOf(next_record_id);
} else {
self.dataset.index = 0;
next_record_id = self.records.at(0).get('id');
}
self.edit_record(next_record_id);
})).then(function () {
done.resolve();
});
}, this.options.editable === 'top').fail(function () {
done.reject();
});
return done.promise();
},
/**
* If the current list is being edited, ensures it's saved
*/
ensure_saved: function () {
if (this.edition) {
return this.save_row();
}
//noinspection JSPotentiallyInvalidConstructorUsage
return $.Deferred().resolve().promise();
},
/**
* Cancels the edition of the row for the current dataset index
+45 -19
View File
@@ -271,6 +271,10 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View
}
}
}
$.when(view_promise).then(function () {
self.$element.find('.oe_view_title:first').text(
self.display_title());
});
return view_promise;
},
/**
@@ -331,7 +335,15 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View
/**
* Called by children view after executing an action
*/
on_action_executed: function () {}
on_action_executed: function () {},
display_title: function () {
var view = this.views[this.active_view];
if (view) {
// ick
return view.controller.fields_view.arch.attrs.string;
}
return '';
}
});
session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepnerp.web.ViewManagerAction# */{
@@ -444,6 +456,16 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
if (!self.action.name && fvg) {
self.$element.find('.oe_view_title').text(fvg.arch.attrs.string || fvg.name);
}
var $title = self.$element.find('.oe_view_title'),
$search_prefix = $title.find('span');
if (controller.searchable !== false) {
if (!$search_prefix.length) {
$title.prepend('<span>' + _t("Search:") + '</span>');
}
} else {
$search_prefix.remove();
}
});
},
shortcut_check : function(view) {
@@ -512,6 +534,9 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
return false;
});
});
},
display_title: function () {
return this.action.name;
}
});
@@ -544,7 +569,7 @@ session.web.Sidebar = session.web.Widget.extend({
{
label: _t("Manage Views"),
callback: this.call_default_on_sidebar,
title: _t("Manage views of the current object"),
title: _t("Manage views of the current object")
}, {
label: _t("Edit Workflow"),
callback: this.call_default_on_sidebar,
@@ -553,7 +578,7 @@ session.web.Sidebar = session.web.Widget.extend({
}, {
label: _t("Customize Object"),
callback: this.call_default_on_sidebar,
title: _t("Manage views of the current object"),
title: _t("Manage views of the current object")
}
]);
@@ -561,10 +586,10 @@ session.web.Sidebar = session.web.Widget.extend({
this.add_items('other', [
{
label: _t("Import"),
callback: this.call_default_on_sidebar,
callback: this.call_default_on_sidebar
}, {
label: _t("Export"),
callback: this.call_default_on_sidebar,
callback: this.call_default_on_sidebar
}, {
label: _t("Translate"),
callback: this.call_default_on_sidebar,
@@ -604,7 +629,7 @@ session.web.Sidebar = session.web.Widget.extend({
var $section = $(session.web.qweb.render("Sidebar.section", {
section_id: section_id,
name: name,
classname: 'oe_sidebar_' + code,
classname: 'oe_sidebar_' + code
}));
$section.appendTo(this.$element.find('div.sidebar-actions'));
this.sections[code] = $section;
@@ -917,7 +942,8 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
},
on_sidebar_manage_views: function() {
if (this.fields_view && this.fields_view.arch) {
$('<xmp>' + session.web.json_node_to_xml(this.fields_view.arch, true) + '</xmp>').dialog({ width: '95%', height: 600});
var view_editor = new session.web.ViewEditor(this, this.$element, this.dataset, this.fields_view.arch);
view_editor.start();
} else {
this.do_warn("Manage Views", "Could not find current view declaration");
}
@@ -943,19 +969,19 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
}
});
session.web.json_node_to_xml = function(node, single_quote, indent) {
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
indent = indent || 0;
var sindent = (human_readable ? (new Array(indent + 1).join('\t')) : ''),
r = sindent + '<' + node.tag,
cr = human_readable ? '\n' : '';
if (typeof(node) === 'string') {
return node;
}
else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
return sindent + node;
} else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
throw("Node a json node");
}
indent = indent || 0;
var sindent = new Array(indent + 1).join('\t'),
r = sindent + '<' + node.tag;
for (var attr in node.attrs) {
var vattr = node.attrs[attr];
if (typeof(vattr) !== 'string') {
@@ -963,19 +989,19 @@ session.web.json_node_to_xml = function(node, single_quote, indent) {
vattr = JSON.stringify(vattr);
}
vattr = vattr.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
if (single_quote) {
if (human_readable) {
vattr = vattr.replace(/&quot;/g, "'");
}
r += ' ' + attr + '="' + vattr + '"';
}
if (node.children && node.children.length) {
r += '>\n';
r += '>' + cr;
var childs = [];
for (var i = 0, ii = node.children.length; i < ii; i++) {
childs.push(session.web.json_node_to_xml(node.children[i], single_quote, indent + 1));
childs.push(session.web.json_node_to_xml(node.children[i], human_readable, indent + 1));
}
r += childs.join('\n');
r += '\n' + sindent + '</' + node.tag + '>';
r += childs.join(cr);
r += cr + sindent + '</' + node.tag + '>';
return r;
} else {
return r + '/>';
+71 -12
View File
@@ -415,6 +415,9 @@
<tr>
<td class="view-manager-main-content">
<div class="oe-view-manager-header">
<h2 class="oe_view_title" t-if="self.flags.display_title !== false">
<t t-esc="self.display_title()"/>
</h2>
<div class="oe_vm_switch">
<t t-if="views.length != 1" t-foreach="views" t-as="view">
<button type="button" t-att-data-view-type="view.view_type">
@@ -452,9 +455,6 @@
<button t-if="self.session.debug" class="oe_get_xml_view">
View#<span></span>
</button>
<h2 class="oe_view_title" t-if="self.flags.display_title !== false">
<t t-if="self.flags.display_title !== false" t-esc="self.action.name"/>
</h2>
</t>
<t t-jquery=".oe-view-manager-header" t-operation="after">
<ul class="oe-view-manager-logs"></ul>
@@ -579,7 +579,8 @@
<t t-esc="column.string"/>
</th>
</t>
<th t-if="options.selectable" width="1"/>
<th t-if="options.selectable" width="1" >
<input type="checkbox" class="all-record-selector"/> </th>
<t t-foreach="columns" t-as="column">
<th t-if="!column.meta and column.invisible !== '1'" t-att-data-id="column.id"
t-att-class="((options.sortable and column.tag !== 'button') ? 'oe-sortable' : null)">
@@ -632,9 +633,18 @@
</td>
</t>
<th t-if="options.selectable" class="oe-record-selector" width="1">
<input type="checkbox"/>
</th>
<t t-if="options.radio">
<th t-if="options.selectable" class="oe-record-selector" width="1">
<input type="radio" name ="radiogroup"/>
</th>
</t>
<t t-if="!options.radio">
<th t-if="options.selectable" class="oe-record-selector" width="1">
<input type="checkbox"/>
</th>
</t>
<t t-foreach="columns" t-as="column">
<t t-set="align" t-value="column.type === 'integer' or column.type == 'float'"/>
<td t-if="!column.meta and column.invisible !== '1'" t-att-title="column.help"
@@ -652,7 +662,7 @@
</t>
<t t-name="FormView">
<div class="oe_form_header">
<div class="oe_form_buttons" t-if="view.options.action_buttons !== false">
<div class="oe_form_buttons" t-if="widget.options.action_buttons !== false">
<button type="button" class="oe_form_button_save">
<span class="oe_form_on_update">Save</span>
<span class="oe_form_on_create">Create</span>
@@ -661,7 +671,7 @@
<button type="button" class="oe_form_button_duplicate oe_form_on_update">Duplicate</button>
<button type="button" class="oe_form_button_toggle">Readonly/Editable</button>
</div>
<div class="oe_form_pager" t-if="view.options.pager !== false">
<div class="oe_form_pager" t-if="widget.options.pager !== false">
<button type="button" data-pager-action="first">First</button>
<button type="button" data-pager-action="previous">&lt;&lt;</button>
@@ -751,7 +761,7 @@
</t>
<t t-name="WidgetLabel">
<label t-att-for="widget.element_id"
t-att-class="'oe_label' + (widget.help ? '_help' : '')"
t-attf-class="oe_label#{widget.help ? '_help' : ''} oe_align_#{widget.align}"
t-att-title="widget.help">
<t t-esc="widget.string"/>
<span t-if="widget.help">?</span>
@@ -759,10 +769,10 @@
</label>
</t>
<t t-name="WidgetParagraph">
<p class="oe_form_paragraph"><t t-esc="widget.string"/></p>
<p t-attf-class="oe_form_paragraph oe_align_#{widget.align}"><t t-esc="widget.string"/></p>
</t>
<t t-name="FieldChar">
<input type="text" size="1"
<input t-att-type="widget.password ? 'password' : 'text'" size="1"
t-att-name="widget.name"
t-att-id="widget.element_id"
t-attf-class="field_#{widget.type}"
@@ -1269,6 +1279,55 @@
.unwrap();
</t>
</t>
<t t-name="view_editor">
<table class="oe_view_editor">
<t t-call="view_editor.row"/>
</table>
</t>
<tr t-name="view_editor.row" class="oe_view_editor_row" t-att-id="'viewedit-' + rec.id" t-att-level="rec.level" t-foreach="data" t-as="rec">
<td class="oe_view_editor_colum" width="85%">
<table class="oe_view_editor_tree_grid">
<tr>
<td width="16px" t-att-style="'background-position: ' + 20*rec.level + 'px; padding-left: ' + 20*rec.level + 'px'">
<img t-if="rec.child_id.length" t-att-id="'parentimg-' + rec.id"
src="/web/static/src/img/collapse.gif" width="16" height="16" border="0"/>
</td>
<td style="cursor: pointer;">
<a style="text-decoration:none" href="javascript:void(0);"> <t t-esc="rec.name"/> </a>
</td>
</tr>
</table>
</td>
<td align="left" class="oe_view_editor_colum" width="15%">
<table width="100%">
<tr>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-add" src="/web/static/src/img/icons/gtk-add.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img id="side-remove" src="/web/static/src/img/icons/gtk-remove.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-edit" src="/web/static/src/img/icons/gtk-edit.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-up" src="/web/static/src/img/icons/gtk-go-up.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-down" src="/web/static/src/img/icons/gtk-go-down.png" style="cursor: pointer;"/>
</td>
</tr>
</table>
</td>
<t t-if="rec.child_id.length">
<t t-set="data" t-value="rec.child_id"/>
<t t-call="view_editor.row"/>
</t>
</tr>
<t t-name="ExportView">
<a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a>
+2
View File
@@ -39,6 +39,8 @@ $(document).ready(function () {
'1.000000');
equal(openerp.web.format_value(1, {type: 'float'}),
'1.00');
equal(openerp.web.format_value(-11.25, {type: 'float'}),
"-11.25");
});
test("parse_datetime", function () {
var val = openerp.web.str_to_datetime("2009-05-04 12:34:23");
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
@@ -468,7 +468,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({
[['name', '=', module_name], ['state', '=', 'uninstalled']]);
var Upgrade = new openerp.web.DataSet(this, 'base.module.upgrade');
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
Modules.read_slice(['id'], {}, function (records) {
if (!(records.length === 1)) { $.unblockUI(); return; }
Modules.call('state_update',
+38
View File
@@ -0,0 +1,38 @@
# Danish translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-11 14:02+0000\n"
"Last-Translator: Jonas Mortensen <Unknown>\n"
"Language-Team: Danish <da@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: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Velkommen til din nye OpenERP instans."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Husk at tilføje denne side til dine favoritter."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Husk dit log ind:"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Vælg den første OpenERP Applikation som du ønsker at installere."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installér"
+38
View File
@@ -0,0 +1,38 @@
# German translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-10 12:40+0000\n"
"Last-Translator: Felix Schubert <Unknown>\n"
"Language-Team: German <de@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: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Willkommen zu Ihrer neuen OpenERP Instanz."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Denken Sie daran ein Lesezeichen für diese Seite zu setzen."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Anmeldung speichern"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Wählen Sie die erste OpenERP Anwendung die Sie installieren möchten."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installieren"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+38
View File
@@ -0,0 +1,38 @@
# Spanish (Ecuador) translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-07 16:00+0000\n"
"Last-Translator: Cristian Salamea (Gnuthink) <ovnicraft@gmail.com>\n"
"Language-Team: Spanish (Ecuador) <es_EC@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: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Bienvenido a tu nueva instancia de OpenERP"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Recuerda marcar esta página"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Recordar tu inicio de sesión"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Escoge la primea Aplicación OpenERP que deseas instalar..."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Instalar"
+38
View File
@@ -0,0 +1,38 @@
# Estonian translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-10 19:29+0000\n"
"Last-Translator: Aare Vesi <Unknown>\n"
"Language-Team: Estonian <et@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: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Paigalda"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+38
View File
@@ -0,0 +1,38 @@
# Italian translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-08 13:41+0000\n"
"Last-Translator: Nicola Riolini - Micronaet <Unknown>\n"
"Language-Team: Italian <it@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: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Benvenuto nella nuova istanza di OpenERP"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Ricordarsi di aggiungere ai preferiti questa pagina"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Ricordare il proprio login:"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Scegliere la prima applicazione OpenERP che volete installare..."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installa"
+38
View File
@@ -0,0 +1,38 @@
# Dutch (Belgium) translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-07 09:07+0000\n"
"Last-Translator: Niels Huylebroeck <Unknown>\n"
"Language-Team: Dutch (Belgium) <nl_BE@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: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Welkom bij uw nieuwe OpenERP."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Gelieve een bookmark voor deze pagina te maken."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Vergeet je login niet:"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Kies welke OpenERP Applicatie je wilt installeren..."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installeer"
+38
View File
@@ -0,0 +1,38 @@
# Slovak translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-01 13:27+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Slovak <sk@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: 2011-11-02 05:05+0000\n"
"X-Generator: Launchpad (build 14214)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+1 -9
View File
@@ -93,7 +93,6 @@ class DiagramView(View):
n.update(
id=act['id'],
color='white',
shape='ellipse',
options={}
)
for color, expr in bgcolors.items():
@@ -107,12 +106,5 @@ class DiagramView(View):
for i, fld in enumerate(visible_node_fields):
n['options'][node_fields_string[i]] = act[fld]
#to relate m2o field of transition to corresponding o2m in activity
in_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', des_node), ('model', '=', node)], 0, 0, 0, req.session.context)
in_transition_field = fields.read(in_transition_field_id[0], ['name'], req.session.context)['name']
out_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', src_node), ('model', '=', node)], 0, 0, 0, req.session.context)
out_transition_field = fields.read(out_transition_field_id[0], ['name'], req.session.context)['name']
id_model = req.session.model(model).read([id],['name'], req.session.context)[0]['name']
return dict(nodes=nodes, conn=connectors, id_model = id_model)
return dict(nodes=nodes, conn=connectors, id_model=id_model)
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
@@ -71,7 +71,7 @@ Raphael.fn.connection = function (obj1, obj2, style) {
x3 = [0, 0, 0, 0, x4, x4, x4 - dx, x4 + dx][res[1]].toFixed(3),
y3 = [0, 0, 0, 0, y1 + dy, y1 - dy, y4, y4][res[1]].toFixed(3);
/* assemble path and arrow */
var path = ["M", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)].join(",");
var path = ["M", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)];
/* arrow */
if(style && style.directed) {
/* magnitude, length of the last path vector */
@@ -83,15 +83,16 @@ Raphael.fn.connection = function (obj1, obj2, style) {
{x:(norm(x4-x3)+norm(y4-y3)+x4).toFixed(3), y:(norm(y4-y3)+norm(x4-x3)+y4).toFixed(3)},
{x:(norm(x4-x3)-norm(y4-y3)+x4).toFixed(3), y:(norm(y4-y3)-norm(x4-x3)+y4).toFixed(3)}
];
path = path + ",M"+arr[0].x+","+arr[0].y+",L"+x4+","+y4+",L"+arr[1].x+","+arr[1].y;
path.push("M", arr[0].x, arr[0].y, "L", x4, y4, "L", arr[1].x, arr[1].y, "L", arr[0].x, arr[0].y);
}
var svgpath = path.join(' ');
/* function to be used for moving existent path(s), e.g. animate() or attr() */
var move = "attr";
/* applying path(s) */
edge.fg && edge.fg[move]({path:path})
|| (edge.fg = selfRef.path(path).attr({stroke: style && style.stroke || "#000", fill: "none"}).toBack());
edge.bg && edge.bg[move]({path:path})
|| style && style.fill && (edge.bg = style.fill.split && selfRef.path(path).attr({stroke: style.fill.split("|")[0], fill: "none", "stroke-width": style.fill.split("|")[1] || 3}).toBack());
edge.fg && edge.fg[move]({path:svgpath})
|| (edge.fg = selfRef.path(svgpath).attr({stroke: style && style.stroke || "#000", fill: "none"}).toBack());
edge.bg && edge.bg[move]({path:svgpath})
|| style && style.fill && (edge.bg = style.fill.split && selfRef.path(svgpath).attr({stroke: style.fill.split("|")[0], fill: "none", "stroke-width": style.fill.split("|")[1] || 3}).toBack());
/* setting label */
style && style.label
&& (edge.label && edge.label.attr({x:(x1+x4)/2, y:(y1+y4)/2})
@@ -160,13 +160,11 @@ Graph.Renderer.Raphael = function(element, graph, width, height) {
*/
this.isDrag = false;
this.dragger = function (e) {
if(e.detail < 2) {
this.dx = e.clientX;
this.dy = e.clientY;
selfRef.isDrag = this;
this.set && this.set.animate({"fill-opacity": .1}, 200) && this.set.toFront();
e.preventDefault && e.preventDefault();
}
this.dx = e.clientX;
this.dy = e.clientY;
selfRef.isDrag = this;
this.set && this.set.animate({"fill-opacity": .1}, 200);
e.preventDefault && e.preventDefault();
};
var d = document.getElementById(element);
@@ -378,6 +376,8 @@ Graph.Layout.Spring.prototype = {
},
layoutRepulsive: function(node1, node2) {
if (typeof node1 == 'undefined' || typeof node2 == 'undefined')
return;
var dx = node2.layoutPosX - node1.layoutPosX;
var dy = node2.layoutPosY - node1.layoutPosY;
var d2 = dx * dx + dy * dy;
File diff suppressed because one or more lines are too long
@@ -1,13 +1,3 @@
.openerp .diagram {
border: 1px solid #999;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
}
.openerp .show_grid {
background: url("/web_diagram/static/src/img/grid.jpg") repeat;
}
.openerp .oe_diagram_pager {
text-align: right;
white-space: nowrap;
+53 -35
View File
@@ -54,11 +54,6 @@ openerp.web.DiagramView = openerp.web.View.extend({
// New Node,Edge
this.$element.find('#new_node.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.node);});
this.$element.find('#new_edge.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.connector);});
this.$element.find('#toggle_grid').click(function() {
self.$element.find('.diagram').toggleClass('show_grid');
});
if(this.id) {
self.get_diagram_info();
@@ -113,8 +108,25 @@ openerp.web.DiagramView = openerp.web.View.extend({
this.get_diagram_info();
}
},
select_node: function (node, element) {
if (!this.selected_node) {
this.selected_node = node;
element.attr('stroke', 'red');
return;
}
// Re-click selected node, deselect it
if (node.id === this.selected_node.id) {
this.selected_node = null;
element.attr('stroke', 'black');
return;
}
this.add_edit_node(null, this.connector, {
act_from: this.selected_node.id,
act_to: node.id
});
},
draw_diagram: function(result) {
this.selected_node = null;
var diagram = new Graph();
this.active_model = result['id_model'];
@@ -125,34 +137,33 @@ openerp.web.DiagramView = openerp.web.View.extend({
//Custom logic
var self = this;
var renderer = function(r, n) {
var node;
var set;
var shape = n.node.shape;
if(shape == 'rectangle')
shape = 'rect';
node = r[shape](n.node.x, n.node.y).attr({
"fill": n.node.color
}).dblclick(function() {
self.add_edit_node(n.node.id, self.node);
});
set = r.set()
.push(node)
.push(
r.text(n.node.x, n.node.y, (n.label || n.id))
.attr({"cursor":"pointer"})
.dblclick(function() {
self.add_edit_node(n.node.id, self.node);
})
);
node.attr({cursor: "pointer"});
var shape = (n.node.shape === 'rectangle') ? 'rect' : 'ellipse';
if(shape == "ellipse")
node.attr({rx: "40", ry: "20"});
else if(shape == 'rect') {
var node = r[shape](n.node.x, n.node.y).attr({
"fill": n.node.color
});
var nodes = r.set(node, r.text(n.node.x, n.node.y, (n.label || n.id)))
.attr("cursor", "pointer")
.dblclick(function() {
self.add_edit_node(n.node.id, self.node);
})
.mousedown(function () { node.moved = false; })
.mousemove(function () { node.moved = true; })
.click(function () {
// Ignore click from move event
if (node.moved) { return; }
self.select_node(n.node, node);
});
if (shape === 'rect') {
node.attr({width: "60", height: "44"});
node.next.attr({"text-anchor": "middle", x: n.node.x + 20, y: n.node.y + 20});
} else {
node.attr({rx: "40", ry: "20"});
}
return set;
return nodes;
};
_.each(res_nodes, function(res_node) {
@@ -167,10 +178,7 @@ openerp.web.DiagramView = openerp.web.View.extend({
diagram.addEdge(connector['source'], connector['destination'], {directed : true, label: connector['signal']});
});
if ($('div#dia-canvas').children().length > 0) {
$('div#dia-canvas').children().remove();
}
self.$element.find('.diagram').empty();
var layouter = new Graph.Layout.Ordered(diagram);
var render_diagram = new Graph.Renderer.Raphael('dia-canvas', diagram, $('div#dia-canvas').width(), $('div#dia-canvas').height());
@@ -184,7 +192,8 @@ openerp.web.DiagramView = openerp.web.View.extend({
});
},
add_edit_node: function(id, model) {
add_edit_node: function(id, model, defaults) {
defaults = defaults || {};
var self = this;
if(!model)
@@ -253,6 +262,15 @@ openerp.web.DiagramView = openerp.web.View.extend({
});
});
}
if (!_.isEmpty(defaults)) {
form_controller.on_record_loaded.add_last(function () {
_(form_fields).each(function (field) {
if (!defaults[field]) { return; }
form_controller.fields[field].set_value(defaults[field]);
form_controller.fields[field].dirty = true;
});
});
}
},
on_pager_action: function(action) {
@@ -3,8 +3,6 @@
<div class="oe_diagram_header" t-att-id="element_id + '_header'">
<div class="oe_diagram_buttons">
<button type="button" id="new_node" class="oe_diagram_button_new">New Node</button>
<button type="button" id="new_edge" class="oe_diagram_button_new">New Edge</button>
<label>Show Grid:</label><input type="checkbox" id="toggle_grid" checked="checked"/>
</div>
<div class="oe_diagram_pager">
<button type="button" data-pager-action="first">First</button>
@@ -16,6 +14,6 @@
<button type="button" data-pager-action="last">Last</button>
</div>
</div>
<div id="dia-canvas" class="diagram show_grid" style="overflow: auto;"></div>
<div id="dia-canvas" class="diagram" style="overflow: auto;"></div>
</t>
</template>
+40 -46
View File
@@ -43,7 +43,7 @@ init: function(parent, dataset, view_id) {
this.name = this.fields_view.arch.attrs.string;
this.view_id = this.fields_view.view_id;
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;
@@ -71,7 +71,7 @@ init: function(parent, dataset, view_id) {
ganttChartControl.setImagePath("/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/");
ganttChartControl.setEditable(true);
ganttChartControl.showTreePanel(true);
ganttChartControl.showContextMenu(true);
ganttChartControl.showContextMenu(false);
ganttChartControl.showDescTask(true,'d,s-f');
ganttChartControl.showDescProject(true,'n,d');
@@ -228,7 +228,7 @@ init: function(parent, dataset, view_id) {
var evt_date = "";
var evt_duration = "";
var evt_end_date = "";
var project_tree_field = [];
for (var i in final_events){
evt_id = final_events[i];
evt_date = all_events[evt_id]['evt'][2];
@@ -254,7 +254,7 @@ init: function(parent, dataset, view_id) {
self.render_events(all_events, 0);
}
for (var i in final_events){
for (var i in final_events) {
evt_id = final_events[i];
res = all_events[evt_id];
task=new GanttTaskInfo(res['evt'][0], res['evt'][1], res['evt'][2], res['evt'][3], res['evt'][4], "",res['evt'][6]);
@@ -278,8 +278,9 @@ init: function(parent, dataset, view_id) {
ganttChartControl.attachEvent("onTaskStartDrag", function(task) {self.on_drag_start(task);});
ganttChartControl.attachEvent("onTaskEndResize", function(task) {self.on_resize_drag_end(task, "resize");});
ganttChartControl.attachEvent("onTaskEndDrag", function(task) {self.on_resize_drag_end(task, "drag");});
ganttChartControl.attachEvent("onTaskDblClick", function(task) {self.open_popup(task);});
var taskdiv = jQuery("div.taskPanel").parent();
taskdiv.addClass('ganttTaskPanel');
taskdiv.prev().addClass('ganttDayPanel');
@@ -293,7 +294,7 @@ init: function(parent, dataset, view_id) {
self.set_width();
});
jQuery(window).bind('resize',function(){
jQuery(window).bind('resize',function() {
window.clearTimeout(ganttChartControl._resize_timer);
ganttChartControl._resize_timer = window.setTimeout(function(){
self.reload_gantt();
@@ -385,53 +386,46 @@ init: function(parent, dataset, view_id) {
},
open_popup : function(task) {
var self = this;
var event_id = task.getId();
if(event_id.toString().search("_") != -1)
return;
if(event_id) event_id = parseInt(event_id, 10);
var action_manager = new openerp.web.ActionManager(this);
var dialog = new openerp.web.Dialog(this, {
width: 800,
height: 600,
buttons : {
Cancel : function() {
$(this).dialog('destroy');
},
Save : function() {
var form_view = action_manager.inner_viewmanager.views.form.controller;
var action = {
"res_model": this.dataset.model,
"res_id": event_id,
"views":[[false,"form"]],
"type":"ir.actions.act_window",
"view_type":"form",
"view_mode":"form"
};
action.flags = {
search_view: false,
sidebar : false,
views_switcher : false,
pager: false
};
var element_id = _.uniqueId("act_window_dialog");
var dialog = jQuery('<div>', {
'id': element_id
}).dialog({
modal: true,
width: 'auto',
height: 'auto',
buttons: {
Cancel: function() {
$(this).dialog("destroy");
},
Save: function() {
var view_manager = action_manager.viewmanager;
var _dialog = this;
view_manager.views[view_manager.active_view].controller.do_save(function(r) {
$(_dialog).dialog("destroy");
self.reload_gantt();
})
}
form_view.do_save(function() {
self.get_events();
});
$(this).dialog('destroy');
}
}
}).start().open();
action_manager.appendTo(dialog.$element);
action_manager.do_action({
res_model : this.dataset.model,
res_id: event_id,
views : [[false, 'form']],
type : 'ir.actions.act_window',
auto_search : false,
flags : {
search_view: false,
sidebar : false,
views_switcher : false,
action_buttons : false,
pager: false
}
});
var action_manager = new openerp.web.ActionManager(this, element_id);
action_manager.start();
action_manager.do_action(action);
//Default_get
if(!event_id) action_manager.viewmanager.dataset.index = null;
},
on_drag_start : function(task){
+105 -74
View File
@@ -29,6 +29,14 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
this.columns = [];
this.group_field = null;
this.is_loaded = $.Deferred();
this.renderer = null;
},
stop: function () {
if (this.renderer) {
clearTimeout(this.renderer);
}
this._super();
},
do_show: function () {
this.$element.show();
@@ -256,90 +264,113 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
x_axis = abscissa_description;
y_axis = ordinate_description;
}
var bar_chart = new dhtmlXChart({
view: view_chart,
container: this.element_id+"-barchart",
value:"#"+group_list[0].group+"#",
gradient: "3d",
border: false,
width: 1024,
tooltip:{
template: _.sprintf("#%s#, %s=#%s#",
this.abscissa, group_list[0].text, group_list[0].group)
},
radius: 0,
color:group_list[0].color,
origin:0,
xAxis: x_axis,
yAxis: y_axis,
padding: {
left: 75
},
legend: {
values: group_list,
align:"left",
valign:"top",
layout: "x",
marker: {
type:"round",
width:12
}
var renderer = function () {
if (self.$element.is(':hidden')) {
self.renderer = setTimeout(renderer, 100);
return;
}
});
for (var m = 1; m<group_list.length;m++){
var column = group_list[m];
if (column.group === this.group_field) { continue; }
bar_chart.addSeries({
value: "#"+column.group+"#",
self.renderer = null;
var bar_chart = new dhtmlXChart({
view: view_chart,
container: self.element_id+"-barchart",
value:"#"+group_list[0].group+"#",
gradient: "3d",
border: false,
width: 1024,
tooltip:{
template: _.sprintf("#%s#, %s=#%s#",
this.abscissa, column.text, column.group)
self.abscissa, group_list[0].text, group_list[0].group)
},
color: column.color
radius: 0,
color:group_list[0].color,
origin:0,
xAxis: x_axis,
yAxis: y_axis,
padding: {
left: 75
},
legend: {
values: group_list,
align:"left",
valign:"top",
layout: "x",
marker: {
type:"round",
width:12
}
}
});
for (var m = 1; m<group_list.length;m++){
var column = group_list[m];
if (column.group === self.group_field) { continue; }
bar_chart.addSeries({
value: "#"+column.group+"#",
tooltip:{
template: _.sprintf("#%s#, %s=#%s#",
self.abscissa, column.text, column.group)
},
color: column.color
});
}
bar_chart.parse(results, "json");
self.$element.find("#"+self.element_id+"-barchart").height(
self.$element.find("#"+self.element_id+"-barchart").height()+50);
bar_chart.attachEvent("onItemClick", function(id) {
self.open_list_view(bar_chart.get(id));
});
};
if (this.renderer) {
clearTimeout(this.renderer);
}
bar_chart.parse(results, "json");
jQuery("#"+this.element_id+"-barchart").height(jQuery("#"+this.element_id+"-barchart").height()+50);
bar_chart.attachEvent("onItemClick", function(id) {
self.open_list_view(bar_chart.get(id));
});
this.renderer = setTimeout(renderer, 0);
},
schedule_pie: function(result) {
var self = this;
var chart = new dhtmlXChart({
view:"pie3D",
container:self.element_id+"-piechart",
value:"#"+self.ordinate+"#",
pieInnerText:function(obj) {
var sum = chart.sum("#"+self.ordinate+"#");
var val = obj[self.ordinate] / sum * 100 ;
return val.toFixed(1) + "%";
},
tooltip:{
template:"#"+self.abscissa+"#"+"="+"#"+self.ordinate+"#"
},
gradient:"3d",
height: 20,
radius: 200,
legend: {
width: 300,
align:"left",
valign:"top",
layout: "x",
marker:{
type:"round",
width:12
},
template:function(obj){
return obj[self.abscissa] || 'Undefined';
}
var renderer = function () {
if (self.$element.is(':hidden')) {
self.renderer = setTimeout(renderer, 100);
return;
}
});
chart.parse(result,"json");
chart.attachEvent("onItemClick", function(id) {
self.open_list_view(chart.get(id));
});
self.renderer = null;
var chart = new dhtmlXChart({
view:"pie3D",
container:self.element_id+"-piechart",
value:"#"+self.ordinate+"#",
pieInnerText:function(obj) {
var sum = chart.sum("#"+self.ordinate+"#");
var val = obj[self.ordinate] / sum * 100 ;
return val.toFixed(1) + "%";
},
tooltip:{
template:"#"+self.abscissa+"#"+"="+"#"+self.ordinate+"#"
},
gradient:"3d",
height: 20,
radius: 200,
legend: {
width: 300,
align:"left",
valign:"top",
layout: "x",
marker:{
type:"round",
width:12
},
template:function(obj){
return obj[self.abscissa] || 'Undefined';
}
}
});
chart.parse(result,"json");
chart.attachEvent("onItemClick", function(id) {
self.open_list_view(chart.get(id));
});
};
if (this.renderer) {
clearTimeout(this.renderer);
}
this.renderer = setTimeout(renderer, 0);
},
open_list_view : function (id){
var self = this;
+54 -30
View File
@@ -14,6 +14,7 @@
height:20px;
align:center;
font-size:24px;
white-space: nowrap;
}
.openerp .oe_kanban_view .ui-sortable-placeholder {
@@ -24,7 +25,7 @@
.openerp .oe_kanban_view .oe_column_heading {
color: #000000;
font-size: 1.5em;
font-size: 130%;
font-weight: bold;
}
.openerp .oe_kanban_view .fold-columns-icon {
@@ -50,17 +51,17 @@
border-bottom: 1px solid #CCC;
}
.openerp .oe_kanban_title1 {
font-size: 130%;
font-weight: bold;
padding: 0 4px 0 4px;
}
.openerp .oe_kanban_title2 {
font-size: 120%;
font-weight: bold;
padding: 0 4px 0 4px;
}
.openerp .oe_kanban_title3 {
.openerp .oe_kanban_title2 {
font-size: 110%;
font-weight: bold;
padding: 0 4px 0 4px;
}
.openerp .oe_kanban_title3 {
font-size: 100%;
font-weight: normal;
padding: 0 4px 0 4px;
}
@@ -87,6 +88,7 @@
white-space: nowrap;
padding-top: 2px;
position: relative;
clear: both;
}
.openerp .oe_kanban_buttons_set a {
padding: 2px;
@@ -132,91 +134,113 @@
}
/* Custom colors are also present in kanban.js */
/* Custom color#0 */
.openerp .oe_kanban_color_0 .oe_kanban_color_bglight {
background: #FFFFFF;
}
.openerp .oe_kanban_color_0 .oe_kanban_color_bgdark {
background: #EEEEEE;
}
.openerp .oe_kanban_color_0 .oe_kanban_color_border {
border-color: #CCCCCC;
}
/* Custom color#1 */
.openerp .oe_kanban_color_1 .oe_kanban_color_bglight {
background: #FFC7C7;
background: #CCCCCC;
}
.openerp .oe_kanban_color_1 .oe_kanban_color_bgdark {
background: #FF8F8F;
background: #999999;
}
.openerp .oe_kanban_color_1 .oe_kanban_color_border {
border-color: #D97979;
border-color: #666666;
}
/* Custom color#2 */
.openerp .oe_kanban_color_2 .oe_kanban_color_bglight {
background: #FFF1C7;
background: #FFC7C7;
}
.openerp .oe_kanban_color_2 .oe_kanban_color_bgdark {
background: #FFE38F;
background: #FF8F8F;
}
.openerp .oe_kanban_color_2 .oe_kanban_color_border {
border-color: #D9C179;
border-color: #D97979;
}
/* Custom color#3 */
.openerp .oe_kanban_color_3 .oe_kanban_color_bglight {
background: #E3FFC7;
background: #FFF1C7;
}
.openerp .oe_kanban_color_3 .oe_kanban_color_bgdark {
background: #C7FF8F;
background: #FFE38F;
}
.openerp .oe_kanban_color_3 .oe_kanban_color_border {
border-color: #A9D979;
border-color: #D9C179;
}
/* Custom color#4 */
.openerp .oe_kanban_color_4 .oe_kanban_color_bglight {
background: #C7FFD5;
background: #E3FFC7;
}
.openerp .oe_kanban_color_4 .oe_kanban_color_bgdark {
background: #8FFFAB;
background: #C7FF8F;
}
.openerp .oe_kanban_color_4 .oe_kanban_color_border {
border-color: #79D991;
border-color: #A9D979;
}
/* Custom color#5 */
.openerp .oe_kanban_color_5 .oe_kanban_color_bglight {
background: #C7FFFF;
background: #C7FFD5;
}
.openerp .oe_kanban_color_5 .oe_kanban_color_bgdark {
background: #8FFFFF;
background: #8FFFAB;
}
.openerp .oe_kanban_color_5 .oe_kanban_color_border {
border-color: #79D9D9;
border-color: #79D991;
}
/* Custom color#6 */
.openerp .oe_kanban_color_6 .oe_kanban_color_bglight {
background: #C7D5FF;
background: #C7FFFF;
}
.openerp .oe_kanban_color_6 .oe_kanban_color_bgdark {
background: #8FABFF;
background: #8FFFFF;
}
.openerp .oe_kanban_color_6 .oe_kanban_color_border {
border-color: #8FABFF;
border-color: #79D9D9;
}
/* Custom color#7 */
.openerp .oe_kanban_color_7 .oe_kanban_color_bglight {
background: #E3C7FF;
background: #C7D5FF;
}
.openerp .oe_kanban_color_7 .oe_kanban_color_bgdark {
background: #C78FFF;
background: #8FABFF;
}
.openerp .oe_kanban_color_7 .oe_kanban_color_border {
border-color: #A979D9;
border-color: #8FABFF;
}
/* Custom color#8 */
.openerp .oe_kanban_color_8 .oe_kanban_color_bglight {
background: #FFC7F1;
background: #E3C7FF;
}
.openerp .oe_kanban_color_8 .oe_kanban_color_bgdark {
background: #FF8FE3;
background: #C78FFF;
}
.openerp .oe_kanban_color_8 .oe_kanban_color_border {
border-color: #A979D9;
}
/* Custom color#9 */
.openerp .oe_kanban_color_9 .oe_kanban_color_bglight {
background: #FFC7F1;
}
.openerp .oe_kanban_color_9 .oe_kanban_color_bgdark {
background: #FF8FE3;
}
.openerp .oe_kanban_color_9 .oe_kanban_color_border {
border-color: #D979C1;
}
+43 -22
View File
@@ -50,8 +50,18 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
}
}
},
get_qweb_context: function(record) {
return {
record: this.do_transform_record(record),
kanban_color: _.bind(this.kanban_color, this),
kanban_gravatar: _.bind(this.kanban_gravatar, this),
kanban_image: _.bind(this.kanban_image, this),
kanban_text_ellipsis: _.bind(this.kanban_text_ellipsis, this),
'_' : _
}
},
kanban_color: function(variable) {
var number_of_color_schemes = 8,
var number_of_color_schemes = 10,
index = 0;
switch (typeof(variable)) {
case 'string':
@@ -65,13 +75,25 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
default:
return '';
}
return 'oe_kanban_color_' + ((index % number_of_color_schemes) || number_of_color_schemes);
var color = (index % number_of_color_schemes);
return 'oe_kanban_color_' + color;
},
kanban_gravatar: function(email, size) {
size = size || 22;
var email_md5 = '2eb60ad22dadcf4dc456b28390a80268';
var email_md5 = $.md5(email);
return 'http://www.gravatar.com/avatar/' + email_md5 + '.png?s=' + size;
},
kanban_image: function(model, field, id) {
id = id || '';
return '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + id;
},
kanban_text_ellipsis: function(s, size) {
size = size || 160;
if (!s) {
return '';
}
return s.substr(0, size) + '...';
},
transform_qweb_template: function(node) {
var qweb_prefix = QWeb.prefix;
switch (node.tag) {
@@ -91,7 +113,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
});
if (node.attrs['data-states']) {
var states = _.map(node.attrs['data-states'].split(','), function(state) {
return "record.state.value == '" + _.trim(state) + "'";
return "record.state.raw_value == '" + _.trim(state) + "'";
});
node.attrs['t-if'] = states.join(' or ');
}
@@ -148,7 +170,6 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
stop: self.on_receive_record,
scroll: false
});
this.$element.find(".oe_column").disableSelection()
this.$element.find('button.oe_kanban_button_new').click(this.do_add_record);
this.$element.find(".fold-columns-icon").click(function(event) {
self.do_fold_unfold_columns(event, this.id);
@@ -202,7 +223,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
do_change_color: function(record_id, $e) {
var self = this,
id = record_id,
colors = '#FFC7C7,#FFF1C7,#E3FFC7,#C7FFD5,#C7FFFF,#C7D5FF,#E3C7FF,#FFC7F1'.split(','),
colors = '#FFFFFF,#CCCCCC,#FFC7C7,#FFF1C7,#E3FFC7,#C7FFD5,#C7FFFF,#C7D5FF,#E3C7FF,#FFC7F1'.split(','),
$cpicker = $(QWeb.render('KanbanColorPicker', { colors : colors, columns: 2 }));
$e.after($cpicker);
$cpicker.mouseenter(function() {
@@ -234,11 +255,9 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
if (self.all_display_data[i].records[j].id == record_id) {
_.extend(self.all_display_data[i].records[j], records[0]);
self.$element.find("#main_" + record_id).children().remove();
self.$element.find("#main_" + record_id).append(self.qweb.render('kanban-box', {
record: self.do_transform_record(self.all_display_data[i].records[j]),
kanban_color: self.kanban_color,
kanban_gravatar: self.kanban_gravatar
}));
self.$element.find("#main_" + record_id).append(
self.qweb.render('kanban-box', self.get_qweb_context(self.all_display_data[i].records[j]))
);
break;
}
}
@@ -363,17 +382,15 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
}
this.source_index = {};
},
on_reload_kanban: function (){
on_reload_kanban: function() {
var self = this;
_.each(self.all_display_data, function(data, index) {
if (data.records.length > 0){
_.each(data.records, function(record) {
self.$element.find("#main_" + record.id).children().remove();
self.$element.find("#main_" + record.id).append(self.qweb.render('kanban-box', {
record: self.do_transform_record(record),
kanban_color: self.kanban_color,
kanban_gravatar: self.kanban_gravatar
}));
self.$element.find("#main_" + record.id).append(
self.qweb.render('kanban-box', self.get_qweb_context(record))
);
});
}
});
@@ -422,6 +439,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
self.datagroup.list(
_.keys(self.fields_view.fields),
function (groups) {
self.dataset.ids = [];
self.groups = groups;
if (groups.length) {
self.do_render_group(groups);
@@ -446,8 +464,9 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
},
do_render_group : function (datagroups) {
this.all_display_data = [];
var self = this;
_.each(datagroups, function (group) {
var self = this,
remaining = datagroups.length - 1;
_.each(datagroups, function (group, index) {
var group_name = group.value;
var group_value = group.value;
if (!group.value) {
@@ -462,10 +481,12 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
group_aggregates[value] = group.aggregates[key];
});
var dataset = new openerp.web.DataSetSearch(self, self.dataset.model, group.context, group.domain);
self.$element.find(".oe_kanban_view").remove();
dataset.read_slice(_.keys(self.fields_view.fields), {'domain': group.domain, 'context': group.context}, function(records) {
self.all_display_data.push({"value" : group_value, "records": records, 'header':group_name, 'ids': dataset.ids, 'aggregates': group_aggregates});
if (datagroups.length == self.all_display_data.length) {
self.$element.find(".oe_kanban_view").remove();
self.dataset.ids.push.apply(self.dataset.ids, dataset.ids);
self.all_display_data[index] = {"value" : group_value, "records" : records, 'header' : group_name, 'ids' : dataset.ids, 'aggregates' : group_aggregates};
if (!remaining--) {
self.dataset.index = self.dataset.ids.length ? 0 : null;
self.on_show_data();
}
});
@@ -34,7 +34,7 @@
<tr>
<t t-foreach="colors" t-as="color">
<td t-att-bgcolor="color">
<a href="#" t-att-data-color="color_index + 1"/>
<a href="#" t-att-data-color="color_index"/>
</td>
<t t-if="((color_index + 1) % Math.round(colors.length / columns)) == 0">&lt;/tr&gt;&lt;tr&gt;</t>
</t>
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "OpenERP"
+32 -17
View File
@@ -1,34 +1,29 @@
#!/usr/bin/env python
import json
import logging
import logging.config
import optparse
import os
import sys
import json
import tempfile
import logging
import logging.config
import werkzeug.serving
import werkzeug.contrib.fixers
path_root = os.path.dirname(os.path.abspath(__file__))
path_addons = os.path.join(path_root, 'addons')
if path_addons not in sys.path:
sys.path.insert(0, path_addons)
optparser = optparse.OptionParser()
optparser.add_option("-s", "--session-path", dest="session_storage",
default=os.path.join(tempfile.gettempdir(), "oe-sessions"),
help="directory used for session storage", metavar="DIR")
help="Directory used for session storage", metavar="DIR")
optparser.add_option("--server-host", dest="server_host",
default='127.0.0.1', help="OpenERP server hostname", metavar="HOST")
optparser.add_option("--server-port", dest="server_port", default=8069,
help="OpenERP server port", type="int", metavar="NUMBER")
optparser.add_option("--db-filter", dest="dbfilter", default='.*',
help="Filter listed database", metavar="REGEXP")
optparser.add_option('--addons-path', dest='addons_path', default=[path_addons], action='append',
help="Path do addons directory", metavar="PATH")
help="Filter listed databases", metavar="REGEXP")
optparser.add_option('--addons-path', dest='addons_path', default=[], action='append',
help="Path to addons directory", metavar="PATH")
optparser.add_option('--load', dest='server_wide_modules', default=['web'], action='append',
help="Load a additional module before login (by default only 'web' is loaded)", metavar="MODULE")
help="Load an additional module before login (by default only 'web' is loaded)", metavar="MODULE")
server_options = optparse.OptionGroup(optparser, "Server configuration")
server_options.add_option("-p", "--port", dest="socket_port", default=8002,
@@ -55,19 +50,39 @@ logging_opts.add_option("--log-config", dest="log_config", default=os.path.join(
help="Logging configuration file", metavar="FILE")
optparser.add_option_group(logging_opts)
import web.common.http
if __name__ == "__main__":
(options, args) = optparser.parse_args(sys.argv[1:])
options.backend = 'xmlrpc'
if not options.addons_path:
path_root = os.path.dirname(os.path.abspath(__file__))
path_addons = os.path.join(path_root, 'addons')
if os.path.exists(path_addons):
options.addons_path.append(path_addons)
options.addons_path = [
path[:-1] if path[-1] in r'\/' else path
for path in options.addons_path
if os.path.exists(path)
]
for path_addons in options.addons_path:
if path_addons not in sys.path:
sys.path.insert(0, path_addons)
try:
import web.common.http
except ImportError:
optparser.error('Error Importing base web module. Check correctness of --addons-path.')
options.backend = 'xmlrpc'
os.environ["TZ"] = "UTC"
if sys.version_info >= (2, 7):
if sys.version_info >= (2, 7) and os.path.exists(options.log_config):
with open(options.log_config) as file:
dct = json.load(file)
logging.config.dictConfig(dct)
logging.getLogger("").setLevel(getattr(logging, options.log_level.upper()))
logging.getLogger().setLevel(getattr(logging, options.log_level.upper()))
else:
logging.basicConfig(level=getattr(logging, options.log_level.upper()))
+3 -10
View File
@@ -2,7 +2,7 @@
import os
import re
import sys
from setuptools import setup
from setuptools import setup, find_packages
execfile('addons/web/common/release.py')
@@ -57,14 +57,7 @@ setup(
],
test_suite = 'unittest2.collector',
zip_safe=False,
packages=[
'addons',
'addons.base',
'addons.base.controllers',
'addons.base_calendar',
'addons.base_hello',
'openerpweb',
],
packages=find_packages(),
classifiers=[
'Development Status :: 6 - Production/Stable',
'Operating System :: OS Independent',
@@ -72,7 +65,7 @@ setup(
'Environment :: Web Environment',
'Topic :: Office/Business :: Financial',
],
scripts=['scripts/openerp-web'],
scripts=['openerp-web'],
data_files=(find_data_files('addons')
+ opts.pop('data_files', [])
),