Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] BI Views Editor (8.0) #47

Merged
merged 15 commits into from
Mar 21, 2016
Merged

[ADD] BI Views Editor (8.0) #47

merged 15 commits into from
Mar 21, 2016

Conversation

astirpe
Copy link
Member

@astirpe astirpe commented Mar 3, 2016

Some of you remember that, on 06/05/2015 during the Odoo Experience 2015, a prototype called "BI Views Builder" was shown.

That prototype became a nice product and finally its code is published.
Every comment, suggestion, review, PR would be very appreciated!

The BI Tool is a user-friendly tool (Query Builder) integrated in Odoo, that allows the user to specify graphically all the sources and the characteristics of the data-set to analyze, automating all the operations for creating all the necessary low level Odoo objects.

@dreispt
Copy link
Member

dreispt commented Mar 3, 2016

Thanks @astirpe.

I wish the README would expand a little more from the current one line description.
In particular, It's not evident for me what it intends to do.
A link to the OpenDays presentation would also be welcome.

@dreispt dreispt added this to the 8.0 milestone Mar 3, 2016
@astirpe
Copy link
Member Author

astirpe commented Mar 3, 2016

Thanks @dreispt !

Here is link regarding the talk https://www.odoo.com/event/odoo-experience-2015-2015-06-03-2015-06-05-304/track/bi-views-builder-for-odoo-8-249

It seems that the slides are not published... let me check better.

@astirpe
Copy link
Member Author

astirpe commented Mar 9, 2016

Here is the link to the Odoo Experience 2015 presentation: https://www.odoo.com/r/8RV

@max3903
Copy link
Member

max3903 commented Mar 9, 2016

@astirpe I made some tests using the partner object and 3 fields (City, Name and Email) using the first join method each time.

When I clicked on Generate BI View, I got this error message:

