Merge lp:~openerp/openobject-addons/share-web-addons into lp:openobject-addons
Proposed by
Vaibhav Darji
Status: | Merged |
---|---|
Merged at revision: | 3948 |
Proposed branch: | lp:~openerp/openobject-addons/share-web-addons |
Merge into: | lp:openobject-addons |
Diff against target: |
140 lines (+81/-2) 5 files modified
share/__openerp__.py (+1/-0) share/web/__init__.py (+2/-0) share/web/controllers.py (+31/-0) share/web/editors.py (+41/-0) share/wizard/share_wizard.py (+6/-2) |
To merge this branch: | bzr merge lp:~openerp/openobject-addons/share-web-addons |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xavier (Open ERP) (community) | Needs Fixing | ||
Review via email: mp+40504@code.launchpad.net |
Description of the change
Web addon for share module.
To post a comment you must log in.
Business problems:
* share_root_url is not provided to the share.wizard object, so we don't get any URL (let alone a useable one) to send to the clients
Other than that it seems to work correctly
Technical issues in controllers.py (mostly):
* I don't think `active=False` is necessary in the share module descriptor
* There are a bunch of unused variables and imports in controllers.py (urlparse, cherrypy, TinyDict, filter_domain)
* By the way why is filter_domain sent but not used?
* Usage of **kwargs even though we know perfectly well what is going to be sent. Why not use regular method parameters and have
def index(self, domain, search_domain, context)
rather than the current completely opaque signature
* Why send `view_type` in the JS call if it's not used?
* No need for the `proxy` intermediate variable, it's used only once and doesn't make the code any clearer. It should be inlined
* Likewise with `res`, why not inline it into the `actions.execute` call? It provides no value.
* `model` should be renamed to something clearer (what model to what is it?) and maybe made into a module-level constant, it's not like there's much point defining it in the method
* Why not use keyword arguments in the `context.update` call? I don't think the explicit dict is clearer, let alone faster
* What happens if no action is found? E.g. if there is no view_name in the context? Or if there is no action found for that name? Wouldn't everything kind-of blow up? Please check/test (share.wizard seems to require an action_id, and I doubt None or an empty list is going to work). If it can not happen then we might as well not bother with the checking code line 24-26, and if it's going to blow up anyway sooner better than later, save yourself the RPC call. This means again line 24-26 can probably be simplified.
Technical issues in editors.py:
* Why style=right on the link? It's a regular link, it should not be needed.
* Why create a bunch of temp variables in the JS code? Why not just inline them in the dict/object literal? Their ids seem clear enough to understand what they are.
* Because of "fixed" behavior of actions, you should not open new window yourself as you're just opening an action. Framework will manage, so handler should just set the correct @href on the link.
* Don't use an initial @href of `javascript: void(0)`, use `#` or `#share` instead.
* Title of section is no good, what does "Share View" mean? Especially as a sidebar title? Something like "Sharing" is probably more appropriate that way it opens possibility of new modules building on that and adding stuff in the section.
That's pretty much it for now.