Odoo – TypeError: action.views is undefined

Hi i have a button and this is how i define it.

odoo.define('button_near_create.tree_button_create_quotation', function(require) {
    "use strict";

    var ListController = require('web.ListController');
    var ListView = require('web.ListView');
    var viewRegistry = require('web.view_registry');
    var rpc = require('web.rpc');
    var core = require('web.core');
    var Dialog = require('web.Dialog');
    var _t = core._t;

    var TreeButton = ListController.extend({
        buttons_template: 'button_near_create.button.quotation',
        events: _.extend({}, ListController.prototype.events, {
            'click .open_wizard_action_subscription': '_OpenWizardTree',
        }),

        _OpenWizardTree: function () {
            var self = this;

            // Kaydetme butonunu bul ve tıkla
            var saveButton = this.$buttons && this.$buttons.find('.o_form_button_save');
            if (saveButton && saveButton.length) {
                saveButton.click();
            }

            // Kaydetme işleminin tamamlanmasını bekle ve ardından devam et
            setTimeout(function() {
                var domain = [['products', '!=', false]];

                rpc.query({
                    model: 'et.subscription',
                    method: 'search',
                    args: [domain],
                    fields: ['id']
                }).then(function(ids) {
                    if (ids.length === 0) {
                        Dialog.alert(self, _t('No records found with products.'));
                        return;
                    }
                    console.log('Subscription IDs:', ids);
                    rpc.query({
                        model: 'et.subscription',
                        method: 'renew_selected',
                        args: [ids], // args kullanarak ids'yi parametre olarak iletme
                    }).then(function(result) {
                        console.log('Result:', result);
                        if (result && result.type === 'ir.actions.act_window') {
                            self.do_action(result);
                        } else {
                            Dialog.alert(self, _t('An error occurred while creating the quotation.'));
                        }
                    }).catch(function(error) {
                        console.log('Error:', error);
                        var errorMessage = _t('An error occurred');
                        if (error.message && error.message.data && error.message.data.message) {
                            errorMessage = error.message.data.message;
                        }
                        Dialog.alert(self, errorMessage);
                    });
                }).catch(function(error) {
                    console.log('Error:', error);
                    Dialog.alert(self, _t('An error occurred: ') + JSON.stringify(error));
                });
            }, 0); // Kaydetme işlemi için 1 saniye bekle
        }
    });

    var ContactCreateTreeController = ListView.extend({
        config: _.extend({}, ListView.prototype.config, {
            Controller: TreeButton
        }),
    });

    viewRegistry.add('button_in_tree_subscription', ContactCreateTreeController);
});


<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
   <t t-extend="ListView.buttons" t-name="button_near_create.button.quotation">
       <t t-jquery="div" t-operation="prepend">
               <button t-if="widget.modelName == 'et.subscription'"
                       class="btn btn-primary open_wizard_action_subscription oe_highlight"
                       type="button">Create Quotation (Renew)</button>
       </t>
   </t>
</templates>


and renew_selected function has a return value like that

def renew_selected(self):
        sale_orders = [1,2,3]
        tree_view_id = self.env.ref('sale.view_quotation_tree_with_onboarding').id
        form_view_id = self.env.ref('sale.view_order_form').id

        return {
            'name': 'Sale Orders - Specific',
            'type': 'ir.actions.act_window',
            'view_mode': 'tree, form',
            'res_model': 'sale.order',
            'domain': [('id', 'in', sale_orders)],
            'target': 'new',
            'views': [(tree_view_id, 'tree'), (form_view_id, 'form')],
        }

sale.order has id(1,2,3) values
tree_view_id and form_view_id is coming correctly. But this function opening form view every time.
When i remove ‘form’ from view_mode and views, its giving me error

UncaughtPromiseError > TypeError

Uncaught Promise > action.views is undefined

TypeError: action.views is undefined
    _preprocessAction@http://localhost:8069/web/assets/773-4de1bdd/web.assets_backend.min.js:10887:57
    doAction@http://localhost:8069/web/assets/773-4de1bdd/web.assets_backend.min.js:10994:170
    

Any idea why its not opening tree view ?

I tried to create a new tree view but it didnt worked also.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật