2013-04-11 43 views
3
<?xml version="1.0" ?> 
<openerp> 
    <data> 
     <record model="ir.module.category" id="module_lunch_category"> 
      <field name="name">Lunch</field> 
      <field name="description">Helps you handle your lunch needs, if you are a manager you will be able to create new products, cashmoves and to confirm or cancel orders.</field> 
      <field name="sequence">16</field> 
     </record> 
     <record id="group_lunch_user" model="res.groups"> 
      <field name="name">User</field> 
      <field name="category_id" ref="module_lunch_category"/> 
     </record> 
     <record id="group_lunch_manager" model="res.groups"> 
      <field name="name">Manager</field> 
      <field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/> 
      <field name="category_id" ref="module_lunch_category"/> 
      <field name="users" eval="[(4, ref('base.user_root'))]"/> 
     </record> 
    </data> 
</openerp> 

我現在堅持了安全處理,以我的application.its代碼顯示hereOpenERP的第7版 - 爲交代的security.xml

我指的文檔也爲澄清上述XML代碼。但我沒有在documentation.i版本7中得到很好的解釋。我需要在下面的章節中進行說明。請諮詢我得到明確的想法吧

請解釋

ir.module.category手段?

<record model="ir.module.category" id="module_lunch_category"> 

model =「res.groups」是指。

<record id="group_lunch_user" model="res.groups"> 

需要澄清以下全行

<field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/> 

回答

11
1. <record model="ir.module.category" id="module_lunch_category"> 

這使用如採購,倉庫,或者你自己的模塊,您的應用程序名稱來創建類別。對於屬於此模​​塊的特定組,它只是您模塊的名稱 與您的模塊名稱bpl一樣,則在ir.module.category中創建一個BPL

2. <record id="group_lunch_user" model="res.groups"> 

這是用來爲這個應用程序創建組,比如你創建的用戶,你想給訪問該用戶的應用程序,那麼你這個組添加到您的用戶。

示例爲了您想要給某些菜單的安全性原因,某些字段可以通過不同的用戶明智地訪問,因此您可以創建組。就像你創建「USER」和MANAGER組。

<record model="res.groups" id="group_bpl_manager"> 
      <field name="name">Manager</field> 
     </record> 


<record model="res.groups" id="group_bpl_user"> 
      <field name="name">User</field> 
     </record> 

您創建的,在經理組,這兩個組可以訪問所有的菜單和各個領域,但用戶羣的機會有限,所以其用戶要充分訪問您分配馬槽羣和有限的訪問,則您將用戶組分配給該用戶。

3.<field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/> 

在本組的用戶可以定義自動繼承這些羣體當你將這個組,它會自動訪問也是在這一領域implied_ids給出的所有組的任何用戶手段。當你分配給一些用戶

舉例BPL經理組,你也想assing許多其他組到用戶,當您assing這一組中,然後添加了許多其他羣體到這個組中的「繼承」 implied_ids領域

+0

非常感謝我的朋友......我在Twitter上回復您的答案:-) – 2013-04-12 08:15:23

2

您也可以參考OpenERP中的Base,Sale,Account,Purchase,Manufacturing,Stock ...模塊,以供參考。他們都在安全方面得到良好的維護。

+0

感謝朋友:-) – 2013-04-12 08:17:25