Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
The company model (res.company) has a many2one to the company currency, so in v8 and later you can use:
self.env.ref('base.main_company').currency_id
how to get from the ODOO screen itself
Hi,
You can do as following:
def _get_currency(self, cr, uid, context=None):
user_obj = self.pool.get('res.users')
currency_obj = self.pool.get('res.currency')
user = user_obj.browse(cr, uid, uid, context=context)
if user.company_id:
return user.company_id.currency_id.id
else:
return currency_obj.search(cr, uid, [('rate', '=', 1.0)])[0]
_defaults = {
'currency': _get_currency,
}
self.env.company.currency_id
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
|
1
Apr. 24
|
1586 | ||
|
2
Jan. 24
|
1693 | ||
Error message
Gelöst
|
|
2
Nov. 23
|
2530 | |
|
1
März 24
|
1841 | ||
|
1
März 23
|
1909 |