[imp] modified kanban to be used in a o2m

bzr revid: nicolas.vanhoren@openerp.com-20120405161404-0czrls5qe9bk0hhf
This commit is contained in:
niv-openerp
2012-04-05 18:14:04 +02:00
parent 9834565c65
commit 298ef40999
2 changed files with 4 additions and 10 deletions
+1
View File
@@ -78,6 +78,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
}, this);
this.ordinate = this.columns[0].name;
this.is_loaded.resolve();
return $.when();
},
schedule_chart: function(results) {
var self = this;
+3 -10
View File
@@ -9,6 +9,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
template: "KanbanView",
display_name: _lt('Kanban'),
default_nr_columns: 3,
view_type: "kanban",
init: function (parent, dataset, view_id, options) {
this._super(parent);
this.set_default_options(options);
@@ -34,22 +35,14 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
this.currently_dragging = {};
this.limit = options.limit || 80;
},
start: function() {
on_loaded: function(data) {
this.$element.find('button.oe_kanban_button_new').click(this.do_add_record);
this.$groups = this.$element.find('.oe_kanban_groups tr');
var context = new openerp.web.CompoundContext(this.dataset.get_context());
return this.rpc('/web/view/load', {
'model': this.dataset.model,
'view_id': this.view_id,
'view_type': 'kanban',
context: context
}, this.on_loaded);
},
on_loaded: function(data) {
this.fields_view = data;
this.fields_keys = _.keys(this.fields_view.fields);
this.add_qweb_template();
this.has_been_loaded.resolve();
return $.when();
},
add_qweb_template: function() {
for (var i=0, ii=this.fields_view.arch.children.length; i < ii; i++) {