i guess i figured that out. here is the working code. take backup and use it at own risk.
get the list of whole views registered in system.
--- SELECT
irmm.id, irmm.name, irmd.model, irmd.res_id FROM
ir_module_module AS irmm
LEFT JOIN ir_model_data AS irmd ON irmm.name = irmd.module WHERE
irmm.state = 'installed' AND
irmd.model = 'ir.ui.view'
ORDER BY
irmm.name ASC ---
fetch inherited views from modules where *_ext --- SELECT
array_to_string(array_agg(distinct "inherit_id"), ', ') AS modified_views FROM
ir_ui_view WHERE
name LIKE '%_ext%' AND
inherit_id IS NOT NULL ---
should give you output like this one: (inherited views)
"163, 167, 181, 182, 978, 981, 1320, 1399, 1801, 1804, 1809, 1822, 1824, 1973"
copy the function from website/controllers/main.py ----
@http.route('/website/reset_templates', type='http', auth='user', methods=['POST'], website=True)
def reset_template(self, templates, redirect='/'):
templates = request.httprequest.form.getlist('templates')
modules_to_update = []
for temp_id in templates:
view = request.registry['ir.ui.view'].browse(request.cr, request.uid, int(temp_id), context=request.context)
if view.page:
continue
view.model_data_id.write({
'noupdate': False
})
if view.model_data_id.module not in modules_to_update:
modules_to_update.append(view.model_data_id.module)
if modules_to_update:
module_obj = request.registry['ir.module.module']
module_ids = module_obj.search(request.cr, request.uid, [('name', 'in', modules_to_update)], context=request.context)
if module_ids:
module_obj.button_immediate_upgrade(request.cr, request.uid, module_ids, context=request.context)
return request.redirect(redirect)
good to go :)