次のようなコードを書くために、いくつかのフィールドのデフォルトアカウントを設定しようとしています
<!-- 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.account.templateにIDを取得して表示しますaccount.account からの記録
問題はaccount.accountとaccount.account.templateの id の不一致です この問題を解決する方法と英語で申し訳ありません