Code review comment for lp:~sylvain-legal/web-addons/7.0-web_easy_switch_company

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

there is a client action for reloading the application (called after the installation of a module for instance).

Asking a reload from the server can be done by returning:

          return {
            'type': 'ir.actions.client',
            'tag': 'reload',
            'params': {
                'menu_id': menu_id
            },
          }

I'm not sure, but I think you can call it from javascript with

    self.do_action('reload');

You can inspect the client action in web/static/src/js/chrome.js +784 (instance.web.Reload).
I don't know how the reload will behave though, ie if it will stay on the current page.

In the __init__.py modules, could you replace the absolute imports with relative ones, so instead of:
    import model
write:
    from . import model
This is a good habit because if an egg or an openerp module is named model, it could import it instead of your module.

Thanks!

review: Needs Fixing (code review)

« Back to merge proposal