تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5679 أدوات العرض

I would like to set default income/expense currency exchange account for example from the _default in the code. Is it possible to set the link from an account.account.template to an account.account ? Because I know the template external id, and there is no account external id.

الصورة الرمزية
إهمال
أفضل إجابة

Yes, you can use search attribute to look up the account using the name instead of xml id.

  <record id="base.main_company" model="res.company">
    <field name="income_currency_exchange_account_id"
           search="[('name', '=', 'Currency Exchange Gain')]" />
    <field name="expense_currency_exchange_account_id"
           search="[('name', '=', 'Currency Exchange Loss')]" />
  </record>
الصورة الرمزية
إهمال
الكاتب

Thank you !

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أبريل 24
1929
0
يناير 24
1046
2
ديسمبر 19
7108
0
مارس 15
4422
0
مارس 15
4029