Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
6356 Lượt xem

I have a module already installed inside my project with a couple of new tables. Now, I want to add XML associated with these tables to create menu items.

In my openerp.py, I had this code:

 'data': ['main.xml', 'security/ir.model.access.csv']

Now, I want to add a new file containing my XML:

 'data': ['main.xml', 
          'trips.xml',
          'security/ir.model.access.csv']

trips.xml looks like this:

<openerp>
    <data>

        <record id="action_partner_trip_form" model="ir.actions.act_window">
            <field name="name">Trips</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.partner.trip</field>
            <field name="view_type">form</field>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a new trip.
              </p>
            </field>
        </record>

        <menuitem action="action_partner_trip_form" name="Trips" sequence="4" parent="base.menu_sales" groups="base.group_no_one"/>
    </data>
</openerp>

I restarted the server and also updated my main package, but the new XML is not loaded into the application. Also, there are no errors inside my logs.

Of course, if I uninstall -> reinstall it, my XML is loaded and my menu items are added, but I lose precious data.

Ảnh đại diện
Huỷ bỏ

What do you mean 'updated my main package'? You need to upgrade your module, the custom one that has all this code in it.

Tác giả

Hey,

Sorry for the naming, I updated my custom module yep!

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 6 20
20271
1
thg 3 23
5710
2
thg 2 23
3072
1
thg 12 22
5287
0
thg 4 17
4898