javascript - Reload Custom view type on click each time-Odoo8 -


  • i have created new view type form view , when create new thing form view , switch custom view see no update till refresh whole site. want know how reload custom view able retrieve data each time click on custom view.
  • i have created view on java script , work except reloading data each time click view.
  • i found code , have called function in views.js, inherit core web module

    var zoser_book = new openerp.model('zoser.book');       zoser_book.call('reload_controller'[view_type]).then(function(reload_ok){ console.log(reload_ok); }); 
  • then in python did this:

    def reload_controller(self, cr, uid, view_type, context = none): model_obj = self.pool.get('ir.model.data') print model_obj data_id = model_obj._get_id(cr, uid, 'zoser_book', 'zoser_book_views') print data_id view_id = model_obj.browse(cr, uid, data_id).res_id print view_id return {     'type': 'ir.actions.act_window',     'name': _('string'),     'res_model': 'zoser.book',     'view_type': 'bookview',     'view_mode': 'bookview',     'view_id': view_id,     'target': 'current',     'nodestroy': true, } 
  • but still see no update if add new book form view , switch custom view no update till refresh whole site.

try this

return { 'type': 'ir.actions.client', 'tag': 'reload', 'target':'inline', } 

hope you.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -