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

I created a module that has a few extra models, and menu.

but to actual users to see them i need to create user group witha new application, and assign this to the users in the user form Access Right panel. I tried creating this Via XML and managed to createa group with this:

security/ng_office_technology_security.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">

    <record id="ng_office_technology.office_technology_group" model="res.groups">
        <field name="name">Office technology</field>
        <field name="comment">Office Technology Permission Group.</field>
    </record>

</data>
</openerp>

this creates a group but i don't know how to create an application in the drop down menu, in the group creation form.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I managed to do it with a few hours of searching in the XMLs:

security/ng_office_technology_security:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">

    <record id="office_technology_group" model="res.groups">
        <field name="name">Office technology</field>
        <field name="comment">Office Technology Permission Group.</field>
        <field name="category_id" ref="ng_office_technology.module_category_ng_office_technology"/>
    </record>
    <record model="ir.module.category" id="module_category_ng_office_technology">
            <field name="name">Office Technology</field>
            <field name="description">The Office technology Applilcation</field>
            <field name="sequence">20</field>
    </record>
</data>
</openerp>

and this creates an application drop down menu in the user form's access right panel, with the groups that has been set to that category.

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

I'm trying to do something like this but I dont understand where do you get the name in "ref=ng_office_technology.module_category_ng_office_technology" ? It shouldn't be ref="module_category_ng_office_technology"? Sorry my ignorance... Thanks

And how do I do the file ir.model.access.csv? Is it needed ?

Tác giả

@Anabela Damas the ref="ng_office_technology.module_category_ng_office_technology" is just simple "module_name.category_name" it just specifies where to look for it. and as for csv i can only advice to look at other modules CSV thatts how i managet to work it out.

I manage to do it , thanks

Câu trả lời hay nhất
  <record model="ir.module.category" id="module_category_ng_office_technology">
            <field name="name">Office Technology</field>
            <field name="description">The Office technology Applilcation</field>
            <field name="sequence">10</field>
    </record>

Put this line of code in your security XML file before as you write group then add this line in your group
<field name="category_id" ref="module_category_ng_office_technology
"/>

Then restart your server
Thanks
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 5 24
45827
1
thg 3 23
2196
1
thg 12 22
24669
1
thg 11 21
5593
2
thg 9 21
10536