- ![]()
+
|
diff --git a/addons/base_diagram/__init__.py b/addons/web_diagram/__init__.py
similarity index 100%
rename from addons/base_diagram/__init__.py
rename to addons/web_diagram/__init__.py
diff --git a/addons/web_diagram/__openerp__.py b/addons/web_diagram/__openerp__.py
new file mode 100644
index 00000000000..c1851af362b
--- /dev/null
+++ b/addons/web_diagram/__openerp__.py
@@ -0,0 +1,16 @@
+{
+ "name" : "OpenERP Web Diagram",
+ "version" : "2.0",
+ "depends" : ["base"],
+ "js": [
+ 'static/lib/js/raphael-min.js',
+ 'static/lib/js/dracula_graffle.js',
+ 'static/lib/js/dracula_graph.js',
+ 'static/lib/js/dracula_algorithms.js',
+ 'static/src/js/diagram.js'
+ ],
+ 'css' : [
+ "static/src/css/base_diagram.css",
+ ],
+ 'active': True,
+}
diff --git a/addons/base_diagram/controllers/__init__.py b/addons/web_diagram/controllers/__init__.py
similarity index 100%
rename from addons/base_diagram/controllers/__init__.py
rename to addons/web_diagram/controllers/__init__.py
diff --git a/addons/base_diagram/controllers/main.py b/addons/web_diagram/controllers/main.py
similarity index 82%
rename from addons/base_diagram/controllers/main.py
rename to addons/web_diagram/controllers/main.py
index 8e258810eca..c443b048ea6 100644
--- a/addons/base_diagram/controllers/main.py
+++ b/addons/web_diagram/controllers/main.py
@@ -1,62 +1,52 @@
-import base.common as openerpweb
-from base.controllers.main import View
+import web.common as openerpweb
+from web.controllers.main import View
class DiagramView(View):
- _cp_path = "/base_diagram/diagram"
+ _cp_path = "/web_diagram/diagram"
@openerpweb.jsonrequest
def load(self, req, model, view_id):
- print req
- print dir(req)
fields_view = self.fields_view_get(req, model, view_id, 'diagram')
return {'fields_view': fields_view}
-
+
@openerpweb.jsonrequest
- def get_diagram_info(self, req, **kw):
- id = kw['id']
- model = kw['model']
- node = kw['node']
- connector = kw['connector']
- src_node = kw['src_node']
- des_node = kw['des_node']
-
+ def get_diagram_info(self, req, id, model, node, connector, src_node, des_node, **kw):
+
visible_node_fields = kw.get('visible_node_fields',[])
invisible_node_fields = kw.get('invisible_node_fields',[])
node_fields_string = kw.get('node_fields_string',[])
connector_fields = kw.get('connector_fields',[])
connector_fields_string = kw.get('connector_fields_string',[])
-
+
bgcolors = {}
shapes = {}
bgcolor = kw.get('bgcolor','')
shape = kw.get('shape','')
-
+
if bgcolor:
for color_spec in bgcolor.split(';'):
if color_spec:
colour, color_state = color_spec.split(':')
bgcolors[colour] = color_state
-
+
if shape:
for shape_spec in shape.split(';'):
if shape_spec:
shape_colour, shape_color_state = shape_spec.split(':')
shapes[shape_colour] = shape_color_state
-
+
ir_view = req.session.model('ir.ui.view')
- graphs = ir_view.graph_get(id, model, node, connector, src_node, des_node, False,
+ graphs = ir_view.graph_get(int(id), model, node, connector, src_node, des_node, False,
(140, 180), req.session.context)
-
nodes = graphs['nodes']
transitions = graphs['transitions']
isolate_nodes = {}
-
- for node in graphs['blank_nodes']:
- isolate_nodes[node['id']] = node
+ for blnk_node in graphs['blank_nodes']:
+ isolate_nodes[blnk_node['id']] = blnk_node
else:
y = map(lambda t: t['y'],filter(lambda x: x['y'] if x['x']==20 else None, nodes.values()))
y_max = (y and max(y)) or 120
-
+
connectors = {}
list_tr = []
@@ -69,29 +59,29 @@ class DiagramView(View):
})
connector_tr = req.session.model(connector)
connector_ids = connector_tr.search([('id', 'in', list_tr)], 0, 0, 0, req.session.context)
-
+
data_connectors =connector_tr.read(connector_ids, connector_fields, req.session.context)
-
-
+
+
for tr in data_connectors:
t = connectors.get(str(tr['id']))
t.update({
'source': tr[src_node][1],
'destination': tr[des_node][1],
- 'options': {}
+ 'options': {},
+ 'signal': tr['signal']
})
for i, fld in enumerate(connector_fields):
t['options'][connector_fields_string[i]] = tr[fld]
-
+
fields = req.session.model('ir.model.fields')
field_ids = fields.search([('model', '=', model), ('relation', '=', node)], 0, 0, 0, req.session.context)
field_data = fields.read(field_ids, ['relation_field'], req.session.context)
-
node_act = req.session.model(node)
search_acts = node_act.search([(field_data[0]['relation_field'], '=', id)], 0, 0, 0, req.session.context)
data_acts = node_act.read(search_acts, invisible_node_fields + visible_node_fields, req.session.context)
-
+
for act in data_acts:
n = nodes.get(str(act['id']))
if not n:
@@ -116,7 +106,7 @@ class DiagramView(View):
for i, fld in enumerate(visible_node_fields):
n['options'][node_fields_string[i]] = act[fld]
-
+
#to relate m2o field of transition to corresponding o2m in activity
in_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', des_node), ('model', '=', node)], 0, 0, 0, req.session.context)
in_transition_field = fields.read(in_transition_field_id[0], ['name'], req.session.context)['name']
@@ -124,4 +114,5 @@ class DiagramView(View):
out_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', src_node), ('model', '=', node)], 0, 0, 0, req.session.context)
out_transition_field = fields.read(out_transition_field_id[0], ['name'], req.session.context)['name']
- return dict(nodes=nodes, conn=connectors, in_transition_field=in_transition_field, out_transition_field=out_transition_field)
+ id_model = req.session.model(model).read([id],['name'], req.session.context)[0]['name']
+ return dict(nodes=nodes, conn=connectors, id_model = id_model)
diff --git a/addons/base_diagram/po/base_diagram.pot b/addons/web_diagram/po/base_diagram.pot
similarity index 100%
rename from addons/base_diagram/po/base_diagram.pot
rename to addons/web_diagram/po/base_diagram.pot
diff --git a/addons/web_diagram/po/web_diagram.pot b/addons/web_diagram/po/web_diagram.pot
new file mode 100644
index 00000000000..3fb8462aff3
--- /dev/null
+++ b/addons/web_diagram/po/web_diagram.pot
@@ -0,0 +1,55 @@
+# Translations template for PROJECT.
+# Copyright (C) 2011 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# FIRST AUTHOR , 2011.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2011-09-06 12:02+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "New Node"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "New Edge"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "Show Grid:"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "First"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "<<"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "0"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "/"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid ">>"
+msgstr ""
+
+#: addons/web_diagram/static/src/xml/base_diagram.xml:0
+msgid "Last"
+msgstr ""
+
diff --git a/addons/base_diagram/static/lib/js/Curry-1.0.1.js b/addons/web_diagram/static/lib/js/Curry-1.0.1.js
similarity index 100%
rename from addons/base_diagram/static/lib/js/Curry-1.0.1.js
rename to addons/web_diagram/static/lib/js/Curry-1.0.1.js
diff --git a/addons/base_diagram/static/lib/js/dracula_algorithms.js b/addons/web_diagram/static/lib/js/dracula_algorithms.js
similarity index 100%
rename from addons/base_diagram/static/lib/js/dracula_algorithms.js
rename to addons/web_diagram/static/lib/js/dracula_algorithms.js
diff --git a/addons/base_diagram/static/lib/js/dracula_graffle.js b/addons/web_diagram/static/lib/js/dracula_graffle.js
similarity index 100%
rename from addons/base_diagram/static/lib/js/dracula_graffle.js
rename to addons/web_diagram/static/lib/js/dracula_graffle.js
diff --git a/addons/base_diagram/static/lib/js/dracula_graph.coffee b/addons/web_diagram/static/lib/js/dracula_graph.coffee
similarity index 100%
rename from addons/base_diagram/static/lib/js/dracula_graph.coffee
rename to addons/web_diagram/static/lib/js/dracula_graph.coffee
diff --git a/addons/base_diagram/static/lib/js/dracula_graph.js b/addons/web_diagram/static/lib/js/dracula_graph.js
similarity index 96%
rename from addons/base_diagram/static/lib/js/dracula_graph.js
rename to addons/web_diagram/static/lib/js/dracula_graph.js
index f7069c5d2e5..df9945882a7 100644
--- a/addons/base_diagram/static/lib/js/dracula_graph.js
+++ b/addons/web_diagram/static/lib/js/dracula_graph.js
@@ -58,7 +58,7 @@ var Graph = function() {
this.edgeFactory = new EdgeFactory();
};
Graph.prototype = {
- /*
+ /*
* add a node
* @id the node's ID (string or number)
* @content (optional, dictionary) can contain any information that is
@@ -83,7 +83,7 @@ Graph.prototype = {
// NOTE: Even directed edges are added to both nodes.
t.edges.push(edge);
},
-
+
/* TODO to be implemented
* Preserve a copy of the graph state (nodes, positions, ...)
* @comment a comment describing the state
@@ -154,19 +154,21 @@ Graph.Renderer.Raphael = function(element, graph, width, height) {
return;
}
}
-
+
/*
* Dragging
*/
this.isDrag = false;
this.dragger = function (e) {
- this.dx = e.clientX;
- this.dy = e.clientY;
- selfRef.isDrag = this;
- this.set && this.set.animate({"fill-opacity": .1}, 200) && this.set.toFront();
- e.preventDefault && e.preventDefault();
+ if(e.detail < 2) {
+ this.dx = e.clientX;
+ this.dy = e.clientY;
+ selfRef.isDrag = this;
+ this.set && this.set.animate({"fill-opacity": .1}, 200) && this.set.toFront();
+ e.preventDefault && e.preventDefault();
+ }
};
-
+
var d = document.getElementById(element);
d.onmousemove = function (e) {
e = e || window.event;
@@ -234,7 +236,7 @@ Graph.Renderer.Raphael.prototype = {
var shape;
- /* if a node renderer function is provided by the user, then use it
+ /* if a node renderer function is provided by the user, then use it
or the default render function instead */
if(!node.render) {
node.render = function(r, node) {
@@ -305,7 +307,7 @@ Graph.Layout.Spring.prototype = {
}
this.layoutCalcBounds();
},
-
+
layoutPrepare: function() {
for (i in this.graph.nodes) {
var node = this.graph.nodes[i];
@@ -314,16 +316,16 @@ Graph.Layout.Spring.prototype = {
node.layoutForceX = 0;
node.layoutForceY = 0;
}
-
+
},
-
+
layoutCalcBounds: function() {
var minx = Infinity, maxx = -Infinity, miny = Infinity, maxy = -Infinity;
for (i in this.graph.nodes) {
var x = this.graph.nodes[i].layoutPosX;
var y = this.graph.nodes[i].layoutPosY;
-
+
if(x > maxx) maxx = x;
if(x < minx) minx = x;
if(y > maxy) maxy = y;
@@ -335,7 +337,7 @@ Graph.Layout.Spring.prototype = {
this.graph.layoutMinY = miny;
this.graph.layoutMaxY = maxy;
},
-
+
layoutIteration: function() {
// Forces on nodes due to node-node repulsions
@@ -345,17 +347,17 @@ Graph.Layout.Spring.prototype = {
for (var d in prev) {
var node2 = this.graph.nodes[prev[d]];
this.layoutRepulsive(node1, node2);
-
+
}
prev.push(c);
}
-
+
// Forces on nodes due to edge attractions
for (var i = 0; i < this.graph.edges.length; i++) {
var edge = this.graph.edges[i];
- this.layoutAttractive(edge);
+ this.layoutAttractive(edge);
}
-
+
// Move by the given force
for (i in this.graph.nodes) {
var node = this.graph.nodes[i];
@@ -367,7 +369,7 @@ Graph.Layout.Spring.prototype = {
if(xmove < -max) xmove = -max;
if(ymove > max) ymove = max;
if(ymove < -max) ymove = -max;
-
+
node.layoutPosX += xmove;
node.layoutPosY += ymove;
node.layoutForceX = 0;
@@ -397,7 +399,7 @@ Graph.Layout.Spring.prototype = {
layoutAttractive: function(edge) {
var node1 = edge.source;
var node2 = edge.target;
-
+
var dx = node2.layoutPosX - node1.layoutPosX;
var dy = node2.layoutPosY - node1.layoutPosY;
var d2 = dx * dx + dy * dy;
@@ -414,7 +416,7 @@ Graph.Layout.Spring.prototype = {
var attractiveForce = (d2 - this.k * this.k) / this.k;
if(edge.attraction == undefined) edge.attraction = 1;
attractiveForce *= Math.log(edge.attraction) * 0.5 + 1;
-
+
node2.layoutForceX -= attractiveForce * dx / d;
node2.layoutForceY -= attractiveForce * dy / d;
node1.layoutForceX += attractiveForce * dx / d;
@@ -432,7 +434,7 @@ Graph.Layout.Ordered.prototype = {
this.layoutPrepare();
this.layoutCalcBounds();
},
-
+
layoutPrepare: function(order) {
for (i in this.graph.nodes) {
var node = this.graph.nodes[i];
@@ -447,14 +449,14 @@ Graph.Layout.Ordered.prototype = {
counter++;
}
},
-
+
layoutCalcBounds: function() {
var minx = Infinity, maxx = -Infinity, miny = Infinity, maxy = -Infinity;
for (i in this.graph.nodes) {
var x = this.graph.nodes[i].layoutPosX;
var y = this.graph.nodes[i].layoutPosY;
-
+
if(x > maxx) maxx = x;
if(x < minx) minx = x;
if(y > maxy) maxy = y;
@@ -470,7 +472,7 @@ Graph.Layout.Ordered.prototype = {
};
/*
- * usefull JavaScript extensions,
+ * usefull JavaScript extensions,
*/
function log(a) {console.log&&console.log(a);}
@@ -491,14 +493,14 @@ Raphael.el.tooltip = function (tp) {
this.tp.o = {x: 0, y: 0};
this.tp.hide();
this.hover(
- function(event){
- this.mousemove(function(event){
- this.tp.translate(event.clientX -
+ function(event){
+ this.mousemove(function(event){
+ this.tp.translate(event.clientX -
this.tp.o.x,event.clientY - this.tp.o.y);
this.tp.o = {x: event.clientX, y: event.clientY};
});
this.tp.show().toFront();
- },
+ },
function(event){
this.tp.hide();
this.unmousemove();
diff --git a/addons/base_diagram/static/lib/js/raphael-min.js b/addons/web_diagram/static/lib/js/raphael-min.js
similarity index 100%
rename from addons/base_diagram/static/lib/js/raphael-min.js
rename to addons/web_diagram/static/lib/js/raphael-min.js
diff --git a/addons/base_diagram/static/lib/js/seedrandom.js b/addons/web_diagram/static/lib/js/seedrandom.js
similarity index 100%
rename from addons/base_diagram/static/lib/js/seedrandom.js
rename to addons/web_diagram/static/lib/js/seedrandom.js
diff --git a/addons/web_diagram/static/src/css/base_diagram.css b/addons/web_diagram/static/src/css/base_diagram.css
new file mode 100644
index 00000000000..9ba2f6b0c83
--- /dev/null
+++ b/addons/web_diagram/static/src/css/base_diagram.css
@@ -0,0 +1,18 @@
+.openerp .diagram {
+ border: 1px solid #999;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+}
+
+.openerp .show_grid {
+ background: url("/web_diagram/static/src/img/grid.jpg") repeat;
+}
+
+.openerp .oe_diagram_pager {
+ text-align: right;
+ white-space: nowrap;
+}
+
+.openerp .oe_diagram_buttons {
+ float: left;
+}
diff --git a/addons/web_diagram/static/src/img/grid.jpg b/addons/web_diagram/static/src/img/grid.jpg
new file mode 100644
index 00000000000..5254207b964
Binary files /dev/null and b/addons/web_diagram/static/src/img/grid.jpg differ
diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js
new file mode 100644
index 00000000000..d46aadde68f
--- /dev/null
+++ b/addons/web_diagram/static/src/js/diagram.js
@@ -0,0 +1,295 @@
+/*---------------------------------------------------------
+ * OpenERP diagram library
+ *---------------------------------------------------------*/
+
+openerp.web_diagram = function (openerp) {
+QWeb.add_template('/web_diagram/static/src/xml/base_diagram.xml');
+openerp.web.views.add('diagram', 'openerp.web.DiagramView');
+openerp.web.DiagramView = openerp.web.View.extend({
+ searchable: false,
+ init: function(parent, element_id, dataset, view_id, options) {
+ this._super(parent, element_id);
+ this.set_default_options(options);
+ this.view_manager = parent;
+ this.dataset = dataset;
+ this.model = this.dataset.model;
+ this.view_id = view_id;
+ this.domain = this.dataset._domain || [];
+ this.context = {};
+ this.ids = this.dataset.ids;
+ },
+ start: function() {
+ return this.rpc("/web_diagram/diagram/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded);
+ },
+
+ toTitleCase: function(str) {
+ return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
+ },
+
+ on_loaded: function(result) {
+
+ var self = this;
+ if(this.ids && this.ids.length) {
+ this.id = this.ids[self.dataset.index || 0];
+ }
+
+ this.fields_view = result.fields_view,
+ this.view_id = this.fields_view.view_id,
+ this.fields = this.fields_view.fields,
+ this.nodes = this.fields_view.arch.children[0],
+ this.connectors = this.fields_view.arch.children[1],
+ this.node = this.nodes.attrs.object,
+ this.connector = this.connectors.attrs.object;
+
+ this.$element.html(QWeb.render("DiagramView", this));
+
+ this.$element.find('div.oe_diagram_pager button[data-pager-action]').click(function() {
+ var action = $(this).data('pager-action');
+ self.on_pager_action(action);
+ });
+
+ this.do_update_pager();
+
+ // New Node,Edge
+ this.$element.find('#new_node.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.node);});
+ this.$element.find('#new_edge.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.connector);});
+
+ this.$element.find('#toggle_grid').click(function() {
+ self.$element.find('.diagram').toggleClass('show_grid');
+ });
+
+ if(this.id) {
+ self.get_diagram_info();
+ }
+
+ },
+
+ get_diagram_info: function() {
+ var self = this;
+ var params = {
+ 'id': this.id,
+ 'model': this.model,
+ 'node': this.node,
+ 'connector': this.connector,
+ 'bgcolor': this.nodes.attrs.bgcolor,
+ 'shape': this.nodes.attrs.shape,
+ 'src_node': this.connectors.attrs.source,
+ 'des_node': this.connectors.attrs.destination,
+ 'visible_nodes': [],
+ 'invisible_nodes': [],
+ 'node_fields': [],
+ 'connectors': [],
+ 'connectors_fields': []
+ };
+
+ _.each(this.nodes.children, function(child) {
+ if(child.attrs.invisible == '1')
+ params['invisible_nodes'].push(child.attrs.name);
+ else {
+ params['visible_nodes'].push(child.attrs.name);
+ params['node_fields'].push(self.fields[child.attrs.name]['string']|| this.toTitleCase(child.attrs.name));
+ }
+ });
+
+ _.each(this.connectors.children, function(conn) {
+ params['connectors_fields'].push(self.fields[conn.attrs.name]['string']|| this.toTitleCase(conn.attrs.name));
+ params['connectors'].push(conn.attrs.name);
+ });
+
+ this.rpc(
+ '/web_diagram/diagram/get_diagram_info',params,
+ function(result) {
+ self.draw_diagram(result);
+ }
+ );
+ },
+
+ on_diagram_loaded: function(record) {
+ var id_record = record['id'];
+ if(id_record) {
+ this.id = id_record;
+ this.get_diagram_info();
+ }
+ },
+
+ draw_diagram: function(result) {
+ var diagram = new Graph();
+
+ this.active_model = result['id_model'];
+
+ var res_nodes = result['nodes'];
+ var res_connectors = result['conn'];
+
+ //Custom logic
+ var self = this;
+ var renderer = function(r, n) {
+ var node;
+ var set;
+ var shape = n.node.shape;
+ if(shape == 'rectangle')
+ shape = 'rect';
+ node = r[shape](n.node.x, n.node.y).attr({
+ "fill": n.node.color
+ }).dblclick(function() {
+ self.add_edit_node(n.node.id, self.node);
+ });
+ set = r.set()
+ .push(node)
+ .push(
+ r.text(n.node.x, n.node.y, (n.label || n.id))
+ .attr({"cursor":"pointer"})
+ .dblclick(function() {
+ self.add_edit_node(n.node.id, self.node);
+ })
+ );
+ node.attr({cursor: "pointer"});
+
+ if(shape == "ellipse")
+ node.attr({rx: "40", ry: "20"});
+ else if(shape == 'rect') {
+ node.attr({width: "60", height: "44"});
+ node.next.attr({"text-anchor": "middle", x: n.node.x + 20, y: n.node.y + 20});
+ }
+ return set;
+ };
+
+ _.each(res_nodes, function(res_node) {
+ diagram.addNode(res_node['name'],{node: res_node,render: renderer});
+ });
+
+ // Id for Path(Edges)
+ var edge_ids = [];
+
+ _.each(res_connectors, function(connector, index) {
+ edge_ids.push(index);
+ diagram.addEdge(connector['source'], connector['destination'], {directed : true, label: connector['signal']});
+ });
+
+
+ if ($('div#dia-canvas').children().length > 0) {
+ $('div#dia-canvas').children().remove();
+ }
+
+ var layouter = new Graph.Layout.Ordered(diagram);
+ var render_diagram = new Graph.Renderer.Raphael('dia-canvas', diagram, $('div#dia-canvas').width(), $('div#dia-canvas').height());
+
+ _.each(diagram.edges, function(edge, index) {
+ if(edge.connection) {
+ edge.connection.fg.attr({cursor: "pointer"}).dblclick(function() {
+ self.add_edit_node(edge_ids[index], self.connector);
+ });
+ }
+ });
+ },
+
+ add_edit_node: function(id, model) {
+ var self = this;
+
+ if(!model)
+ model = self.node;
+ if(id)
+ id = parseInt(id, 10);
+ var action_manager = new openerp.web.ActionManager(this);
+ var dialog = new openerp.web.Dialog(this, {
+ width: 800,
+ height: 600,
+ buttons : {
+ Cancel : function() {
+ $(this).dialog('destroy');
+ },
+ Save : function() {
+ var form_view = action_manager.inner_viewmanager.views.form.controller;
+
+ form_view.do_save(function() {
+ self.dataset.read_index(_.keys(self.fields_view.fields), self.on_diagram_loaded);
+ });
+ $(this).dialog('destroy');
+ }
+ }
+ }).start().open();
+ action_manager.appendTo(dialog.$element);
+ action_manager.do_action({
+ res_model : model,
+ res_id: id,
+ views : [[false, 'form']],
+ type : 'ir.actions.act_window',
+ auto_search : false,
+ flags : {
+ search_view: false,
+ sidebar : false,
+ views_switcher : false,
+ action_buttons : false,
+ pager: false
+ }
+ });
+
+ var form_controller = action_manager.inner_viewmanager.views.form.controller;
+
+ var form_fields;
+
+ if(model == self.node) {
+ form_fields = ['wkf_id'];
+ } else {
+ form_fields = ['act_from', 'act_to'];
+ }
+
+ if(model == self.node || id) {
+ $.each(form_fields, function(index, fld) {
+ form_controller.on_record_loaded.add_first(function() {
+ form_controller.fields[fld].modifiers.readonly = true;
+ form_controller.fields[fld].$input.attr('disabled', true);
+ form_controller.fields[fld].$drop_down.unbind();
+ form_controller.fields[fld].$menu_btn.unbind();
+ });
+ });
+ }
+ if(!id && (model == self.node)) {
+ $.each(form_fields, function(index, fld) {
+ form_controller.on_record_loaded.add_last(function() {
+ form_controller.fields[fld].set_value([self.id,self.active_model]);
+ form_controller.fields[fld].dirty = true;
+ });
+ });
+ }
+ },
+
+ on_pager_action: function(action) {
+ switch (action) {
+ case 'first':
+ this.dataset.index = 0;
+ break;
+ case 'previous':
+ this.dataset.previous();
+ break;
+ case 'next':
+ this.dataset.next();
+ break;
+ case 'last':
+ this.dataset.index = this.dataset.ids.length - 1;
+ break;
+ }
+ this.dataset.read_index(_.keys(this.fields_view.fields), this.on_diagram_loaded);
+ this.do_update_pager();
+ },
+
+ do_update_pager: function(hide_index) {
+ var $pager = this.$element.find('div.oe_diagram_pager');
+ var index = hide_index ? '-' : this.dataset.index + 1;
+ if(!this.dataset.count) {
+ this.dataset.count = this.dataset.ids.length;
+ }
+ $pager.find('span.oe_pager_index').html(index);
+ $pager.find('span.oe_pager_count').html(this.dataset.count);
+ },
+
+ do_show: function () {
+ this.$element.show();
+ },
+
+ do_hide: function () {
+ this.$element.hide();
+ }
+});
+};
+
+// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
diff --git a/addons/web_diagram/static/src/xml/base_diagram.xml b/addons/web_diagram/static/src/xml/base_diagram.xml
new file mode 100644
index 00000000000..f57505d81ac
--- /dev/null
+++ b/addons/web_diagram/static/src/xml/base_diagram.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/base_gantt/__init__.py b/addons/web_gantt/__init__.py
similarity index 100%
rename from addons/base_gantt/__init__.py
rename to addons/web_gantt/__init__.py
diff --git a/addons/base_gantt/__openerp__.py b/addons/web_gantt/__openerp__.py
similarity index 84%
rename from addons/base_gantt/__openerp__.py
rename to addons/web_gantt/__openerp__.py
index c23f352a4f7..6d857e5dc48 100644
--- a/addons/base_gantt/__openerp__.py
+++ b/addons/web_gantt/__openerp__.py
@@ -1,7 +1,7 @@
{
- "name": "Base Gantt",
+ "name": "web Gantt",
"version": "2.0",
- "depends": ['base'],
+ "depends": ['web'],
"js": [
'static/lib/dhtmlxGantt/sources/dhtmlxcommon.js',
'static/lib/dhtmlxGantt/sources/dhtmlxgantt.js',
diff --git a/addons/base_gantt/controllers/__init__.py b/addons/web_gantt/controllers/__init__.py
similarity index 100%
rename from addons/base_gantt/controllers/__init__.py
rename to addons/web_gantt/controllers/__init__.py
diff --git a/addons/base_gantt/controllers/main.py b/addons/web_gantt/controllers/main.py
similarity index 65%
rename from addons/base_gantt/controllers/main.py
rename to addons/web_gantt/controllers/main.py
index 56fb2b7e79f..4f7e9201b38 100644
--- a/addons/base_gantt/controllers/main.py
+++ b/addons/web_gantt/controllers/main.py
@@ -1,8 +1,8 @@
-import base.common as openerpweb
-from base.controllers.main import View
+import web.common as openerpweb
+from web.controllers.main import View
class GanttView(View):
- _cp_path = "/base_gantt/ganttview"
+ _cp_path = "/web_gantt/ganttview"
@openerpweb.jsonrequest
def load(self, req, model, view_id):
diff --git a/addons/base_gantt/po/base_gantt.pot b/addons/web_gantt/po/base_gantt.pot
similarity index 100%
rename from addons/base_gantt/po/base_gantt.pot
rename to addons/web_gantt/po/base_gantt.pot
diff --git a/addons/web_gantt/po/web_gantt.pot b/addons/web_gantt/po/web_gantt.pot
new file mode 100644
index 00000000000..945fa401fd2
--- /dev/null
+++ b/addons/web_gantt/po/web_gantt.pot
@@ -0,0 +1,19 @@
+# Translations template for PROJECT.
+# Copyright (C) 2011 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# FIRST AUTHOR , 2011.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2011-09-06 12:02+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/License_GPL.html b/addons/web_gantt/static/lib/dhtmlxGantt/License_GPL.html
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/License_GPL.html
rename to addons/web_gantt/static/lib/dhtmlxGantt/License_GPL.html
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxcommon.js
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/dhtmlxgantt.js
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/arr.gif b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/arr.gif
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/arr.gif
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/arr.gif
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/bg_week.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_bg.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/menu_selection.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/menu/window_tr.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/minus.gif b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/minus.gif
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/minus.gif
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/minus.gif
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/parentnode_filled.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/plus.gif b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/plus.gif
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/plus.gif
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/plus.gif
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_bg.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png b/addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png
rename to addons/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/progress_filled.png
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/index.html b/addons/web_gantt/static/lib/dhtmlxGantt/index.html
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/index.html
rename to addons/web_gantt/static/lib/dhtmlxGantt/index.html
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/readme.txt b/addons/web_gantt/static/lib/dhtmlxGantt/readme.txt
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/readme.txt
rename to addons/web_gantt/static/lib/dhtmlxGantt/readme.txt
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js b/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js
rename to addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxcommon.js
diff --git a/addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js b/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js
similarity index 100%
rename from addons/base_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js
rename to addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js
diff --git a/addons/base_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js
similarity index 93%
rename from addons/base_gantt/static/src/js/gantt.js
rename to addons/web_gantt/static/src/js/gantt.js
index ad44382397b..a2da2d99671 100644
--- a/addons/base_gantt/static/src/js/gantt.js
+++ b/addons/web_gantt/static/src/js/gantt.js
@@ -1,14 +1,14 @@
/*---------------------------------------------------------
- * OpenERP base_gantt
+ * OpenERP web_gantt
*---------------------------------------------------------*/
-openerp.base_gantt = function (openerp) {
-QWeb.add_template('/base_gantt/static/src/xml/base_gantt.xml');
-openerp.base.views.add('gantt', 'openerp.base_gantt.GanttView');
-openerp.base_gantt.GanttView = openerp.base.View.extend({
+openerp.web_gantt = function (openerp) {
+QWeb.add_template('/web_gantt/static/src/xml/web_gantt.xml');
+openerp.web.views.add('gantt', 'openerp.web_gantt.GanttView');
+openerp.web_gantt.GanttView = openerp.web.View.extend({
init: function(parent, element_id, dataset, view_id) {
this._super(parent, element_id);
- this.view_manager = parent || new openerp.base.NullViewManager();
+ this.view_manager = parent || new openerp.web.NullViewManager();
this.dataset = dataset;
this.model = dataset.model;
this.view_id = view_id;
@@ -31,7 +31,7 @@ init: function(parent, element_id, dataset, view_id) {
},
start: function() {
- this.rpc("/base_gantt/ganttview/load",
+ this.rpc("/web_gantt/ganttview/load",
{"model": this.model, "view_id": this.view_id}, this.on_loaded);
},
@@ -67,7 +67,7 @@ init: function(parent, element_id, dataset, view_id) {
create_gantt: function() {
ganttChartControl = new GanttChart(this.day_length);
- ganttChartControl.setImagePath("/base_gantt/static/lib/dhtmlxGantt/codebase/imgs/");
+ ganttChartControl.setImagePath("/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/");
ganttChartControl.setEditable(true);
ganttChartControl.showTreePanel(true);
ganttChartControl.showContextMenu(true);
@@ -94,7 +94,7 @@ init: function(parent, element_id, dataset, view_id) {
COLOR_PALETTE = ['#ccccff', '#cc99ff', '#75507b', '#3465a4', '#73d216', '#c17d11', '#edd400',
'#fcaf3e', '#ef2929', '#ff00c9', '#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f',
'#ff8e00', '#ff0000', '#b0008c', '#9000ff', '#0078ff', '#00ff00', '#e6ff00', '#ffff00',
- '#905000', '#9b0000', '#840067', '#510090', '#0000c9', '#009b00', '#9abe00', '#ffc900']
+ '#905000', '#9b0000', '#840067', '#510090', '#0000c9', '#009b00', '#9abe00', '#ffc900'];
if (result.length != 0){
var show_event = [];
@@ -141,7 +141,7 @@ init: function(parent, element_id, dataset, view_id) {
var color = res[this.color_field][0] || res[this.color_field];
if (color_box[color] == undefined){
color_box[color] = COLOR_PALETTE[k];
- k = k + 1;
+ k += 1;
}
if (this.date_stop != undefined){
@@ -156,8 +156,8 @@ init: function(parent, element_id, dataset, view_id) {
else{
var duration = res[this.date_delay];
}
- if (duration == false)
- duration = 0
+ if (!duration)
+ duration = 0;
if (self.grp.length){
for (var j in self.grp){
@@ -169,7 +169,7 @@ init: function(parent, element_id, dataset, view_id) {
grp_key = res[self.grp[j]['group_by']];
}
- if (grp_key == false){
+ if (!grp_key){
grp_key = "Undefined";
}
@@ -233,7 +233,7 @@ init: function(parent, element_id, dataset, view_id) {
evt_date = all_events[evt_id]['evt'][2];
evt_duration = all_events[evt_id]['evt'][3];
- evt_str_date = this.convert_date_str(evt_date);
+ var evt_str_date = this.convert_date_str(evt_date);
evt_end_date = this.end_date(evt_str_date, evt_duration);
while (all_events[evt_id]['parent'] != "") {
@@ -396,14 +396,14 @@ init: function(parent, element_id, dataset, view_id) {
"type":"ir.actions.act_window",
"view_type":"form",
"view_mode":"form"
- }
+ };
action.flags = {
search_view: false,
sidebar : false,
views_switcher : false,
pager: false
- }
+ };
var element_id = _.uniqueId("act_window_dialog");
var dialog = jQuery(' ', {
'id': element_id
@@ -425,7 +425,7 @@ init: function(parent, element_id, dataset, view_id) {
}
}
});
- var action_manager = new openerp.base.ActionManager(this, element_id);
+ var action_manager = new openerp.web.ActionManager(this, element_id);
action_manager.start();
action_manager.do_action(action);
@@ -474,24 +474,24 @@ init: function(parent, element_id, dataset, view_id) {
convert_str_date: function (str){
if (str.length == 19){
this.format = "yyyy-MM-dd HH:mm:ss";
- return openerp.base.str_to_datetime(str);
+ return openerp.web.str_to_datetime(str);
} else if (str.length == 10){
this.format = "yyyy-MM-dd";
- return openerp.base.str_to_date(str);
+ return openerp.web.str_to_date(str);
} else if (str.length == 8){
this.format = "HH:mm:ss";
- return openerp.base.str_to_time(str);
+ return openerp.web.str_to_time(str);
}
throw "Unrecognized date/time format";
},
convert_date_str: function(full_date) {
if (this.format == "yyyy-MM-dd HH:mm:ss"){
- return openerp.base.datetime_to_str(full_date);
+ return openerp.web.datetime_to_str(full_date);
} else if (this.format == "yyyy-MM-dd"){
- return openerp.base.date_to_str(full_date);
+ return openerp.web.date_to_str(full_date);
} else if (this.format == "HH:mm:ss"){
- return openerp.base.time_to_str(full_date);
+ return openerp.web.time_to_str(full_date);
}
throw "Unrecognized date/time format";
},
@@ -508,7 +508,7 @@ init: function(parent, element_id, dataset, view_id) {
do_search: function (domains, contexts, groupbys) {
var self = this;
this.grp = groupbys;
- return this.rpc('/base/session/eval_domain_and_context', {
+ return this.rpc('/web/session/eval_domain_and_context', {
domains: domains,
contexts: contexts,
group_by_seq: groupbys
diff --git a/addons/base_gantt/static/src/xml/base_gantt.xml b/addons/web_gantt/static/src/xml/web_gantt.xml
similarity index 100%
rename from addons/base_gantt/static/src/xml/base_gantt.xml
rename to addons/web_gantt/static/src/xml/web_gantt.xml
diff --git a/addons/base_graph/__init__.py b/addons/web_graph/__init__.py
similarity index 100%
rename from addons/base_graph/__init__.py
rename to addons/web_graph/__init__.py
diff --git a/addons/base_graph/__openerp__.py b/addons/web_graph/__openerp__.py
similarity index 80%
rename from addons/base_graph/__openerp__.py
rename to addons/web_graph/__openerp__.py
index c393953b9fd..4a1c4a6576f 100644
--- a/addons/base_graph/__openerp__.py
+++ b/addons/web_graph/__openerp__.py
@@ -1,7 +1,7 @@
{
- "name": "Base Graph",
+ "name": "web Graph",
"version": "2.0",
- "depends": ['base'],
+ "depends": ['web'],
"js": [
"static/lib/dhtmlxGraph/codebase/dhtmlxchart.js",
"static/src/js/graph.js"],
diff --git a/addons/base_graph/controllers/__init__.py b/addons/web_graph/controllers/__init__.py
similarity index 100%
rename from addons/base_graph/controllers/__init__.py
rename to addons/web_graph/controllers/__init__.py
diff --git a/addons/base_graph/controllers/main.py b/addons/web_graph/controllers/main.py
similarity index 72%
rename from addons/base_graph/controllers/main.py
rename to addons/web_graph/controllers/main.py
index f326faf3854..cda868c0809 100644
--- a/addons/base_graph/controllers/main.py
+++ b/addons/web_graph/controllers/main.py
@@ -1,8 +1,8 @@
-from base.controllers.main import View
-import base.common as openerpweb
+from web.controllers.main import View
+import web.common as openerpweb
class GraphView(View):
- _cp_path = "/base_graph/graphview"
+ _cp_path = "/web_graph/graphview"
@openerpweb.jsonrequest
def load(self, req, model, view_id):
diff --git a/addons/base_graph/po/base_graph.pot b/addons/web_graph/po/base_graph.pot
similarity index 100%
rename from addons/base_graph/po/base_graph.pot
rename to addons/web_graph/po/base_graph.pot
diff --git a/addons/web_graph/po/web_graph.pot b/addons/web_graph/po/web_graph.pot
new file mode 100644
index 00000000000..945fa401fd2
--- /dev/null
+++ b/addons/web_graph/po/web_graph.pot
@@ -0,0 +1,19 @@
+# Translations template for PROJECT.
+# Copyright (C) 2011 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# FIRST AUTHOR , 2011.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2011-09-06 12:02+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/License_GPL.html b/addons/web_graph/static/lib/dhtmlxGraph/License_GPL.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/License_GPL.html
rename to addons/web_graph/static/lib/dhtmlxGraph/License_GPL.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.css b/addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.css
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.css
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.css
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.js b/addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.js
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.js
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.js
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.css b/addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.css
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.css
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.css
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.js b/addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.js
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.js
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart_debug.js
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/AUTHORS b/addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/AUTHORS
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/AUTHORS
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/AUTHORS
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/COPYING b/addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/COPYING
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/COPYING
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/COPYING
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/README b/addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/README
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/README
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/README
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/excanvas.js b/addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/excanvas.js
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/excanvas.js
rename to addons/web_graph/static/lib/dhtmlxGraph/codebase/thirdparty/excanvas/excanvas.js
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/dhtmlxchart_full.zip b/addons/web_graph/static/lib/dhtmlxGraph/dhtmlxchart_full.zip
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/dhtmlxchart_full.zip
rename to addons/web_graph/static/lib/dhtmlxGraph/dhtmlxchart_full.zip
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/readme.txt b/addons/web_graph/static/lib/dhtmlxGraph/readme.txt
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/readme.txt
rename to addons/web_graph/static/lib/dhtmlxGraph/readme.txt
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/01_load_xml.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/01_load_xml.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/01_load_xml.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/01_load_xml.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/02_load_json.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/02_load_json.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/02_load_json.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/02_load_json.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/03_load_csv.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/03_load_csv.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/03_load_csv.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/03_load_csv.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/04_load_jsarray.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/04_load_jsarray.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/04_load_jsarray.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/04_load_jsarray.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/05_series.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/05_series.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/01_initialization/05_series.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/01_initialization/05_series.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/01_default.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/01_default.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/01_default.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/01_default.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/02_custom.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/02_custom.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/02_custom.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/02_custom.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/03_custom_logic.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/03_custom_logic.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/03_custom_logic.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/03_custom_logic.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/04_gradient.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/04_gradient.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/02_color/04_gradient.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/02_color/04_gradient.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/03_group/01_basic.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/03_group/01_basic.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/03_group/01_basic.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/03_group/01_basic.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/03_group/02_scales.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/03_group/02_scales.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/03_group/02_scales.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/03_group/02_scales.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/01_init.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/01_init.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/01_init.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/01_init.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/02_text.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/02_text.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/02_text.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/02_text.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/03_3d_chart.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/03_3d_chart.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/03_3d_chart.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/03_3d_chart.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/04_legend.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/04_legend.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/04_legend.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/04_pie_chart/04_legend.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/01_init.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/01_init.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/01_init.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/01_init.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/02_style.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/02_style.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/02_style.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/02_style.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/03_scale.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/03_scale.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/03_scale.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/03_scale.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/04_spline.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/04_spline.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/04_spline.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/04_spline.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/05_series.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/05_series.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/05_line_chart/05_series.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/05_line_chart/05_series.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/01_init.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/01_init.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/01_init.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/01_init.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/02_text.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/02_text.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/02_text.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/02_text.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/03_scales.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/03_scales.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/03_scales.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/03_scales.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/04_styles.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/04_styles.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/04_styles.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/04_styles.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/05_stacked_chart.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/05_stacked_chart.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/05_stacked_chart.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/05_stacked_chart.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/06_series.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/06_series.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/06_series.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/06_series.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/07_horizonal_bars.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/07_horizonal_bars.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/07_horizonal_bars.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/07_horizonal_bars.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/08_horizonal_stacked_bars.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/08_horizonal_stacked_bars.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/08_horizonal_stacked_bars.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/06_bar_chart/08_horizonal_stacked_bars.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/01_init.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/01_init.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/01_init.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/01_init.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/02_scale.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/02_scale.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/02_scale.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/02_scale.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_series.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_series.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_series.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_series.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_stacked_area.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_stacked_area.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_stacked_area.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/07_area_chart/03_stacked_area.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/01_add.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/02_events.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/03_sorting.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/08_dynamic/04_filtering.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/09_integration/01_dhtmlxgrid.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/09_integration/01_dhtmlxgrid.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/09_integration/01_dhtmlxgrid.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/09_integration/01_dhtmlxgrid.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/09_integration/02_dhtmlxgrid_group.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/09_integration/02_dhtmlxgrid_group.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/09_integration/02_dhtmlxgrid_group.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/09_integration/02_dhtmlxgrid_group.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/09_integration/03_windows.html b/addons/web_graph/static/lib/dhtmlxGraph/samples/09_integration/03_windows.html
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/09_integration/03_windows.html
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/09_integration/03_windows.html
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/common/config.php b/addons/web_graph/static/lib/dhtmlxGraph/samples/common/config.php
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/common/config.php
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/common/config.php
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/common/data.php b/addons/web_graph/static/lib/dhtmlxGraph/samples/common/data.php
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/common/data.php
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/common/data.php
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/common/sales.xml b/addons/web_graph/static/lib/dhtmlxGraph/samples/common/sales.xml
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/common/sales.xml
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/common/sales.xml
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/common/stat.xml b/addons/web_graph/static/lib/dhtmlxGraph/samples/common/stat.xml
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/common/stat.xml
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/common/stat.xml
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/samples/readme.txt b/addons/web_graph/static/lib/dhtmlxGraph/samples/readme.txt
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/samples/readme.txt
rename to addons/web_graph/static/lib/dhtmlxGraph/samples/readme.txt
diff --git a/addons/base_graph/static/lib/dhtmlxGraph/sources/dhtmlxchart.js b/addons/web_graph/static/lib/dhtmlxGraph/sources/dhtmlxchart.js
similarity index 100%
rename from addons/base_graph/static/lib/dhtmlxGraph/sources/dhtmlxchart.js
rename to addons/web_graph/static/lib/dhtmlxGraph/sources/dhtmlxchart.js
diff --git a/addons/base_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
similarity index 97%
rename from addons/base_graph/static/src/js/graph.js
rename to addons/web_graph/static/src/js/graph.js
index e76d38b33bc..f5fd7c1953d 100644
--- a/addons/base_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -1,8 +1,8 @@
/*---------------------------------------------------------
- * OpenERP base_graph
+ * OpenERP web_graph
*---------------------------------------------------------*/
-openerp.base_graph = function (openerp) {
+openerp.web_graph = function (openerp) {
var COLOR_PALETTE = [
'#cc99ff', '#ccccff', '#48D1CC', '#CFD784', '#8B7B8B', '#75507b',
'#b0008c', '#ff0000', '#ff8e00', '#9000ff', '#0078ff', '#00ff00',
@@ -12,9 +12,9 @@ var COLOR_PALETTE = [
'#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f', '#f57900',
'#cc0000', '#d400a8'];
-QWeb.add_template('/base_graph/static/src/xml/base_graph.xml');
-openerp.base.views.add('graph', 'openerp.base_graph.GraphView');
-openerp.base_graph.GraphView = openerp.base.View.extend({
+QWeb.add_template('/web_graph/static/src/xml/web_graph.xml');
+openerp.web.views.add('graph', 'openerp.web_graph.GraphView');
+openerp.web_graph.GraphView = openerp.web.View.extend({
init: function(parent, element_id, dataset, view_id) {
this._super(parent, element_id);
@@ -32,7 +32,7 @@ openerp.base_graph.GraphView = openerp.base.View.extend({
this.$element.hide();
},
start: function() {
- return this.rpc("/base_graph/graphview/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded);
+ return this.rpc("/web_graph/graphview/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded);
},
on_loaded: function(data) {
this.all_fields = data.all_fields;
@@ -455,7 +455,7 @@ openerp.base_graph.GraphView = openerp.base.View.extend({
do_search: function(domains, contexts, groupbys) {
var self = this;
- this.rpc('/base/session/eval_domain_and_context', {
+ this.rpc('/web/session/eval_domain_and_context', {
domains: domains,
contexts: contexts,
group_by_seq: groupbys
diff --git a/addons/base_graph/static/src/xml/base_graph.xml b/addons/web_graph/static/src/xml/web_graph.xml
similarity index 100%
rename from addons/base_graph/static/src/xml/base_graph.xml
rename to addons/web_graph/static/src/xml/web_graph.xml
diff --git a/addons/base_hello/__init__.py b/addons/web_hello/__init__.py
similarity index 100%
rename from addons/base_hello/__init__.py
rename to addons/web_hello/__init__.py
diff --git a/addons/base_hello/__openerp__.py b/addons/web_hello/__openerp__.py
similarity index 100%
rename from addons/base_hello/__openerp__.py
rename to addons/web_hello/__openerp__.py
diff --git a/addons/base_hello/po/base_hello.pot b/addons/web_hello/po/base_hello.pot
similarity index 100%
rename from addons/base_hello/po/base_hello.pot
rename to addons/web_hello/po/base_hello.pot
diff --git a/addons/web_hello/po/web_hello.pot b/addons/web_hello/po/web_hello.pot
new file mode 100644
index 00000000000..d7f6df2d73d
--- /dev/null
+++ b/addons/web_hello/po/web_hello.pot
@@ -0,0 +1,19 @@
+# Translations template for PROJECT.
+# Copyright (C) 2011 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# FIRST AUTHOR , 2011.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2011-09-06 12:03+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.6\n"
+
diff --git a/addons/base_hello/static/openerp/base_hello.js b/addons/web_hello/static/openerp/base_hello.js
similarity index 80%
rename from addons/base_hello/static/openerp/base_hello.js
rename to addons/web_hello/static/openerp/base_hello.js
index 5d6a02d355b..99c97006eac 100644
--- a/addons/base_hello/static/openerp/base_hello.js
+++ b/addons/web_hello/static/openerp/base_hello.js
@@ -2,9 +2,9 @@
* OpenERP base_hello (Example module)
*---------------------------------------------------------*/
-openerp.base_hello = function(openerp) {
+openerp.web_hello = function(openerp) {
-openerp.base.SearchView = openerp.base.SearchView.extend({
+openerp.web.SearchView = openerp.web.SearchView.extend({
init:function() {
this._super.apply(this,arguments);
this.on_search.add(function(){console.log('hello');});
diff --git a/addons/web_mobile/controllers/__init__.py b/addons/web_mobile/controllers/__init__.py
index 8ee9bae18d9..e69de29bb2d 100644
--- a/addons/web_mobile/controllers/__init__.py
+++ b/addons/web_mobile/controllers/__init__.py
@@ -1 +0,0 @@
-import main
diff --git a/addons/web_mobile/controllers/main.py b/addons/web_mobile/controllers/main.py
deleted file mode 100644
index 8fa3e32a775..00000000000
--- a/addons/web_mobile/controllers/main.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- coding: utf-8 -*-
-#import glob, os
-#import pprint
-#
-#import simplejson
-#
-#import openerpweb
-#import openerpweb.ast
-#import openerpweb.nonliterals
-#
-#import cherrypy
-#
diff --git a/addons/web_mobile/po/web_mobile.pot b/addons/web_mobile/po/web_mobile.pot
index b8582b3f12f..37b557def1d 100644
--- a/addons/web_mobile/po/web_mobile.pot
+++ b/addons/web_mobile/po/web_mobile.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2011-08-17 13:28+0200\n"
+"POT-Creation-Date: 2011-09-06 12:03+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -21,18 +21,10 @@ msgstr ""
msgid "OpenERP"
msgstr ""
-#: addons/web_mobile/static/src/xml/web_mobile.xml:0
-msgid "Home"
-msgstr ""
-
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "Database:"
msgstr ""
-#: addons/web_mobile/static/src/xml/web_mobile.xml:0
-msgid "Choose Database..."
-msgstr ""
-
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
msgid "Login:"
msgstr ""
@@ -46,7 +38,11 @@ msgid "Login"
msgstr ""
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
-msgid ":"
+msgid "Bad username or password"
+msgstr ""
+
+#: addons/web_mobile/static/src/xml/web_mobile.xml:0
+msgid "Home"
msgstr ""
#: addons/web_mobile/static/src/xml/web_mobile.xml:0
@@ -69,3 +65,7 @@ msgstr ""
msgid "Preferences"
msgstr ""
+#: addons/web_mobile/static/src/xml/web_mobile.xml:0
+msgid ":"
+msgstr ""
+
diff --git a/addons/web_mobile/static/src/js/chrome_mobile.js b/addons/web_mobile/static/src/js/chrome_mobile.js
index 551856e01fb..ff5601d56df 100644
--- a/addons/web_mobile/static/src/js/chrome_mobile.js
+++ b/addons/web_mobile/static/src/js/chrome_mobile.js
@@ -5,21 +5,20 @@
openerp.web_mobile.chrome_mobile = function(openerp) {
openerp.web_mobile.mobilewebclient = function(element_id) {
- // TODO Helper to start mobile webclient rename it openerp.base.webclient
+ // TODO Helper to start mobile webclient rename it openerp.web.webclient
var client = new openerp.web_mobile.MobileWebClient(element_id);
client.start();
return client;
};
-openerp.web_mobile.MobileWebClient = openerp.base.Widget.extend({
+openerp.web_mobile.MobileWebClient = openerp.web.Widget.extend({
init: function(element_id) {
- var self = this;
this._super(null, element_id);
QWeb.add_template("xml/web_mobile.xml");
var params = {};
this.$element.html(QWeb.render("WebClient", {}));
- this.session = new openerp.base.Session("oe_errors");
- this.crashmanager = new openerp.base.CrashManager(this);
+ this.session = new openerp.web.Session("oe_errors");
+ this.crashmanager = new openerp.web.CrashManager(this);
this.login = new openerp.web_mobile.Login(this, "oe_app");
// this.session.on_session_invalid.add(this.login.do_ask_login);
},
@@ -29,14 +28,11 @@ openerp.web_mobile.MobileWebClient = openerp.base.Widget.extend({
}
});
-openerp.web_mobile.Login = openerp.base.Widget.extend({
- init: function(session, element_id) {
- this._super(session, element_id);
- },
+openerp.web_mobile.Login = openerp.web.Widget.extend({
start: function() {
var self = this;
jQuery("#oe_header").children().remove();
- this.rpc("/base/database/get_list", {}, function(result) {
+ this.rpc("/web/database/get_list", {}, function(result) {
var selection = new openerp.web_mobile.Selection();
self.db_list = result.db_list;
self.$element.html(QWeb.render("Login", self));
@@ -87,7 +83,7 @@ openerp.web_mobile.Login = openerp.base.Widget.extend({
}
});
-openerp.web_mobile.HomePage = openerp.base.Widget.extend({
+openerp.web_mobile.HomePage = openerp.web.Widget.extend({
init: function(session, element_id) {
this._super(session, element_id);
},
@@ -106,7 +102,7 @@ openerp.web_mobile.HomePage = openerp.base.Widget.extend({
}
});
-openerp.web_mobile.Header = openerp.base.Widget.extend({
+openerp.web_mobile.Header = openerp.web.Widget.extend({
init: function(session, element_id) {
this._super(session, element_id);
},
@@ -116,8 +112,8 @@ openerp.web_mobile.Header = openerp.base.Widget.extend({
self.$element.find("a").click(this.on_clicked);
},
on_clicked: function(ev) {
- $opt = $(ev.currentTarget);
- current_id = $opt.attr('id');
+ var $opt = $(ev.currentTarget);
+ var current_id = $opt.attr('id');
if (current_id == 'home') {
this.homepage = new openerp.web_mobile.HomePage(this, "oe_app");
this.homepage.start();
@@ -125,28 +121,28 @@ openerp.web_mobile.Header = openerp.base.Widget.extend({
}
});
-openerp.web_mobile.Shortcuts = openerp.base.Widget.extend({
+openerp.web_mobile.Shortcuts = openerp.web.Widget.extend({
init: function(session, element_id) {
this._super(session, element_id);
},
start: function() {
var self = this;
- this.rpc('/base/session/sc_list',{} ,function(res){
- self.$element.html(QWeb.render("Shortcuts", {'sc' : res}))
+ this.rpc('/web/session/sc_list',{} ,function(res){
+ self.$element.html(QWeb.render("Shortcuts", {'sc' : res}));
self.$element.find("a").click(self.on_clicked);
})
},
on_clicked: function(ev) {
- $shortcut = $(ev.currentTarget);
- id = $shortcut.data('menu');
- res_id = $shortcut.data('res');
+ var $shortcut = $(ev.currentTarget);
+ var id = $shortcut.data('menu');
+ var res_id = $shortcut.data('res');
jQuery("#oe_header").find("h1").html($shortcut.data('name'));
this.listview = new openerp.web_mobile.ListView(this, "oe_app", res_id);
this.listview.start();
}
});
-openerp.web_mobile.Menu = openerp.base.Widget.extend({
+openerp.web_mobile.Menu = openerp.web.Widget.extend({
init: function(session, element_id, secondary_menu_id) {
this._super(session, element_id);
this.secondary_menu_id = secondary_menu_id;
@@ -154,7 +150,7 @@ openerp.web_mobile.Menu = openerp.base.Widget.extend({
this.menu = false;
},
start: function() {
- this.rpc("/base/menu/load", {}, this.on_loaded);
+ this.rpc("/web/menu/load", {}, this.on_loaded);
},
on_loaded: function(data) {
this.data = data;
@@ -162,7 +158,7 @@ openerp.web_mobile.Menu = openerp.base.Widget.extend({
this.$element.add(this.$secondary_menu).find("a").click(this.on_menu_click);
},
on_menu_click: function(ev, id) {
- $menu = $(ev.currentTarget);
+ var $menu = $(ev.currentTarget);
id = $menu.data('menu');
for (var i = 0; i < this.data.data.children.length; i++) {
if (this.data.data.children[i].id == id) {
@@ -179,7 +175,7 @@ openerp.web_mobile.Menu = openerp.base.Widget.extend({
}
});
-openerp.web_mobile.Secondary = openerp.base.Widget.extend({
+openerp.web_mobile.Secondary = openerp.web.Widget.extend({
init: function(session, element_id, secondary_menu_id) {
this._super(session, element_id);
this.data = secondary_menu_id;
@@ -190,7 +186,7 @@ openerp.web_mobile.Secondary = openerp.base.Widget.extend({
this.$element.add(this.$secondary_menu).find("a").click(this.on_menu_click);
},
on_menu_click: function(ev, id) {
- $menu = $(ev.currentTarget);
+ var $menu = $(ev.currentTarget);
id = $menu.data('menu');
for (var i = 0; i < this.data.children.length; i++) {
if (this.data.children[i].id == id) {
@@ -216,10 +212,7 @@ openerp.web_mobile.Secondary = openerp.base.Widget.extend({
}
});
-openerp.web_mobile.Options = openerp.base.Widget.extend({
- init: function(session, element_id) {
- this._super(session, element_id);
- },
+openerp.web_mobile.Options = openerp.web.Widget.extend({
start: function() {
var self = this;
this.$element.html(QWeb.render("Options", this));
@@ -232,18 +225,11 @@ openerp.web_mobile.Options = openerp.base.Widget.extend({
}
});
-openerp.web_mobile.Selection = openerp.base.Widget.extend({
- init: function (){
- this._super();
- },
- start: function(){
- this._super();
- var self = this;
- },
+openerp.web_mobile.Selection = openerp.web.Widget.extend({
on_select_option: function(ev){
ev.preventDefault();
var $this = ev.currentTarget;
$($this).prev().find(".ui-btn-text").html($($this).find("option:selected").text());
}
});
-}
+};
diff --git a/addons/web_mobile/static/src/js/form_mobile.js b/addons/web_mobile/static/src/js/form_mobile.js
index 4a3e2167c02..03291a70bfa 100644
--- a/addons/web_mobile/static/src/js/form_mobile.js
+++ b/addons/web_mobile/static/src/js/form_mobile.js
@@ -4,7 +4,7 @@
openerp.web_mobile.form_mobile = function (openerp) {
-openerp.web_mobile.FormView = openerp.base.Widget.extend({
+openerp.web_mobile.FormView = openerp.web.Widget.extend({
init: function(session, element_id, list_id, action) {
this._super(session, element_id);
this.list_id = list_id;
@@ -18,17 +18,17 @@ openerp.web_mobile.FormView = openerp.base.Widget.extend({
},
start: function() {
var self = this;
- id = this.list_id;
- model = this.action.res_model;
- view_id = this.action.views[1][0];
- this.dataset = new openerp.base.DataSetSearch(this, this.action.res_model, null, null);
+ var id = this.list_id;
+ var model = this.action.res_model;
+ var view_id = this.action.views[1][0];
+ this.dataset = new openerp.web.DataSetSearch(this, this.action.res_model, null, null);
this.dataset.read_slice([],{}, function (result) {
for (var i = 0; i < result.length; i++) {
if (result[i].id == id) {
var data = result[i];
}
}
- self.rpc("/base/formview/load", {"model": model, "view_id": view_id }, function (result) {
+ self.rpc("/web/formview/load", {"model": model, "view_id": view_id }, function (result) {
var fields = result.fields_view.fields;
var view_fields = result.fields_view.arch.children;
var get_fields = self.get_fields(view_fields);
@@ -128,4 +128,4 @@ openerp.web_mobile.FormView = openerp.base.Widget.extend({
next.addClass(this.collapsed_class);
}
});
-}
\ No newline at end of file
+};
diff --git a/addons/web_mobile/static/src/js/list_mobile.js b/addons/web_mobile/static/src/js/list_mobile.js
index b4ba5e08cc3..9bcdc0a72ce 100644
--- a/addons/web_mobile/static/src/js/list_mobile.js
+++ b/addons/web_mobile/static/src/js/list_mobile.js
@@ -4,13 +4,13 @@
openerp.web_mobile.list_mobile = function (openerp) {
-openerp.web_mobile.ListView = openerp.base.Widget.extend({
+openerp.web_mobile.ListView = openerp.web.Widget.extend({
init: function(session, element_id, list_id) {
this._super(session, element_id);
this.list_id = list_id;
},
start: function() {
- this.rpc('/base/menu/action', {'menu_id': this.list_id},
+ this.rpc('/web/menu/action', {'menu_id': this.list_id},
this.on_menu_action_loaded);
},
on_menu_action_loaded: function(data) {
@@ -41,7 +41,7 @@ openerp.web_mobile.ListView = openerp.base.Widget.extend({
}
var self = this;
- var dataset = new openerp.base.DataSetStatic(this, this.action.res_model, this.action.context);
+ var dataset = new openerp.web.DataSetStatic(this, this.action.res_model, this.action.context);
dataset.domain=[['name','ilike',search_val]];
dataset.name_search(search_val, dataset.domain, 'ilike',false ,function(result){
self.$element.html(QWeb.render("ListView", {'records' : result}));
@@ -63,11 +63,11 @@ openerp.web_mobile.ListView = openerp.base.Widget.extend({
});
},
on_list_click: function(ev) {
- $record = $(ev.currentTarget);
+ var $record = $(ev.currentTarget);
var self = this;
- id = $record.data('id');
+ var id = $record.data('id');
this.formview = new openerp.web_mobile.FormView(this, "oe_app", id, this.action);
this.formview.start();
}
});
-}
\ No newline at end of file
+};
diff --git a/addons/web_mobile/static/src/web_mobile.html b/addons/web_mobile/static/src/web_mobile.html
index 6efc28b6532..254c4a6ea36 100755
--- a/addons/web_mobile/static/src/web_mobile.html
+++ b/addons/web_mobile/static/src/web_mobile.html
@@ -15,7 +15,7 @@
-
+
@@ -27,6 +27,7 @@
|