diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-08-22 14:32:58 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-08-22 14:32:58 +0200 |
| commit | 2fad2d1f80a2162d7523d8ef5d2eee5c4c76ff10 (patch) | |
| tree | ae3afa6d1d63d4e83aee952307abfab918981876 /addons/base/static/src | |
| parent | c76bb492f20f00de2a05b10f7b1c30b1dca57c49 (diff) | |
| parent | eebd0ccfd246c4e9a88574100844e606c18b0683 (diff) | |
[MERGE] from trunk
bzr revid: xmo@openerp.com-20110822123258-thxewwdvbysap4jt
Diffstat (limited to 'addons/base/static/src')
| -rw-r--r-- | addons/base/static/src/css/base.css | 26 | ||||
| -rw-r--r-- | addons/base/static/src/js/boot.js | 36 | ||||
| -rw-r--r-- | addons/base/static/src/js/chrome.js | 18 | ||||
| -rw-r--r-- | addons/base/static/src/js/core.js | 578 | ||||
| -rw-r--r-- | addons/base/static/src/js/data.js | 16 | ||||
| -rw-r--r-- | addons/base/static/src/js/dates.js | 138 | ||||
| -rw-r--r-- | addons/base/static/src/js/form.js | 99 | ||||
| -rw-r--r-- | addons/base/static/src/js/formats.js | 134 | ||||
| -rw-r--r-- | addons/base/static/src/js/list-editable.js | 2 | ||||
| -rw-r--r-- | addons/base/static/src/js/list.js | 11 | ||||
| -rw-r--r-- | addons/base/static/src/js/view_tree.js | 2 | ||||
| -rw-r--r-- | addons/base/static/src/js/views.js | 37 | ||||
| -rw-r--r-- | addons/base/static/src/xml/base.xml | 22 |
13 files changed, 590 insertions, 529 deletions
diff --git a/addons/base/static/src/css/base.css b/addons/base/static/src/css/base.css index e8d411b1ae1..21016dcb5a7 100644 --- a/addons/base/static/src/css/base.css +++ b/addons/base/static/src/css/base.css @@ -1,11 +1,17 @@ /* TODO: separate openerp web client page css from openerp views css */ -body { +body.openerp { padding: 0; margin: 0; - font-family: helvetica, arial, sans-serif; + height: 100%; + min-width: 1000px; + overflow-y: scroll; font-size: 80%; } +body.openerp, .openerp textarea, .openerp input, .openerp select, .openerp option, .openerp button, .openerp .ui-widget { + font-family: Ubuntu, Helvetica, sans-serif; +} + .oe_box { border: 1px solid #aaf; padding: 2px; @@ -20,13 +26,6 @@ body { margin: 0; } - -body.openerp { - height: 100%; - min-width: 1000px; - overflow-y: scroll; -} - .openerp .oe-number { text-align: right !important; } @@ -120,7 +119,6 @@ body.openerp { -moz-border-radius: 3px; -webkit-border-radius: 3px; color: white; - font-family: Ubuntu, Helvetica, sans-serif; font-size: 16px; font-weight: bold; padding: 5px; @@ -381,7 +379,7 @@ label.error { /* Header */ .openerp .header { height: 65px; - background: url("../img/header-background.png") repeat-x scroll left top transparent; + background: url("/base/static/src/img/header-background.png") repeat-x scroll left top transparent; color: #FFFFFF; letter-spacing: 0.5px; text-shadow: 0 1px 0 #333333; @@ -497,7 +495,6 @@ label.error { color: #666666; font-weight: bold; font-size: 0.8em; - font-family: Ubuntu, Helvetica, sans-serif; text-align: center; } .openerp div.oe_footer p.oe_footer_powered a { @@ -515,7 +512,6 @@ label.error { .openerp h2.oe_view_title { font-size: 175%; font-weight: normal; - font-family: Ubuntu, Helvetica, sans-serif; margin: 2px 0; color: #252424; text-shadow: white 0 1px 0; @@ -859,7 +855,7 @@ label.error { -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; - padding: 2px; + padding: 0 2px 0 2px; border: 1px solid #999; -moz-border-radius: 3px; -webkit-border-radius: 3px; @@ -988,7 +984,6 @@ label.error { margin: 0; width: 180px; height: 100%; - font-family: Ubuntu, Helvetica, sans-serif; font-size: 0.9em; } @@ -1046,7 +1041,6 @@ label.error { .openerp .view-manager-main-sidebar h2 { margin:0; - font-family: Ubuntu, Helvetica, sans-serif; font-size: 1.15em; color: #8E8E8E; text-shadow: white 0 1px 0; diff --git a/addons/base/static/src/js/boot.js b/addons/base/static/src/js/boot.js index 3d1d1e75e7c..fff710a1d68 100644 --- a/addons/base/static/src/js/boot.js +++ b/addons/base/static/src/js/boot.js @@ -12,10 +12,7 @@ return; var session_counter = 0; - /** @lends openerp */ var openerp = this.openerp = { - // debug flag - debug: true, // Per session namespace // openerp.<module> will map to // openerp.sessions.sessionname.<module> using a closure @@ -44,7 +41,6 @@ } return new_instance; } - // TODO add initrpc to init core only for RPC }; })(); @@ -54,35 +50,15 @@ openerp.base = function(instance) { openerp.base.core(instance); + openerp.base.dates(instance); openerp.base.formats(instance); openerp.base.chrome(instance); openerp.base.data(instance); - if (openerp.base.views) { - openerp.base.views(instance); - } - if (openerp.base.search) { - openerp.base.search(instance); - } - if (openerp.base.list) { - openerp.base.list(instance); - } - if (openerp.base. m2o) { - openerp.base.m2o(instance); - } - if (openerp.base.form) { - openerp.base.form(instance); - } - if (openerp.base.list && openerp.base.list.editable) { - openerp.base.list.editable(instance); - } - if (openerp.web_mobile) { - openerp.web_mobile(instance); - } - if (openerp.base.view_tree) { - openerp.base.view_tree(instance); - } - if (openerp.base.data_export) { - openerp.base.data_export(instance); + files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export"]; + for(i=0; i<files.length; i++) { + if(openerp.base[files[i]]) { + openerp.base[files[i]](instance); + } } }; diff --git a/addons/base/static/src/js/chrome.js b/addons/base/static/src/js/chrome.js index 927a000f002..665efa0e3e3 100644 --- a/addons/base/static/src/js/chrome.js +++ b/addons/base/static/src/js/chrome.js @@ -102,6 +102,7 @@ openerp.base.Dialog = openerp.base.OldWidget.extend({ } this.set_options(dialog_options); this.$dialog.dialog(this.dialog_options).dialog('open'); + return this; }, close: function() { // Closes the dialog but leave it in a state where it could be opened again. @@ -291,8 +292,7 @@ openerp.base.Database = openerp.base.Widget.extend({ }, do_create: function() { var self = this; - self.$option_id.html(QWeb.render("CreateDB", self)); - + self.$option_id.html(QWeb.render("Database.CreateDB", self)); self.$option_id.find("form[name=create_db_form]").validate({ submitHandler: function (form) { var fields = $(form).serializeArray(); @@ -314,11 +314,9 @@ openerp.base.Database = openerp.base.Widget.extend({ } }); }, - do_drop: function() { var self = this; self.$option_id.html(QWeb.render("DropDB", self)); - self.$option_id.find("form[name=drop_db_form]").validate({ submitHandler: function (form) { var $form = $(form), @@ -341,7 +339,6 @@ openerp.base.Database = openerp.base.Widget.extend({ } }); }, - wait_for_file: function (token, cleanup) { var self = this, cookie_name = 'fileToken', @@ -362,7 +359,7 @@ openerp.base.Database = openerp.base.Widget.extend({ if (cleanup) { cleanup(); } } - }, 100); + }, 200); }, do_backup: function() { var self = this; @@ -402,7 +399,6 @@ openerp.base.Database = openerp.base.Widget.extend({ } }); }, - do_restore: function() { var self = this; self.$option_id.html(QWeb.render("RestoreDB", self)); @@ -441,7 +437,6 @@ openerp.base.Database = openerp.base.Widget.extend({ } }); }, - do_change_password: function() { var self = this; self.$option_id.html(QWeb.render("Change_DB_Pwd", self)); @@ -836,13 +831,6 @@ openerp.base.WebClient = openerp.base.Widget.extend({ } }); -openerp.base.webclient = function(element_id) { - // TODO Helper to start webclient rename it openerp.base.webclient - var client = new openerp.base.WebClient(element_id); - client.start(); - return client; -}; - }; // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/base/static/src/js/core.js b/addons/base/static/src/js/core.js index 5c2e6554785..68cc4d0869b 100644 --- a/addons/base/static/src/js/core.js +++ b/addons/base/static/src/js/core.js @@ -323,6 +323,293 @@ openerp.base.CallbackEnabled = openerp.base.Class.extend({ } }); +openerp.base.Session = openerp.base.CallbackEnabled.extend( /** @lends openerp.base.Session# */{ + /** + * @constructs + * @param server + * @param port + */ + init: function(server, port) { + this._super(); + this.server = (server == undefined) ? location.hostname : server; + this.port = (port == undefined) ? location.port : port; + this.rpc_mode = (server == location.hostname) ? "ajax" : "jsonp"; + this.debug = (window.location.search.indexOf('?debug') !== -1); + this.db = ""; + this.login = ""; + this.password = ""; + this.user_context= {}; + this.uid = false; + this.session_id = false; + this.module_list = []; + this.module_loaded = {"base": true}; + this.context = {}; + this.shortcuts = []; + this.active_id = null; + this.session = this; + }, + start: function() { + this.session_restore(); + }, + /** + * Executes an RPC call, registering the provided callbacks. + * + * Registers a default error callback if none is provided, and handles + * setting the correct session id and session context in the parameter + * objects + * + * @param {String} url RPC endpoint + * @param {Object} params call parameters + * @param {Function} success_callback function to execute on RPC call success + * @param {Function} error_callback function to execute on RPC call failure + * @returns {jQuery.Deferred} jquery-provided ajax deferred + */ + rpc: function(url, params, success_callback, error_callback) { + var self = this; + // Construct a JSON-RPC2 request, method is currently unused + params.session_id = this.session_id; + + // Call using the rpc_mode + var deferred = $.Deferred(); + this.rpc_ajax(url, { + jsonrpc: "2.0", + method: "call", + params: params, + id:null + }).then(function () {deferred.resolve.apply(deferred, arguments);}, + function(error) {deferred.reject(error, $.Event());}); + return deferred.fail(function() { + deferred.fail(function(error, event) { + if (!event.isDefaultPrevented()) { + self.on_rpc_error(error, event); + } + }); + }).then(success_callback, error_callback).promise(); + }, + /** + * Raw JSON-RPC call + * + * @returns {jQuery.Deferred} ajax-based deferred object + */ + rpc_ajax: function(url, payload) { + var self = this; + this.on_rpc_request(); + // url can be an $.ajax option object + if (_.isString(url)) { + url = { + url: url + } + } + var ajax = _.extend({ + type: "POST", + url: url, + dataType: 'json', + contentType: 'application/json', + data: JSON.stringify(payload), + processData: false + }, url); + var deferred = $.Deferred(); + $.ajax(ajax).done(function(response, textStatus, jqXHR) { + self.on_rpc_response(); + if (!response.error) { + deferred.resolve(response["result"], textStatus, jqXHR); + return; + } + if (response.error.data.type !== "session_invalid") { + deferred.reject(response.error); + return; + } + self.uid = false; + self.on_session_invalid(function() { + self.rpc(url, payload.params, + function() { + deferred.resolve.apply(deferred, arguments); + }, + function(error, event) { + event.preventDefault(); + deferred.reject.apply(deferred, arguments); + }); + }); + }).fail(function(jqXHR, textStatus, errorThrown) { + self.on_rpc_response(); + var error = { + code: -32098, + message: "XmlHttpRequestError " + errorThrown, + data: {type: "xhr"+textStatus, debug: jqXHR.responseText, objects: [jqXHR, errorThrown] } + }; + deferred.reject(error); + }); + return deferred.promise(); + }, + on_rpc_request: function() { + }, + on_rpc_response: function() { + }, + on_rpc_error: function(error) { + }, + /** + * The session is validated either by login or by restoration of a previous session + */ + on_session_valid: function() { + if(!openerp._modules_loaded) + this.load_modules(); + }, + on_session_invalid: function(contination) { + }, + session_is_valid: function() { + return this.uid; + }, + session_login: function(db, login, password, success_callback) { + var self = this; + this.db = db; + this.login = login; + this.password = password; + var params = { db: this.db, login: this.login, password: this.password }; + this.rpc("/base/session/login", params, function(result) { + self.session_id = result.session_id; + self.uid = result.uid; + self.user_context = result.context; + self.session_save(); + self.on_session_valid(); + if (success_callback) + success_callback(); + }); + }, + session_logout: function() { + this.uid = false; + }, + /** + * Reloads uid and session_id from local storage, if they exist + */ + session_restore: function () { + this.uid = this.get_cookie('uid'); + this.session_id = this.get_cookie('session_id'); + this.db = this.get_cookie('db'); + this.login = this.get_cookie('login'); + this.user_context = this.get_cookie("user_context"); + // we should do an rpc to confirm that this session_id is valid and if it is retrieve the information about db and login + // then call on_session_valid + this.on_session_valid(); + }, + /** + * Saves the session id and uid locally + */ + session_save: function () { + this.set_cookie('uid', this.uid); + this.set_cookie('session_id', this.session_id); + this.set_cookie('db', this.db); + this.set_cookie('login', this.login); + this.set_cookie('user_context', this.user_context); + }, + logout: function() { + delete this.uid; + delete this.session_id; + delete this.db; + delete this.login; + this.set_cookie('uid', ''); + this.set_cookie('session_id', ''); + this.set_cookie('db', ''); + this.set_cookie('login', ''); + this.on_session_invalid(function() {}); + }, + /** + * Fetches a cookie stored by an openerp session + * + * @private + * @param name the cookie's name + */ + get_cookie: function (name) { + var nameEQ = this.element_id + '|' + name + '='; + var cookies = document.cookie.split(';'); + for(var i=0; i<cookies.length; ++i) { + var cookie = cookies[i].replace(/^\s*/, ''); + if(cookie.indexOf(nameEQ) === 0) { + return JSON.parse(decodeURIComponent(cookie.substring(nameEQ.length))); + } + } + return null; + }, + /** + * Create a new cookie with the provided name and value + * + * @private + * @param name the cookie's name + * @param value the cookie's value + * @param ttl the cookie's time to live, 1 year by default, set to -1 to delete + */ + set_cookie: function (name, value, ttl) { + ttl = ttl || 24*60*60*365; + document.cookie = [ + this.element_id + '|' + name + '=' + encodeURIComponent(JSON.stringify(value)), + 'max-age=' + ttl, + 'expires=' + new Date(new Date().getTime() + ttl*1000).toGMTString() + ].join(';'); + }, + /** + * Load additional web addons of that instance and init them + */ + load_modules: function() { + var self = this; + this.rpc('/base/session/modules', {}, function(result) { + self.module_list = result; + var lang = self.user_context.lang; + params = { mods: ["base"].concat(result), lang: lang}; + self.rpc('/base/webclient/translations',params).then(function(transs) { + openerp.base._t.database.set_bundle(transs); + var modules = self.module_list.join(','); + if(self.debug) { + self.rpc('/base/webclient/csslist', {"mods": modules}, self.do_load_css); + self.rpc('/base/webclient/jslist', {"mods": modules}, self.do_load_js); + } else { + self.do_load_css(["/base/webclient/css?mods="+modules]); + self.do_load_js(["/base/webclient/js?mods="+modules]); + } + openerp._modules_loaded = true; + }); + }); + }, + do_load_css: function (files) { + _.each(files, function (file) { + $('head').append($('<link>', { + 'href': file, + 'rel': 'stylesheet', + 'type': 'text/css' + })); + }); + }, + do_load_js: function(files) { + var self = this; + if(files.length != 0) { + var file = files.shift(); + var tag = document.createElement('script'); + tag.type = 'text/javascript'; + tag.src = file; + tag.onload = tag.onreadystatechange = function() { + if ( (tag.readyState && tag.readyState != "loaded" && tag.readyState != "complete") || tag.onload_done ) + return; + tag.onload_done = true; + self.do_load_js(files); + }; + document.head.appendChild(tag); + } else { + this.on_modules_loaded(); + } + }, + on_modules_loaded: function() { + for(var j=0; j<this.module_list.length; j++) { + var mod = this.module_list[j]; + if(this.module_loaded[mod]) + continue; + openerp[mod] = {}; + // init module mod + if(openerp._openerp[mod] != undefined) { + openerp._openerp[mod](openerp); + this.module_loaded[mod] = true; + } + } + } +}); + /** * Utility class that any class is allowed to extend to easy common manipulations. * @@ -355,7 +642,7 @@ openerp.base.SessionAware = openerp.base.CallbackEnabled.extend({ this.on_log.apply(this,args); }, on_log: function() { - if(window.openerp.debug || (window.location.search.indexOf('?debug') !== -1)) { + if(this.session.debug) { var notify = false; var body = false; if(window.console) { @@ -616,295 +903,6 @@ openerp.base.TranslationDataBase = openerp.base.Class.extend({ openerp.base._t = new openerp.base.TranslationDataBase().build_translation_function(); -openerp.base.Session = openerp.base.CallbackEnabled.extend( /** @lends openerp.base.Session# */{ - /** - * @constructs - * @param element_id to use for exception reporting - * @param server - * @param port - */ - init: function(server, port) { - this._super(); - this.server = (server == undefined) ? location.hostname : server; - this.port = (port == undefined) ? location.port : port; - this.rpc_mode = (server == location.hostname) ? "ajax" : "jsonp"; - this.debug = true; - this.db = ""; - this.login = ""; - this.password = ""; - this.user_context= {}; - this.uid = false; - this.session_id = false; - this.module_list = []; - this.module_loaded = {"base": true}; - this.context = {}; - this.shortcuts = []; - this.active_id = null; - }, - start: function() { - this.session_restore(); - }, - /** - * Executes an RPC call, registering the provided callbacks. - * - * Registers a default error callback if none is provided, and handles - * setting the correct session id and session context in the parameter - * objects - * - * @param {String} url RPC endpoint - * @param {Object} params call parameters - * @param {Function} success_callback function to execute on RPC call success - * @param {Function} error_callback function to execute on RPC call failure - * @returns {jQuery.Deferred} jquery-provided ajax deferred - */ - rpc: function(url, params, success_callback, error_callback) { - var self = this; - // Construct a JSON-RPC2 request, method is currently unused - params.session_id = this.session_id; - - // Call using the rpc_mode - var deferred = $.Deferred(); - this.rpc_ajax(url, { - jsonrpc: "2.0", - method: "call", - params: params, - id:null - }).then(function () {deferred.resolve.apply(deferred, arguments);}, - function(error) {deferred.reject(error, $.Event());}); - return deferred.fail(function() { - deferred.fail(function(error, event) { - if (!event.isDefaultPrevented()) { - self.on_rpc_error(error, event); - } - }); - }).then(success_callback, error_callback).promise(); - }, - /** - * Raw JSON-RPC call - * - * @returns {jQuery.Deferred} ajax-based deferred object - */ - rpc_ajax: function(url, payload) { - var self = this; - this.on_rpc_request(); - // url can be an $.ajax option object - if (_.isString(url)) { - url = { - url: url - } - } - var ajax = _.extend({ - type: "POST", - url: url, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(payload), - processData: false - }, url); - var deferred = $.Deferred(); - $.ajax(ajax).done(function(response, textStatus, jqXHR) { - self.on_rpc_response(); - if (!response.error) { - deferred.resolve(response["result"], textStatus, jqXHR); - return; - } - if (response.error.data.type !== "session_invalid") { - deferred.reject(response.error); - return; - } - self.uid = false; - self.on_session_invalid(function() { - self.rpc(url, payload.params, - function() { - deferred.resolve.apply(deferred, arguments); - }, - function(error, event) { - event.preventDefault(); - deferred.reject.apply(deferred, arguments); - }); - }); - }).fail(function(jqXHR, textStatus, errorThrown) { - self.on_rpc_response(); - var error = { - code: -32098, - message: "XmlHttpRequestError " + errorThrown, - data: {type: "xhr"+textStatus, debug: jqXHR.responseText, objects: [jqXHR, errorThrown] } - }; - deferred.reject(error); - }); - return deferred.promise(); - }, - on_rpc_request: function() { - }, - on_rpc_response: function() { - }, - on_rpc_error: function(error) { - }, - /** - * The session is validated either by login or by restoration of a previous session - */ - on_session_valid: function() { - if(!openerp._modules_loaded) - this.load_modules(); - }, - on_session_invalid: function(contination) { - }, - session_is_valid: function() { - return this.uid; - }, - session_login: function(db, login, password, success_callback) { - var self = this; - this.db = db; - this.login = login; - this.password = password; - var params = { db: this.db, login: this.login, password: this.password }; - this.rpc("/base/session/login", params, function(result) { - self.session_id = result.session_id; - self.uid = result.uid; - self.user_context = result.context; - self.session_save(); - self.on_session_valid(); - if (success_callback) - success_callback(); - }); - }, - session_logout: function() { - this.uid = false; - }, - /** - * Reloads uid and session_id from local storage, if they exist - */ - session_restore: function () { - this.uid = this.get_cookie('uid'); - this.session_id = this.get_cookie('session_id'); - this.db = this.get_cookie('db'); - this.login = this.get_cookie('login'); - this.user_context = this.get_cookie("user_context"); - // we should do an rpc to confirm that this session_id is valid and if it is retrieve the information about db and login - // then call on_session_valid - this.on_session_valid(); - }, - /** - * Saves the session id and uid locally - */ - session_save: function () { - this.set_cookie('uid', this.uid); - this.set_cookie('session_id', this.session_id); - this.set_cookie('db', this.db); - this.set_cookie('login', this.login); - this.set_cookie('user_context', this.user_context); - }, - logout: function() { - delete this.uid; - delete this.session_id; - delete this.db; - delete this.login; - this.set_cookie('uid', ''); - this.set_cookie('session_id', ''); - this.set_cookie('db', ''); - this.set_cookie('login', ''); - this.on_session_invalid(function() {}); - }, - /** - * Fetches a cookie stored by an openerp session - * - * @private - * @param name the cookie's name - */ - get_cookie: function (name) { - var nameEQ = this.element_id + '|' + name + '='; - var cookies = document.cookie.split(';'); - for(var i=0; i<cookies.length; ++i) { - var cookie = cookies[i].replace(/^\s*/, ''); - if(cookie.indexOf(nameEQ) === 0) { - return JSON.parse(decodeURIComponent(cookie.substring(nameEQ.length))); - } - } - return null; - }, - /** - * Create a new cookie with the provided name and value - * - * @private - * @param name the cookie's name - * @param value the cookie's value - * @param ttl the cookie's time to live, 1 year by default, set to -1 to delete - */ - set_cookie: function (name, value, ttl) { - ttl = ttl || 24*60*60*365; - document.cookie = [ - this.element_id + '|' + name + '=' + encodeURIComponent(JSON.stringify(value)), - 'max-age=' + ttl, - 'expires=' + new Date(new Date().getTime() + ttl*1000).toGMTString() - ].join(';'); - }, - /** - * Load additional web addons of that instance and init them - */ - load_modules: function() { - var self = this; - this.rpc('/base/session/modules', {}, function(result) { - self.module_list = result; - var lang = self.user_context.lang; - self.rpc('/base/webclient/translations',{ - mods: ["base"].concat(result), - lang: lang}) - .then(function(transs) { - openerp.base._t.database.set_bundle(transs); - var modules = self.module_list.join(','); - if(self.debug || true) { - self.rpc('/base/webclient/csslist', {"mods": modules}, self.do_load_css); - self.rpc('/base/webclient/jslist', {"mods": modules}, self.do_load_js); - } else { - self.do_load_css(["/base/webclient/css?mods="+modules]); - self.do_load_js(["/base/webclient/js?mods="+modules]); - } - openerp._modules_loaded = true; - }); - }); - }, - do_load_css: function (files) { - _.each(files, function (file) { - $('head').append($('<link>', { - 'href': file, - 'rel': 'stylesheet', - 'type': 'text/css' - })); - }); - }, - do_load_js: function(files) { - var self = this; - if(files.length != 0) { - var file = files.shift(); - var tag = document.createElement('script'); - tag.type = 'text/javascript'; - tag.src = file; - tag.onload = tag.onreadystatechange = function() { - if ( (tag.readyState && tag.readyState != "loaded" && tag.readyState != "complete") || tag.onload_done ) - return; - tag.onload_done = true; - self.do_load_js(files); - }; - document.head.appendChild(tag); - } else { - this.on_modules_loaded(); - } - }, - on_modules_loaded: function() { - for(var j=0; j<this.module_list.length; j++) { - var mod = this.module_list[j]; - if(this.module_loaded[mod]) - continue; - openerp[mod] = {}; - // init module mod - if(openerp._openerp[mod] != undefined) { - openerp._openerp[mod](openerp); - this.module_loaded[mod] = true; - } - } - } -}); - }; // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index 244c057d544..04c23224806 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -286,14 +286,16 @@ openerp.base.DataSet = openerp.base.Widget.extend( /** @lends openerp.base.Data * Read a slice of the records represented by this DataSet, based on its * domain and context. * + * @param {Array} [fields] fields to read and return, by default all fields are returned * @params {Object} options - * @param {Array} [options.fields] fields to read and return, by default all fields are returned * @param {Number} [options.offset=0] The index from which selected records should be returned * @param {Number} [options.limit=null] The maximum number of records to return * @param {Function} callback function called with read_slice result * @returns {$.Deferred} */ - read_slice: function (options, callback) { return null; }, + read_slice: function (fields, options, callback) { + return null; + }, /** * Reads the current dataset record (from its index) * @@ -478,11 +480,12 @@ openerp.base.DataSetStatic = openerp.base.DataSet.extend({ // all local records this.ids = ids || []; }, - read_slice: function (options, callback) { + read_slice: function (fields, options, callback) { + // TODO remove fields from options var self = this, offset = options.offset || 0, limit = options.limit || false, - fields = options.fields || false; + fields = fields || false; var end_pos = limit && limit !== -1 ? offset + limit : undefined; return this.read_ids(this.ids.slice(offset, end_pos), fields, callback); }, @@ -532,12 +535,13 @@ openerp.base.DataSetSearch = openerp.base.DataSet.extend({ * @param {Function} callback function called with read_slice result * @returns {$.Deferred} */ - read_slice: function (options, callback) { + read_slice: function (fields, options, callback) { var self = this; + var options = options || {}; var offset = options.offset || 0; return this.rpc('/base/dataset/search_read', { model: this.model, - fields: options.fields || false, + fields: fields || false, domain: this.get_domain(options.domain), context: this.get_context(options.context), sort: this.sort(), diff --git a/addons/base/static/src/js/dates.js b/addons/base/static/src/js/dates.js new file mode 100644 index 00000000000..3d3948fa524 --- /dev/null +++ b/addons/base/static/src/js/dates.js @@ -0,0 +1,138 @@ + +openerp.base.dates = function(openerp) { + +/** + * Converts a string to a Date javascript object using OpenERP's + * datetime string format (exemple: '2011-12-01 15:12:35'). + * + * The timezone is assumed to be UTC (standard for OpenERP 6.1) + * and will be converted to the browser's timezone. + * + * @param {String} str A string representing a datetime. + * @returns {Date} + */ +openerp.base.str_to_datetime = function(str) { + if(!str) { + return str; + } + var regex = /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/; + var res = regex.exec(str); + if ( res[0] != str ) { + throw "'" + str + "' is not a valid datetime"; + } + var obj = Date.parse(str + " GMT"); + if (! obj) { + throw "'" + str + "' is not a valid datetime"; + } + return obj; +}; + +/** + * Converts a string to a Date javascript object using OpenERP's + * date string format (exemple: '2011-12-01'). + * + * @param {String} str A string representing a date. + * @returns {Date} + */ +openerp.base.str_to_date = function(str) { + if(!str) { + return str; + } + var regex = /\d\d\d\d-\d\d-\d\d/; + var res = regex.exec(str); + if ( res[0] != str ) { + throw "'" + str + "' is not a valid date"; + } + var obj = Date.parse(str); + if (! obj) { + throw "'" + str + "' is not a valid date"; + } + return obj; +}; + +/** + * Converts a string to a Date javascript object using OpenERP's + * time string format (exemple: '15:12:35'). + * + * @param {String} str A string representing a time. + * @returns {Date} + */ +openerp.base.str_to_time = function(str) { + if(!str) { + return str; + } + var regex = /\d\d:\d\d:\d\d/; + var res = regex.exec(str); + if ( res[0] != str ) { + throw "'" + str + "' is not a valid time"; + } + var obj = Date.parse(str); + if (! obj) { + throw "'" + str + "' is not a valid time"; + } + return obj; +}; + +/* + * Left-pad provided arg 1 with zeroes until reaching size provided by second + * argument. + * + * @param {Number|String} str value to pad + * @param {Number} size size to reach on the final padded value + * @returns {String} padded string + */ +var zpad = function(str, size) { + str = "" + str; + return new Array(size - str.length + 1).join('0') + str; +}; + +/** + * Converts a Date javascript object to a string using OpenERP's + * datetime string format (exemple: '2011-12-01 15:12:35'). + * + * The timezone of the Date object is assumed to be the one of the + * browser and it will be converted to UTC (standard for OpenERP 6.1). + * + * @param {Date} obj + * @returns {String} A string representing a datetime. + */ +openerp.base.datetime_to_str = function(obj) { + if (!obj) { + return false; + } + return zpad(obj.getUTCFullYear(),4) + "-" + zpad(obj.getUTCMonth() + 1,2) + "-" + + zpad(obj.getUTCDate(),2) + " " + zpad(obj.getUTCHours(),2) + ":" + + zpad(obj.getUTCMinutes(),2) + ":" + zpad(obj.getUTCSeconds(),2); +}; + +/** + * Converts a Date javascript object to a string using OpenERP's + * date string format (exemple: '2011-12-01'). + * + * @param {Date} obj + * @returns {String} A string representing a date. + */ +openerp.base.date_to_str = function(obj) { + if (!obj) { + return false; + } + return zpad(obj.getFullYear(),4) + "-" + zpad(obj.getMonth() + 1,2) + "-" + + zpad(obj.getDate(),2); +}; + +/** + * Converts a Date javascript object to a string using OpenERP's + * time string format (exemple: '15:12:35'). + * + * @param {Date} obj + * @returns {String} A string representing a time. + */ +openerp.base.time_to_str = function(obj) { + if (!obj) { + return false; + } + return zpad(obj.getHours(),2) + ":" + zpad(obj.getMinutes(),2) + ":" + + zpad(obj.getSeconds(),2); +}; + +}; diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index 6eeff025e1f..e7bc2d51eba 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -1,5 +1,5 @@ openerp.base.form = function (openerp) { - + var _t = openerp.base._t; openerp.base.views.add('form', 'openerp.base.FormView'); @@ -346,7 +346,10 @@ openerp.base.FormView = openerp.base.View.extend( /** @lends openerp.base.FormVi }); } } else { - return false; + setTimeout(function() { + self.on_saved({ result: true }, success); + }); + return true; } }, do_save_edit: function() { @@ -458,9 +461,7 @@ openerp.base.form.SidebarAttachments = openerp.base.Widget.extend({ ['res_model', '=', this.view.dataset.model], ['res_id', '=', this.view.datarecord.id], ['type', 'in', ['binary', 'url']] - ])).read_slice( - {fields: ['name', 'url', 'type']}, - this.on_attachments_loaded); + ])).read_slice(['name', 'url', 'type'], this.on_attachments_loaded); } }, on_attachments_loaded: function(attachments) { @@ -811,6 +812,7 @@ openerp.base.form.WidgetLabel = openerp.base.form.Widget.extend({ this.$element.find("label").dblclick(function() { var widget = self['for'] || self; self.log(widget.element_id , widget); + window.w = widget; }); } }); @@ -841,9 +843,12 @@ openerp.base.form.Field = openerp.base.form.Widget.extend({ this.value = value; this.invalid = false; this.update_dom(); + this.on_value_changed(); }, set_value_from_ui: function() { - this.value = undefined; + this.on_value_changed(); + }, + on_value_changed: function() { }, get_value: function() { return this.value; @@ -942,6 +947,7 @@ openerp.base.form.FieldChar = openerp.base.form.Field.extend({ }, set_value_from_ui: function() { this.value = this.$element.find('input').val(); + this._super(); }, validate: function() { this.invalid = false; @@ -1016,6 +1022,7 @@ openerp.base.form.FieldFloat = openerp.base.form.FieldChar.extend({ }, set_value_from_ui: function() { this.value = Number(this.$element.find('input').val().replace(/,/g, '.')); + this._super(); } }); @@ -1036,6 +1043,7 @@ openerp.base.form.FieldInteger = openerp.base.form.FieldFloat.extend({ }, set_value_from_ui: function() { this.value = Number(this.$element.find('input').val()); + this._super(); } }); @@ -1073,6 +1081,7 @@ openerp.base.form.FieldDatetime = openerp.base.form.Field.extend({ if (this.value) { this.value = this.format(this.value); } + this._super(); }, update_dom: function() { this._super.apply(this, arguments); @@ -1092,8 +1101,8 @@ openerp.base.form.FieldDatetime = openerp.base.form.Field.extend({ focus: function() { this.$element.find('input').focus(); }, - parse: openerp.base.parse_datetime, - format: openerp.base.format_datetime + parse: openerp.base.str_to_datetime, + format: openerp.base.datetime_to_str }); openerp.base.form.FieldDate = openerp.base.form.FieldDatetime.extend({ @@ -1102,8 +1111,8 @@ openerp.base.form.FieldDate = openerp.base.form.FieldDatetime.extend({ this.jqueryui_object = 'datepicker'; this.validation_regex = /^\d+-\d+-\d+$/; }, - parse: openerp.base.parse_date, - format: openerp.base.format_date + parse: openerp.base.str_to_date, + format: openerp.base.date_to_str }); openerp.base.form.FieldFloatTime = openerp.base.form.FieldChar.extend({ @@ -1124,6 +1133,7 @@ openerp.base.form.FieldFloatTime = openerp.base.form.FieldChar.extend({ set_value_from_ui: function() { var time = this.$element.find('input').val().split(':'); this.set_value(parseInt(time[0], 10) + parseInt(time[1], 10) / 60); + this._super(); } }); @@ -1148,6 +1158,7 @@ openerp.base.form.FieldText = openerp.base.form.Field.extend({ }, set_value_from_ui: function() { this.value = this.$element.find('textarea').val(); + this._super(); }, validate: function() { this.invalid = false; @@ -1183,6 +1194,7 @@ openerp.base.form.FieldBoolean = openerp.base.form.Field.extend({ }, set_value_from_ui: function() { this.value = this.$element.find('input').is(':checked'); + this._super(); }, update_dom: function() { this._super.apply(this, arguments); @@ -1265,6 +1277,7 @@ openerp.base.form.FieldSelection = openerp.base.form.Field.extend({ var ikey = this.$element.find('select').val(); var option = _.detect(this.field_index, function(x) {return x.ikey === ikey;}); this.value = option === undefined ? false : option.ekey; + this._super(); }, update_dom: function() { this._super.apply(this, arguments); @@ -1529,7 +1542,6 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({ this.on_ui_change(); } }, - set_value_from_ui: function() {}, set_value: function(value) { value = value || null; var self = this; @@ -1697,7 +1709,6 @@ openerp.base.form.FieldOne2Many = openerp.base.form.Field.extend({ }); } }, - set_value_from_ui: function() {}, set_value: function(value) { value = value || []; var self = this; @@ -1918,7 +1929,6 @@ openerp.base.form.FieldMany2Many = openerp.base.form.Field.extend({ get_value: function() { return [commands.replace_with(this.dataset.ids)]; }, - set_value_from_ui: function() {}, validate: function() { this.invalid = false; // TODO niv @@ -2192,10 +2202,67 @@ openerp.base.form.FormOpenPopup = openerp.base.OldWidget.extend({ } }); -openerp.base.form.FieldReference = openerp.base.form.FieldChar.extend({ +openerp.base.form.FieldReference = openerp.base.form.Field.extend({ init: function(view, node) { this._super(view, node); - //this.template = "FieldReference"; + this.template = "FieldReference"; + this.fields_view = { + fields: { + selection: { + selection: view.fields_view.fields[this.name].selection + }, + m2o: { + relation: null + } + } + } + this.get_fields_values = view.get_fields_values; + this.do_onchange = this.on_form_changed = this.on_nop; + this.widgets = {}; + this.fields = {}; + this.selection = new openerp.base.form.FieldSelection(this, { attrs: { + name: 'selection', + widget: 'selection' + }}); + this.selection.on_value_changed.add_last(this.on_selection_changed); + this.m2o = new openerp.base.form.FieldMany2One(this, { attrs: { + name: 'm2o', + widget: 'many2one' + }}); + }, + on_nop: function() { + }, + on_selection_changed: function() { + this.m2o.field.relation = this.selection.get_value(); + this.m2o.set_value(null); + }, + start: function() { + this._super(); + this.selection.start(); + this.m2o.start(); + }, + is_valid: function() { + return this.required === false || typeof(this.get_value()) === 'string'; + }, + is_dirty: function() { + return this.selection.is_dirty() || this.m2o.is_dirty(); + }, + set_value: function(value) { + this._super(value); + if (typeof(value) === 'string') { + var vals = value.split(','); + this.selection.set_value(vals[0]); + this.m2o.set_value(parseInt(vals[1], 10)); + } + }, + get_value: function() { + var model = this.selection.get_value(), + id = this.m2o.get_value(); + if (typeof(model) === 'string' && typeof(id) === 'number') { + return model + ',' + id; + } else { + return false; + } } }); @@ -2211,8 +2278,6 @@ openerp.base.form.FieldBinary = openerp.base.form.Field.extend({ this.$element.find('button.oe-binary-file-save').click(this.on_save_as); this.$element.find('.oe-binary-file-clear').click(this.on_clear); }, - set_value_from_ui: function() { - }, update_dom: function() { this._super.apply(this, arguments); this.$element.find('.oe-binary').toggle(!this.readonly); diff --git a/addons/base/static/src/js/formats.js b/addons/base/static/src/js/formats.js index abb05ec9dc4..2c2856f7e85 100644 --- a/addons/base/static/src/js/formats.js +++ b/addons/base/static/src/js/formats.js @@ -2,140 +2,6 @@ openerp.base.formats = function(openerp) { /** - * Converts a string to a Date javascript object using OpenERP's - * datetime string format (exemple: '2011-12-01 15:12:35'). - * - * The timezone is assumed to be UTC (standard for OpenERP 6.1) - * and will be converted to the browser's timezone. - * - * @param {String} str A string representing a datetime. - * @returns {Date} - */ -openerp.base.parse_datetime = function(str) { - if(!str) { - return str; - } - var regex = /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/; - var res = regex.exec(str); - if ( res[0] != str ) { - throw "'" + str + "' is not a valid datetime"; - } - var obj = Date.parse(str + " GMT"); - if (! obj) { - throw "'" + str + "' is not a valid datetime"; - } - return obj; -}; - -/** - * Converts a string to a Date javascript object using OpenERP's - * date string format (exemple: '2011-12-01'). - * - * @param {String} str A string representing a date. - * @returns {Date} - */ -openerp.base.parse_date = function(str) { - if(!str) { - return str; - } - var regex = /\d\d\d\d-\d\d-\d\d/; - var res = regex.exec(str); - if ( res[0] != str ) { - throw "'" + str + "' is not a valid date"; - } - var obj = Date.parse(str); - if (! obj) { - throw "'" + str + "' is not a valid date"; - } - return obj; -}; - -/** - * Converts a string to a Date javascript object using OpenERP's - * time string format (exemple: '15:12:35'). - * - * @param {String} str A string representing a time. - * @returns {Date} - */ -openerp.base.parse_time = function(str) { - if(!str) { - return str; - } - var regex = /\d\d:\d\d:\d\d/; - var res = regex.exec(str); - if ( res[0] != str ) { - throw "'" + str + "' is not a valid time"; - } - var obj = Date.parse(str); - if (! obj) { - throw "'" + str + "' is not a valid time"; - } - return obj; -}; - -/* - * Left-pad provided arg 1 with zeroes until reaching size provided by second - * argument. - * - * @param {Number|String} str value to pad - * @param {Number} size size to reach on the final padded value - * @returns {String} padded string - */ -var zpad = function(str, size) { - str = "" + str; - return new Array(size - str.length + 1).join('0') + str; -}; - -/** - * Converts a Date javascript object to a string using OpenERP's - * datetime string format (exemple: '2011-12-01 15:12:35'). - * - * The timezone of the Date object is assumed to be the one of the - * browser and it will be converted to UTC (standard for OpenERP 6.1). - * - * @param {Date} obj - * @returns {String} A string representing a datetime. - */ -openerp.base.format_datetime = function(obj) { - if (!obj) { - return false; - } - return zpad(obj.getUTCFullYear(),4) + "-" + zpad(obj.getUTCMonth() + 1,2) + "-" - + zpad(obj.getUTCDate(),2) + " " + zpad(obj.getUTCHours(),2) + ":" - + zpad(obj.getUTCMinutes(),2) + ":" + zpad(obj.getUTCSeconds(),2); -}; - -/** - * Converts a Date javascript object to a string using OpenERP's - * date string format (exemple: '2011-12-01'). - * - * @param {Date} obj - * @returns {String} A string representing a date. - */ -openerp.base.format_date = function(obj) { - if (!obj) { - return false; - } - return zpad(obj.getFullYear(),4) + "-" + zpad(obj.getMonth() + 1,2) + "-" - + zpad(obj.getDate(),2); -}; - -/** - * Converts a Date javascript object to a string using OpenERP's - * time string format (exemple: '15:12:35'). - * - * @param {Date} obj - * @returns {String} A string representing a time. - */ -openerp.base.format_time = function(obj) { - if (!obj) { - return false; - } - return zpad(obj.getHours(),2) + ":" + zpad(obj.getMinutes(),2) + ":" - + zpad(obj.getSeconds(),2); -}; - -/** * Formats a single atomic value based on a field descriptor * * @param {Object} value read from OpenERP diff --git a/addons/base/static/src/js/list-editable.js b/addons/base/static/src/js/list-editable.js index a8a4e9d78c6..8810d902346 100644 --- a/addons/base/static/src/js/list-editable.js +++ b/addons/base/static/src/js/list-editable.js @@ -1,7 +1,7 @@ /** * @namespace handles editability case for lists, because it depends on form and forms already depends on lists it had to be split out */ -openerp.base.list.editable = function (openerp) { +openerp.base.list_editable = function (openerp) { var KEY_RETURN = 13, KEY_ESCAPE = 27; diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index c6e50de85ec..c5072c13f1b 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -482,7 +482,8 @@ openerp.base.ListView = openerp.base.View.extend( /** @lends openerp.base.ListVi */ do_activate_record: function (index, id, dataset) { var self = this; - this.dataset.read_slice({ + // TODO is it needed ? + this.dataset.read_slice([],{ context: dataset.get_context(), domain: dataset.get_domain() }, function () { @@ -1039,11 +1040,9 @@ openerp.base.ListView.Groups = openerp.base.Class.extend( /** @lends openerp.bas d = new $.Deferred(), page = this.datagroup.openable ? this.page : view.page; - dataset.read_slice({ - fields: _.pluck(_.select(this.columns, function(x) {return x.tag == "field"}), 'name'), - offset: page * limit, - limit: limit - }, function (records) { + var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field"}), 'name'); + var options = { offset: page * limit, limit: limit }; + dataset.read_slice(fields, options , function (records) { if (!self.datagroup.openable) { view.configure_pager(dataset); } else { diff --git a/addons/base/static/src/js/view_tree.js b/addons/base/static/src/js/view_tree.js index 5c3c7457e1c..59544a998b3 100644 --- a/addons/base/static/src/js/view_tree.js +++ b/addons/base/static/src/js/view_tree.js @@ -72,7 +72,7 @@ openerp.base.TreeView = openerp.base.View.extend({ 'toolbar': has_toolbar })); - this.dataset.read_slice({fields: this.fields_list()}, function (records) { + this.dataset.read_slice(this.fields_list(), {}, function (records) { if (!has_toolbar) { // WARNING: will do a second read on the same ids, but only on // first load so not very important diff --git a/addons/base/static/src/js/views.js b/addons/base/static/src/js/views.js index f21c6387d32..cb9b7d364cf 100644 --- a/addons/base/static/src/js/views.js +++ b/addons/base/static/src/js/views.js @@ -17,6 +17,7 @@ openerp.base.ActionManager = openerp.base.Widget.extend({ this.dialog = null; this.dialog_viewmanager = null; this.client_widget = null; + this.url = {} }, render: function() { return "<div id='"+this.element_id+"'></div>"; @@ -29,11 +30,37 @@ openerp.base.ActionManager = openerp.base.Widget.extend({ this.dialog = null; } }, - inner_stop: function () { + content_stop: function () { if (this.inner_viewmanager) { this.inner_viewmanager.stop(); this.inner_viewmanager = null; } + if (this.client_widget) { + this.client_widget.stop(); + this.client_widget = null; + } + }, + url_update: function(action) { + // this.url = { + // "model": action.model, + // "domain": action.domain, + // }; + // action.res_model + // action.domain + // action.context + // after + // action.views + // action.res_id + // mode + // menu + }, + url_stringify: function(action) { + }, + url_parse: function(action) { + }, + on_url_update: function(url) { + }, + do_url_action: function(url) { }, do_action: function(action, on_close) { var type = action.type.replace(/\./g,'_'); @@ -66,9 +93,10 @@ openerp.base.ActionManager = openerp.base.Widget.extend({ this.dialog.open(); } else { this.dialog_stop(); - this.inner_stop(); + this.content_stop(); this.inner_viewmanager = new openerp.base.ViewManagerAction(this, action); this.inner_viewmanager.appendTo(this.$element); + this.url_update(action); } /* new window code this.rpc("/base/session/save_session_action", { the_action : action}, function(key) { @@ -90,8 +118,9 @@ openerp.base.ActionManager = openerp.base.Widget.extend({ }); }, ir_actions_client: function (action) { - this.client_widget = openerp.base.client_actions.get_object(action.tag); - new this.client_widget(this, this.element_id, action.params).start(); + this.content_stop(); + var ClientWidget = openerp.base.client_actions.get_object(action.tag); + (this.client_widget = new ClientWidget(this, action.params)).appendTo(this); } }); diff --git a/addons/base/static/src/xml/base.xml b/addons/base/static/src/xml/base.xml index d67699ac145..c4396793f95 100644 --- a/addons/base/static/src/xml/base.xml +++ b/addons/base/static/src/xml/base.xml @@ -67,7 +67,7 @@ <li id="back-to-login">Back to Login</li> </ul> </t> -<t t-name="CreateDB"> +<t t-name="Database.CreateDB"> <form name="create_db_form" class="oe_forms" method="POST"> <table width="100%"> <tr> @@ -79,8 +79,7 @@ <table align="center" class="db_option_table"> <tr> <td><label for="super_admin_pwd">Master password:</label></td> - <td><input type="password" name="super_admin_pwd" - class="required" autofocus="autofocus"/></td> + <td><input type="password" name="super_admin_pwd" class="required" value="admin"/></td> </tr> <tr> <td><label for="db_name">New database name:</label></td> @@ -95,9 +94,7 @@ <td> <select name="db_lang" t-if="lang_list"> <t t-foreach="lang_list" t-as="lang"> - <option t-att-value="lang[0]" - t-att-selected="lang[0] === 'en_US' ? 'selected' : undefined"> - <t t-esc="lang[1]"/></option> + <option t-att-value="lang[0]" t-att-selected="lang[0] === 'en_US' ? 'selected' : undefined"><t t-esc="lang[1]"/></option> </t> </select> </td> @@ -367,7 +364,6 @@ t-att-data-shortcut-id="shortcut.id" ><t t-esc="shortcut.name"/></li> </ul> - <t t-name="Menu"> <table align="center"> <tr> @@ -788,7 +784,16 @@ <div t-att-id="widget.list_id"></div> </t> <t t-name="FieldReference"> - <input type="text" t-att-name="widget.name" t-att-id="widget.element_id" t-att-class="'field_' + widget.type" style="width: 100%" placeholder="Widget Reference"/> + <table border="0" width="100%" cellpadding="0" cellspacing="0" class="oe_frame oe_forms"> + <tr> + <td t-att-id="widget.selection.element_id" class="oe_form_frame_cell oe_form_selection"> + <t t-raw="widget.selection.render()"/> + </td> + <td t-att-id="widget.m2o.element_id" class="oe_form_frame_cell oe_form_many2one" nowrap="true"> + <t t-raw="widget.m2o.render()"/> + </td> + </tr> + </table> </t> <t t-name="FieldBoolean"> <input type="checkbox" @@ -1170,7 +1175,6 @@ <t t-name="ExportView"> <a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a> </t> - <t t-name="ExportTreeView"> <table class="view" style="background-color: #F3F3F3;"> <tr> |
