Odoo Help

0

Is it possible to set default income/expense currency exchange account from code ?

By
WANTELLET Sylvain
on 3/26/13, 7:39 AM 1,505 views

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.

2

Mohammad Alhashash

--Mohammad Alhashash--
2070
| 5 5 8
Giza, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash
On 3/26/13, 8:16 AM

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 !

WANTELLET Sylvain
on 3/26/13, 9:50 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 3/26/13, 7:39 AM
Seen: 1505 times
Last updated: 3/16/15, 8:10 AM