I want to hide only action/more button not print button in odoo12. I found some similar question its not working in odoo12.
Asked
Active
Viewed 1,860 times
1 Answers
4
Not a decent answer, but a direction for you.
In source code(my version is 11)
odoo-11.0/addons/web/static/src/js/chrome/sidebar.js L#34
init: function (parent, options) {
this._super.apply(this, arguments);
this.options = _.defaults(options || {}, {
'editable': true
});
this.env = options.env;
this.sections = options.sections || [
{name: 'print', label: _t('Print')},
/* disable this line
{name: 'other', label: _t('Action')},
*/
];
This can remove action button not only in form view, but also include list view.
Or in odoo-11.0/addons/web/static/src/xml/base.xml L#326
<t t-name="Sidebar">
<t t-foreach="widget.sections" t-as="section">
<div class="btn-group o_dropdown">
<button t-if="section.name != 'buttons'" class="o_dropdown_toggler_btn btn btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<t t-if="section.name == 'files'" t-raw="widget.items[section.name].length || ''"/>
<t t-esc="section.label"/> <span class="caret"/>
</button>
Maybe you can consider to attach some if-condition for removing action button in form view from these file.

Terrence Poe
- 634
- 4
- 17
-
you can also use browser's developer tool to set break-point in `sidebar.js` L#34 to check difference of variables between form view and list view. – Terrence Poe Jul 05 '19 at 02:00
-
maybe it can help you to find correct setting in if-condition. – Terrence Poe Jul 05 '19 at 02:02
-
Just found out `options.env.context.params.view_type` can detect where you are. – Terrence Poe Jul 05 '19 at 04:19
-
`var view_type =this.env.context.params.view_type; if (view_type == 'list'){ remain code L# 33,34}` add this in `sidebar.js` – Terrence Poe Jul 05 '19 at 04:21