Я нашел решение для вызова мастера, который я создал для печати линий.
Путь: locations_quants_report/views/templates.xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend" name="stock_quant_tree_view_button" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/locations_quants_report/static/src/js/tree_view_button.js"></script>
</xpath>
</template>
</data>
</odoo>
Путь: locations_quants_report/static/src/xml/tree_view_button.xml
<?xml version="1.0" encoding="UTF-8"?>
<template id="template" xml:space="preserve">
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_save" t-operation="before">
<t t-if="widget.modelName == 'stock.quant'">
<button id="custom_print_btn" class="btn btn-primary o_list_button_custom_print" type="button" >Print</button>
</t>
</t>
</t>
</template>
Путь: locations_quants_report/static/src/js/tree_view_button.js
odoo.define('locations_quants_report.tree_view_button', function (require){
"use strict";
var core = require('web.core');
var ListView = require('web.ListView');
var ListController = require("web.ListController");
var includeDict = {
renderButtons: function () {
this._super.apply(this, arguments);
if (this.modelName == 'stock.quant') {
var your_btn = this.$buttons.find('button.o_list_button_custom_print');
your_btn.on('click', this.proxy('o_list_button_custom_print'));
}
},
o_list_button_custom_print: function(){
this.do_action({
name: "Open a wizard",
type: 'ir.actions.act_window',
res_model: 'locations.quants.report',
view_mode: 'form',
view_type: 'form',
views: [[false, 'form']],
target: 'new',
});
}
};
ListController.include(includeDict);
});
Также объявите их на __manifest__.py
'data': [
...
'views/template.xml'
],
'qweb': [
'static/src/xml/tree_view_button.xml',
],