Traceback (most recent call last):
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/http.py", line 539, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/http.py", line 576, in dispatch
    result = self._call_function(**self.params)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/http.py", line 312, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/http.py", line 309, in checked_call
    return self.endpoint(*a, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/http.py", line 805, in __call__
    return self.method(*args, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/http.py", line 405, in response_wrap
    response = f(*args, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/addons/web/controllers/main.py", line 948, in call_button
    action = self._call_kw(model, method, args, {})
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/addons/web/controllers/main.py", line 936, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/api.py", line 399, in old_api
    result = method(recs, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/addons/bi_view_editor/models/bve_view.py", line 252, in action_create
    obj = _build_object()
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/addons/bi_view_editor/models/bve_view.py", line 203, in _build_object
    res_id = self.env['ir.model'].sudo().create(_prepare_object())
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/api.py", line 266, in wrapper
    return new_api(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/api.py", line 508, in new_api
    result = method(self._model, cr, uid, *args, **old_kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/addons/bi_view_editor/models/ir_model.py", line 199, in create
    res = super(IrModel, self).create(cr, user, vals, context)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/addons/base/ir/ir_model.py", line 223, in create
    model._auto_end(cr, ctx) # actually create FKs!
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/models.py", line 2711, in _auto_end
    cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d))
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/sql_db.py", line 158, in wrapper
    return f(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143005-47-1f2599/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
ProgrammingError: "x_bve_test" is not a table

- From the Reporting menu, select "Custom BI Views"
- Browse trough the business objects in the Query tab
- Pick the interesting fields (Drag & Drop)
- Save and click "Generate BI View"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@astirpe Please remove the space before the dash to make those lists, otherwise it adds an extra indentation.

@max3903
Copy link
Member

max3903 commented Mar 9, 2016

Any idea why Travis is not running?

@astirpe
Copy link
Member Author

astirpe commented Mar 9, 2016

Thank you @max3903 ! That error should be fixed.
Travis still not running...

@jjscarafia
Copy link

Hi @astirpe

  1. I create a new record (custom bi views record)
  2. I search for a model (ej. "bank")
  3. I click a filed (eg. "city")
  4. The field moves to section on the right but tabs freeze and I need to close it

I'm woring with chrome on ubuntu 14.04. I've already check it with firefox and also try restarting Ubuntu. I never had a freeze like this in odoo

Any idea?

Thanks!

@max3903
Copy link
Member

max3903 commented Mar 9, 2016

@astirpe Works now!

@jjscarafia I am also using Google Chrome on Ubuntu 14.04 and I was able to test on Runbot.

@max3903
Copy link
Member

max3903 commented Mar 9, 2016

@astirpe The icon and one screenshot are Onestein-branded which makes it less likely for people to contribute. Onestein is already listed as the author and also in the contributors. Can you come up with a more neutral icon and screenshot focused on the feature?

Otherwise 👍

@max3903
Copy link
Member

max3903 commented Mar 9, 2016

@astirpe Can you rebase please? I would like to see if the syntax issue in .travis.yml was the source of the problem.

@astirpe
Copy link
Member Author

astirpe commented Mar 9, 2016

@jjscarafia I'm trying with Chrome (V48) and Firefox (V38) but I'm not able to reproduce the freeze. I'm with Centos 7. Could you try to clear the cache of the browser?

@max3903 I've already removed every reference to Onestein on every image. But I agree about the colors, blue&yellow are still the same... cannot be left like that?

@max3903
Copy link
Member

max3903 commented Mar 9, 2016

@astirpe only if you promise it will never happen again :)

@astirpe
Copy link
Member Author

astirpe commented Mar 9, 2016

@max3903 😄 I cannot promise...
I'm going to rebase!

@astirpe
Copy link
Member Author

astirpe commented Mar 9, 2016

Travis not running, I just re-committed the previous commit...

@max3903
Copy link
Member

max3903 commented Mar 9, 2016

@astirpe You still don't have this commit in your branch:
e65c452

You need to rebase to get it:

git remote add oca git@github.com:OCA/reporting-engine.git
git fetch oca
git rebase -i oca/8.0

cf https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request#how-do-i-rebase

@mmalorni
Copy link

mmalorni commented Mar 9, 2016

@astirpe I was under the impression that changing the name of the field in the design view would display this label name in the BI_View but it keeps the name of the field. When you have two fields with the same name you cannot differentiate them in the BI_View.
If I am mistaken let me know.
Otherwise 👍
PS: I assume you need to modify the code to add more entities to link to?

@astirpe
Copy link
Member Author

astirpe commented Mar 9, 2016

@mmalorni , you are right, name of the fields are read from db and not from views. If you want to add more entities, I think it's more easy if you re-enter all the fields by using the graphical interface. Otherwise you can modify the code, but to me sounds more difficult. Actually the modification of a report already created is not yet supported.

@guewen
Copy link
Member

guewen commented Mar 10, 2016

Hi,

Tried on runbot. I selected the fields Country Name, Partner Name, Currency Symbol, created the BI View, clicked on Open BI View and got:

Traceback (most recent call last):
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 539, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 576, in dispatch
    result = self._call_function(**self.params)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 312, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 309, in checked_call
    return self.endpoint(*a, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 805, in __call__
    return self.method(*args, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 405, in response_wrap
    response = f(*args, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/addons/web/controllers/main.py", line 944, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/addons/web/controllers/main.py", line 936, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
AttributeError: 'NoneType' object has no attribute 'fields_view_get'

If I click on reset to draft:

Traceback (most recent call last):
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 539, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 576, in dispatch
    result = self._call_function(**self.params)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 312, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 309, in checked_call
    return self.endpoint(*a, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 805, in __call__
    return self.method(*args, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/http.py", line 405, in response_wrap
    response = f(*args, **kw)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/addons/web/controllers/main.py", line 948, in call_button
    action = self._call_kw(model, method, args, {})
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/addons/web/controllers/main.py", line 936, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/api.py", line 399, in old_api
    result = method(recs, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/addons/bi_view_editor/models/bve_view.py", line 93, in action_reset
    [('model', '=', self.model_name)]).unlink()
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/api.py", line 266, in wrapper
    return new_api(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/api.py", line 592, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **old_kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/addons/base/ir/ir_model.py", line 185, in unlink
    self._drop_table(cr, user, ids, context)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/addons/base/ir/ir_model.py", line 166, in _drop_table
    model_pool = self.pool[model.model]
  File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3143422-47-a5f92f/openerp/modules/registry.py", line 102, in __getitem__
    return self.models[model_name]
KeyError: u'x_bve.test'

@astirpe
Copy link
Member Author

astirpe commented Mar 10, 2016

@guewen , for some reasons, the reload of the registry fails and that error occurs when you try to re-create the view. I modified the reload of the registry, trying to fix that issue.
Thank you!

@elicoidal
Copy link

great contribution!

@guewen
Copy link
Member

guewen commented Mar 11, 2016

Great 👍

@fclementic2c
Copy link
Member

very cool - Shame that the Odoo BI perf is so bad.

@jgrandguillaume
Copy link
Member

HI,

This is a great module, I've tested it from a functional point of view and I've nothing to say. It is a great job ! From a "OCA standard" point of view, one little remark:

  • When seeing this module in the Apps list, we see the index.html text, look and feel instead of the README.RST => Can you remove the index file here : bi_view_editor/static/description/index.html

Once fix, I get my 👍

Thanks for contributing in OCA.

Regards,

Joël

@max3903
Copy link
Member

max3903 commented Mar 11, 2016

@OCA/tools-maintainers Any clue why Travis is not running?

Logs says missing config without much details:
https://travis-ci.org/OCA/reporting-engine/requests

@pedrobaeza
Copy link
Member

I have made #48 for seeing if Travis works with latest specifications.

@pedrobaeza
Copy link
Member

Isn't any possibility of integrating this editor with the materialized views develop by Anybox?

@guewen
Copy link
Member

guewen commented Mar 11, 2016

@OCA/tools-maintainers Any clue why Travis is not running?

Logs says missing config without much details:
https://travis-ci.org/OCA/reporting-engine/requests

Above this line we should have matrix: and the current matrix: should be global:

- VERSION="8.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"

For the record, I used https://lint.travis-ci.org/ to find the issue (note that this tools shows warning which are wrong, because it has not been updated to the latest travis format).

@pedrobaeza
Copy link
Member

#48 solves it

@pedrobaeza
Copy link
Member

@astirpe, please rebase your PR to make Travis work.

@jgrandguillaume
Copy link
Member

Thanks for the updates. 👍 to merge it.



class BveView(models.Model):
_name = 'bve.view'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing _description key here
alternate _name suggestion: bi.view.editor

@bealdav
Copy link
Member

bealdav commented Mar 21, 2016

Nice added value to odoo ecosystem.
I love your js widget with a text field.
In future versions it could be split as standalone widget for a better reuse.

Thanks a lot

@bealdav
Copy link
Member

bealdav commented Mar 21, 2016

As far I know, we have now 3 major components for dashboard:

  • mis
  • web_dashboard_tile
  • bi_view_editor

forgot one ?

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1ccf7bb on onesteinbv:80_add_bi_view_editor into * on OCA:8.0*.

@max3903
Copy link
Member

max3903 commented Mar 21, 2016

👍

max3903 pushed a commit that referenced this pull request Mar 21, 2016
@max3903 max3903 merged commit 0e9172c into OCA:8.0 Mar 21, 2016
@astirpe
Copy link
Member Author

astirpe commented Mar 21, 2016

Thanks to you all for the reviews!!

@max3903
Copy link
Member

max3903 commented Mar 21, 2016

@astirpe Can you review this easy one OCA/management-system#101 please?

@astirpe astirpe deleted the 80_add_bi_view_editor branch March 21, 2016 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.