trunk: olap indentation Error

Bug #620791 reported by Ana Juaristi Olalde
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
Amit Parik

Bug Description

Selecting bussiness intelligence on configuration wizard to be installed I obtain this error:

    import olap
  File "/home/ana/openerp6.0/server/bin/addons/olap/olap.py", line 37, in <module>
    import cube
  File "/home/ana/openerp6.0/server/bin/addons/olap/cube/__init__.py", line 3, in <module>
    from warehouse import warehouse
  File "/home/ana/openerp6.0/server/bin/addons/olap/cube/warehouse.py", line 92
     pooler.get_pool(cr.dbname).get('olap.query.logs').write(cr, uid, log_ids, {'count':counter, 'table_name': table_name})
    ^
 IndentationError: expected an indented block

I just solved including correct indentation on line 92 of file warehouse.py, as shown below.
                    elif len(data[0]) == 3:
                        pooler.get_pool(cr.dbname).get('olap.query.logs').write(cr, uid, log_ids, {'count':counter, 'table_name': table_name})

Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Ana,

   I have checked the issue. But at my end it's not giving any error. I have also checked the code it's in proper indentation. Would you please update the code and check.

Thanks.

Changed in openobject-addons:
milestone: none → 6.0
status: New → Invalid
Revision history for this message
Marco Dieckhoff (dieck) wrote :

Appears in extra-trunk and extra-6.0.

In extra-6.0, revisions 4664, 4666 and 4672 removed several print statements.

In olap/cube/warehouse.py, this lead, around line 92, from

_ _ _ _ _ _ _ _ elif len(data[0]) == 3:
_ _ _ _ _ _ _ _ _ _ _ _ print "Its for Pages:>>>>>>>>>"
_ _ _ _ pooler.get_pool(cr.dbname).get('olap.query.logs').write(cr, uid, log_ids, {'count':counter, 'table_name': table_name})
_ _ _ _ return True

to

_ _ _ _ _ _ _ _ elif len(data[0]) == 3:
_ _ _ _ pooler.get_pool(cr.dbname).get('olap.query.logs').write(cr, uid, log_ids, {'count':counter, 'table_name': table_name})
_ _ _ _ return True

thus creating the indentation error.
The elif line has to be removed as well.

Changed in openobject-addons:
status: Invalid → Confirmed
Revision history for this message
Marco Dieckhoff (dieck) wrote :

And yes, it's extra addons, but the print removals were made by ksa (Kirti Savalia) from OpenERP.
I can't assign to him (or her?).

Amit Parik (amit-parik)
Changed in openobject-addons:
milestone: 6.0 → none
affects: openobject-addons → openobject-client
Changed in openobject-client:
assignee: nobody → Amit Parik (OpenERP) (amp-openerp)
importance: Undecided → Low
affects: openobject-client → openobject-addons
Amit Parik (amit-parik)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

Thanks for the reporting.

It has been fixed in lp:openobject-addons/extra-trunk

5333 <email address hidden>

Revision num:5333

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Released
Revision history for this message
Marco Dieckhoff (dieck) wrote :

Please note that it was also modified in extra-6.0, and backport to that. Thanks.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Marco,

It has been also fixed in extra-6.0 with following rev no.
5447 <email address hidden>

Thanks.

Revision history for this message
Marco Dieckhoff (dieck) wrote :

You changed the indentation of pooler.get_pool... to match the elif part.

That's plain WRONG!
You changed the workings of the code.

Please look at the original code, and what it did, in the revisions I mentioned above and my comment #2.

Before, there was a print command in the elif part. NOTHING ELSE.
The pooler line was executed every time, together with return True, even one hierachical level up from elif.

Now it's only executed in the elif case.

Amit Parik (amit-parik)
Changed in openobject-addons:
status: Fix Released → In Progress
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Marco,

Thanks for your reply!
According to comment#2 I have fixed it again.

extra-6.0 5448 <email address hidden>
extra-trunk 5334 <email address hidden>

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.