2013-10-14 73 views
0

我想設置默認帳戶對於某些字段,爲我寫這樣設置其他科目覈算模塊

<!--  1.Income account–311000     --> 
    <record forcecreate="True" id="property_account_income_product" model="ir.property"> 
     <field name="name">property_account_income</field> 
     <field name="fields_id" search="[('model','=','product.template'),('name','=','property_account_income')]"/> 
     <field eval="'account.account,'+str(account_account_456)" name="value"/> 
     <field name="company_id" ref="base.main_company"/> 
    </record> 

在account.account.template一些代碼,我寫的代碼像

<record model="account.account.template" id="account_account_456"> 
       <field name="name">INCOME FROM SALES</field> 
       <field name="code">311000</field> 
       <field name="type">other</field> 
       <field name="user_type" ref="account.data_account_type_income"/> 
       <field name="reconcile" eval="False"/> 
       <field name="parent_id" ref="account_account_256"/> 
     </record> 

但更新數據庫後它設置不同的帳戶 我不知道爲什麼,但沒有設置正確的帳戶 請幫我 謝謝...

現在,我得到確切的問題,首先我把記錄在account.account.template這一紀錄也被自動添加到account.account,當我嘗試添加記錄到ir.property搜索該帳戶進去。 account.template採取ID和account.account

顯示記錄,所以這個問題是ID不匹配在account.accountaccount.account.template 如何解決這個問題,對不起英語

回答

0

這是因爲您必須在model="ir.property"中爲您的公司在property_account_income_product字段中輸入多個條目,因此當您嘗試查看a/c的值時,您會發現第一個值在字段中設置,因爲您的記錄可能是列表中的第二個值,所以它沒有被選中。

+0

我想爲字段property_account_income不是爲property_account_income_product並且沒有其他字段property_account_income –