[trunk] Cannot properly override tree view functionality

Asked by Stefan Rijnhart (Opener)

Hi,

We are having a lot of fun creating web addons based on the new architecture. You did a great job with that!

However, we are now running in to trouble with the openerp.web.TreeView class, which is used to display a 'proper' tree, not a list. We are implementing an addon that expands the path in the tree down given a specially crafted act_window that contains the active record. In order to do so, we cannot simply tag on to the on_loaded method, but need to copy it instead together with a large chunk of other code as it contains asynchronous code that does not return its promise, and we depend on that code having been executed.

Replacing a class method by a copy is of course heresy to the whole design of the web client and makes loading two independent addons that work on the same piece of code impossible.

To see what I mean, please have a look at addons/web/static/src/js/view_tree.js (see [1]). My guess would be to make the callback function that you pass to dataset.read_slice() a named method on the class, and make it pass the promise that TreeView.getdata() should pass in its turn so that we can tag on to that method instead.

Cheers,
Stefan.

[1] http://bazaar.launchpad.net/~openerp/openerp-web/trunk/view/head:/addons/web/static/src/js/view_tree.js#L89

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Web (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Stefan Rijnhart (Opener)
Solved:
Last query:
Last reply:
Revision history for this message
Amit Parik (amit-parik) said :
#1

Hello,

It's not a bug rather than a question, So I am converting this into question...
Also I would like to request to XMO or any web team member please give a answer of this question.

Thank you!

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#2

Hi Amit,

Its not a question, it's a request for an API change!

Cheers,
Stefan.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#3

Problem 'solved' as bug is set to confirmed again.