AttributeError: 'ir.ui.view' object has no attribute '_render'

293 Views Asked by At

I succeeded to install Odoo 15 module DMS (Documents) ex. OCA in Odoo 16, but get error when running the module:

File "/Users/Karunia/odoo16/odoo/addons/dms/controllers/main.py", line 33, in document_onboarding_file "html": request.env.ref("dms.document_onboarding_file_panel")._render( AttributeError: 'ir.ui.view' object has no attribute '_render'

The above server error caused the following client error: OwlError: The following error occurred in onWillStart: "Odoo Server Error"

I am new in Odoo developing and unable to solve the above error.

1

There are 1 best solutions below

0
Amin Dehghani On BEST ANSWER

First thing is you cannot install Odoo 15 module on Odoo 16 because the code for your module needs to be updated to v16. for the issue above you need to call it like this:

request.env['ir.qweb']._render('dms.document_onboarding_file_panel', {
        "state": company.get_and_update_documents_onboarding_state(),
        "company": company,
})

Hope it solves your problem.