[FIX] warnings & stuff, unbreak unlink notification on dataset
bzr revid: xmo@openerp.com-20110408103736-i8kju5dippuw9af4
This commit is contained in:
parent
340e9f8b2c
commit
6da197456f
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>OpenERP</title>
|
||||
<link rel="shortcut icon" href="/base/static/openerp/img/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="/base/static/src/img/favicon.ico" type="image/x-icon"/>
|
||||
|
||||
<script type="text/javascript" src="/base/static/lib/LABjs/LAB.js"></script>
|
||||
<script type="text/javascript" src="/base/static/lib/underscore/underscore.js"></script>
|
||||
|
|
|
@ -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# */{
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue