[IMP] View Button Constrains: Diagrem view add node button, kanban record slidebar widget mnethod support
bzr revid: jam@tinyerp.com-20120816130012-ibtv0ipbbnpznqb1
This commit is contained in:
parent
d42261907c
commit
41964c4b9d
|
@ -44,7 +44,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
this.node = this.nodes.attrs.object,
|
||||
this.connector = this.connectors.attrs.object;
|
||||
|
||||
this.$element.html(QWeb.render("DiagramView", this));
|
||||
this.$element.html(QWeb.render("DiagramView", {'widget':self}));
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
|
||||
this.$element.find('div.oe_diagram_pager button[data-pager-action]').click(function() {
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
<t t-name="DiagramView">
|
||||
<div class="oe_diagram_header" t-att-id="element_id + '_header'">
|
||||
<h3 class="oe_diagram_title"/>
|
||||
<div class="oe_diagram_buttons">
|
||||
<button type="button" id="new_node" class="oe_button oe_diagram_button_new">New Node</button>
|
||||
</div>
|
||||
<t t-if="widget._is_action_enabled('create')">
|
||||
<div class="oe_diagram_buttons">
|
||||
<button type="button" id="new_node" class="oe_button oe_diagram_button_new">New Node</button>
|
||||
</div>
|
||||
</t>
|
||||
<div class="oe_diagram_pager">
|
||||
<t t-call="ViewPager">
|
||||
<span class="oe_pager_index">0</span> / <span class="oe_pager_count">0</span>
|
||||
|
|
|
@ -785,6 +785,9 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
|
|||
},
|
||||
kanban_compute_domain: function(domain) {
|
||||
return instance.web.form.compute_domain(domain, this.values);
|
||||
},
|
||||
_is_action_enabled: function(action) {
|
||||
return (_.has(this.fields_view.arch.attrs, action))?JSON.parse(this.fields_view.arch.attrs[action]):true;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue