[7.0] menu item does'nt appear correctly

Bug #1226086 reported by Sylvain LE GAL (GRAP)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenUpgrade Server
Fix Released
Medium
Unassigned

Bug Description

Hi,

I just discover a bug in the migration project. The new menu items don't seem to appear for users.

Reproduce the bug :
- Create a 7.0 database and log into ;
- In the "Settings" menu, in "modules" submenu, there is a "Apps" item. -> OK

- Create a 6.1 database ;
- do migration & connect to the database ;
- In the "Settings" menu, in "modules" submenu, there is no a "Apps" item. -> KO.

More generally, the new menuitems don't appear for users.
(My problem is not for the "Apps" menu, but more for others . ;-) )

Did you note the same behaviour ?

Related branches

Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Hi again !

I searched a little about my problem and I found one weird behaviour.

After upgrade, in ir_ui_menu, all my news items are without parent_left and parent_right values.
in 7.0, 'ir.ui.menu' is _parent_store. (Not in 6.1).

It appears that during the migration the compute of parent_left & right works for existing values but not for news.
[LOG during migration, at the beginning] : Computing parent left and right for table ir_ui_menu...

This 2 lines fix the bug but it's just a workaround. (I exactly don't know if the problem comes from openobject or openupgrade).
Maybe the problem can occur for other new _parent_store model too ...

### Workaround :
# In the end of the migration (in the file "deffered_70.py" for exemple) :
my_obj = pool.get('ir.ui.menu')
my_obj._parent_store_compute(cr)

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Excellent find, thank you!

Your analysis makes sense because _parent_store is new for ir.ui.menu in 7.0. Then again, the orm actually checks wether _parent_store is new to an existing model and then runs _parent_store by itself so I am wondering why this did not take place during the upgrade automatically.

When I test this out, I find that this is what happens when the base module is upgraded. The logs say "Computing parent left and right for table ir_ui_menu" at that moment. Immediately afterwards, the parent columns are all consistent. After the upgrade of the other modules have finished, there are gaps in the parent_left/right columns. When I run an --upgrade all again, the columns are filled.

I don't have an explanation right now for the gaps in parent_left/right which seem to come up during the upgrade of the other modules. I think it would be good to implement the workaround that you suggest, and created a branch with it.

Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Hi !

The gap come from new value created by data.xml files. But I don't know either why creating new items by data.xml doesn't update parent_left/right value. (the first time, but if there is a second upgrade, it works...)

Thanks for the new branch !

+++

Changed in openupgrade-server:
status: New → 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.