[IMP] removed Import action if create = false

bzr revid: jam@tinyerp.com-20120820104055-mgw4y5csa31poa33
This commit is contained in:
Jigar Amin - OpenERP 2012-08-20 16:10:55 +05:30
parent 6ace7578fa
commit 0f364e1acd
2 changed files with 10 additions and 8 deletions

View File

@ -351,8 +351,12 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
if (!this.sidebar && this.options.$sidebar) {
this.sidebar = new instance.web.Sidebar(this);
this.sidebar.appendTo(this.options.$sidebar);
if (self._is_action_enabled('create')){
this.sidebar.add_items('other', [
{ label: _t("Import"), callback: this.on_sidebar_import }
]);
}
this.sidebar.add_items('other', [
{ label: _t("Import"), callback: this.on_sidebar_import },
{ label: _t("Export"), callback: this.on_sidebar_export }
]);
if (self._is_action_enabled('delete')){

View File

@ -671,14 +671,12 @@
</tfoot>
</table>
<div t-name="ListView.buttons" class="oe_list_buttons">
<t t-if="!widget.no_leaf and widget.options.action_buttons !== false and widget.options.addable">
<t t-if="widget._is_action_enabled('create')">
<button type="button" class="oe_button oe_list_add oe_highlight">
<t t-esc="widget.options.addable"/>
</button>
</t>
<t t-if="!widget.no_leaf and widget.options.action_buttons !== false and widget.options.addable and widget._is_action_enabled('create')">
<button type="button" class="oe_button oe_list_add oe_highlight">
<t t-esc="widget.options.addable"/>
</button>
<span class="oe_alternative" t-if="widget.options.import_enabled">
<span class="oe_fade" t-if="widget._is_action_enabled('create')">or</span> <a href="#" class="oe_bold oe_list_button_import">Import</a>
<span class="oe_fade">or</span> <a href="#" class="oe_bold oe_list_button_import">Import</a>
</span>
</t>
</div>