object - How to hide "Attachment" menu for specific model and group in Odoo? -
i want hide "attachment(s)" menu in form view specific group , model/object in odoo 8. how can it?
i not have idea hide attachment menu can restrict attach via js code:
odoo.define('module_name', function(require) { "use strict"; var core = require('web.core'); var data = require('web.data'); var framework = require('web.framework'); var sidewidget = require('web.sidebar'); var model = require('web.model'); var dialog = require('web.dialog'); var _t = core._t; var qweb = core.qweb; var sidebar = sidewidget.include({ redraw: function() { var self = this; this._super.apply(this, arguments); if (this.getparent()) { var view = this.getparent(); if (this.getparent().dataset.model != "there model not want attach files") { this.$('.o_sidebar_add_attachment .o_form_binary_form').change(this.on_attachment_changed); } } }, }); <?xml version="1.0" encoding="utf-8"?> <odoo> <data> <template id="assets_backend_niwe" name="alfresco_odoo assets" inherit_id="web.assets_backend"> <xpath expr="." position="inside"> <script type="text/javascript" src="file location"/> </xpath> </template> </data> </odoo>
save separate file , add js file assets backend.
Comments
Post a Comment