[ADD] add basic directory structure of kanban view.
bzr revid: ysa@tinyerp.com-20110728095152-l8g2zqqro2mkr7ne
This commit is contained in:
parent
556d06c65b
commit
2b46bc9925
|
@ -0,0 +1 @@
|
|||
import controllers
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name" : "Base Kanban",
|
||||
"version" : "2.0",
|
||||
"depends" : ["base"],
|
||||
"js": [
|
||||
"static/src/js/kanban.js"
|
||||
],
|
||||
"css": [],
|
||||
'active': True
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
import main
|
|
@ -0,0 +1,11 @@
|
|||
from base.controllers.main import View
|
||||
import openerpweb
|
||||
|
||||
class KanbanView(View):
|
||||
_cp_path = "/base_kanban/kanbanview"
|
||||
|
||||
@openerpweb.jsonrequest
|
||||
def load(self, req, model, view_id):
|
||||
fields_view = self.fields_view_get(req, model, view_id, 'kanban')
|
||||
all_fields = req.session.model(model).fields_get()
|
||||
return {'fields_view': fields_view, 'all_fields':all_fields}
|
|
@ -0,0 +1,30 @@
|
|||
openerp.base_kanban = function (openerp) {
|
||||
openerp.base.views.add('kanban', 'openerp.base_kanban.KanbanView');
|
||||
openerp.base_kanban.KanbanView = openerp.base.View.extend({
|
||||
|
||||
init: function(parent, element_id, dataset, view_id) {
|
||||
this._super(parent, element_id);
|
||||
this.view_manager = parent;
|
||||
this.dataset = dataset;
|
||||
this.model = this.dataset.model;
|
||||
this.view_id = view_id;
|
||||
},
|
||||
|
||||
start: function() {
|
||||
this.rpc("/base_kanban/kanbanview/load",
|
||||
{"model": this.model, "view_id": this.view_id}, this.on_loaded);
|
||||
},
|
||||
|
||||
on_loaded: function(data) {
|
||||
var template_xml = '';
|
||||
_.each(data.fields_view.arch.children, function(child) {
|
||||
if (child.tag == "template"){
|
||||
template_xml = openerp.base.json_node_to_xml(child, true)
|
||||
}
|
||||
});
|
||||
console.log(":template_xml:::",template_xml);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
|
Loading…
Reference in New Issue