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

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.

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

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>
Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you !

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 4 24
1944
0
thg 1 24
1046
2
thg 12 19
7133
0
thg 3 15
4434
0
thg 3 15
4037