From 6da197456fb232f669faa436439524254e6093b6 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 8 Apr 2011 12:37:36 +0200 Subject: [PATCH] [FIX] warnings & stuff, unbreak unlink notification on dataset bzr revid: xmo@openerp.com-20110408103736-i8kju5dippuw9af4 --- addons/base/static/src/base.html | 2 +- addons/base/static/src/js/data.js | 8 ++++---- addons/base/static/src/js/form.js | 17 ++++++++++------- addons/base/static/src/js/list.js | 2 -- addons/base/static/src/js/views.js | 26 +++++++++++++------------- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/addons/base/static/src/base.html b/addons/base/static/src/base.html index f8c700946f3..3c8f76a6e23 100644 --- a/addons/base/static/src/base.html +++ b/addons/base/static/src/base.html @@ -3,7 +3,7 @@ OpenERP - + diff --git a/addons/base/static/src/js/data.js b/addons/base/static/src/js/data.js index 1e96dde23fc..8f5d6168e75 100644 --- a/addons/base/static/src/js/data.js +++ b/addons/base/static/src/js/data.js @@ -99,7 +99,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base. context: this.context }, callback); }, - unlink: function() { + unlink: function(ids) { this.notification['default']("Unlink", ids); }, call: function (method, ids, args, callback) { @@ -111,7 +111,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base. ids: ids, args: args }, callback); - }, + } }); openerp.base.DataSetStatic = openerp.base.DataSet.extend({ @@ -123,7 +123,7 @@ openerp.base.DataSetStatic = openerp.base.DataSet.extend({ }, read_slice: function (fields, offset, limit, callback) { this.read_ids(this.ids.slice(offset, offset + limit)); - }, + } }); openerp.base.DataSetSearch = openerp.base.DataSet.extend({ @@ -163,7 +163,7 @@ openerp.base.DataSetSearch = openerp.base.DataSet.extend({ } callback(records); }); - }, + } }); openerp.base.DataSetRelational = openerp.base.DataSet.extend( /** @lends openerp.base.DataSet# */{ diff --git a/addons/base/static/src/js/form.js b/addons/base/static/src/js/form.js index ff04f55314b..c5b45f5c870 100644 --- a/addons/base/static/src/js/form.js +++ b/addons/base/static/src/js/form.js @@ -140,7 +140,7 @@ openerp.base.FormView = openerp.base.Controller.extend( /** @lends openerp.base var ajax = { url: '/base/dataset/call', async: false - } + }; return this.rpc(ajax, { model: this.dataset.model, method: method, @@ -212,7 +212,7 @@ openerp.base.FormView = openerp.base.Controller.extend( /** @lends openerp.base if (invalid) { this.on_invalid(); } else { - this.log("About to save", values) + this.log("About to save", values); this.dataset.write(this.datarecord.id, values, this.on_saved); } }, @@ -244,8 +244,13 @@ openerp.base.FormView = openerp.base.Controller.extend( /** @lends openerp.base } }, do_search: function (domains, contexts, groupbys) { + this.notification['default']("Searching form"); }, on_action: function (action) { + this.notification['default']('Executing action ' + action); + }, + do_cancel: function () { + this.notification['default']("Cancelling form"); } }); @@ -698,7 +703,7 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({ }, set_value: function(value) { this._super.apply(this, arguments); - var show_value = '' + var show_value = ''; if (value != null && value !== false) { show_value = value[1]; this.value = value[0]; @@ -713,17 +718,15 @@ openerp.base.form.FieldOne2ManyDatasSet = openerp.base.DataSetStatic.extend({ write: function (id, data, callback) { this._super(id, data, callback); }, - write: function (id, data, callback) { - this._super(id, data, callback); - }, unlink: function() { + this.notification['default']('Unlinking o2m ' + this.ids); } }); openerp.base.form.FieldOne2ManyViewManager = openerp.base.ViewManager.extend({ init: function(session, element_id, dataset, views) { this._super(session, element_id, dataset, views); - }, + } }); openerp.base.form.FieldOne2Many = openerp.base.form.Field.extend({ diff --git a/addons/base/static/src/js/list.js b/addons/base/static/src/js/list.js index 533ff0d9deb..da52bd75138 100644 --- a/addons/base/static/src/js/list.js +++ b/addons/base/static/src/js/list.js @@ -83,7 +83,6 @@ openerp.base.ListView = openerp.base.Controller.extend( * @returns {Promise} promise to the end of view rendering (list views are asynchronously filled for improved responsiveness) */ do_fill_table: function(records) { - console.log("listview do_fill",records) this.rows = records; var $table = this.$element.find('table'); @@ -148,7 +147,6 @@ openerp.base.ListView = openerp.base.Controller.extend( }, do_search: function (domains, contexts, groupbys) { var self = this; - console.log("listview do_search",domains) this.rpc('/base/session/eval_domain_and_context', { domains: domains, contexts: contexts, diff --git a/addons/base/static/src/js/views.js b/addons/base/static/src/js/views.js index 6adc0fc3d38..2b7d0abde45 100644 --- a/addons/base/static/src/js/views.js +++ b/addons/base/static/src/js/views.js @@ -141,7 +141,6 @@ openerp.base.ViewManagerAction = openerp.base.ViewManager.extend({ this.sidebar = new openerp.base.Sidebar(null, this); }, start: function() { - var self = this; var inital_view_loaded = this._super(); // init sidebar @@ -173,29 +172,30 @@ openerp.base.ViewManagerAction = openerp.base.ViewManager.extend({ this.sidebar.stop(); } this._super(); - }, + } }); openerp.base.BaseWidget = openerp.base.Controller.extend({ /** - * The name of the QWeb template that will be used for rendering. Must be redifined - * in subclasses or the render() method can not be used. + * The name of the QWeb template that will be used for rendering. Must be + * redefined in subclasses or the render() method can not be used. * * @type string */ template: null, /** - * The prefix used to generate an id automatically. Should be redifined in subclasses. - * If it is not defined, a default identifier will be used. + * The prefix used to generate an id automatically. Should be redefined in + * subclasses. If it is not defined, a default identifier will be used. * * @type string */ identifier_prefix: 'generic-identifier', /** - * Base class for widgets. Handle rendering (based on a QWeb template), identifier - * generation, parenting and destruction of the widget. - * Contructor. Also initialize the identifier. - * + * Base class for widgets. Handle rendering (based on a QWeb template), + * identifier generation, parenting and destruction of the widget. + * Also initialize the identifier. + * + * @constructs * @params {openerp.base.search.BaseWidget} parent The parent widget. */ init: function (parent, session) { @@ -242,8 +242,8 @@ openerp.base.BaseWidget = openerp.base.Controller.extend({ this._super(); }, /** - * Set the parent of this component, also unregister the previous parent if there - * was one. + * Set the parent of this component, also un-register the previous parent + * if there was one. * * @param {openerp.base.BaseWidget} parent The new parent. */ @@ -289,7 +289,7 @@ openerp.base.Sidebar = openerp.base.BaseWidget.extend({ this.$element.html(QWeb.render("ViewManager.sidebar.internal", _.extend({_:_}, this))); var self = this; this.$element.find("a").click(function(e) { - $this = jQuery(this); + var $this = jQuery(this); var i = $this.attr("data-i"); var j = $this.attr("data-i"); var action = self.sections[i].elements[j];