Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-seRelated Posts | Respostes | Vistes | Activitat | |
---|---|---|---|---|
|
1
d’abr. 24
|
1295 | ||
|
2
de gen. 24
|
1415 | ||
Error message
Solved
|
|
2
de nov. 23
|
2210 | |
|
1
de març 24
|
1598 | ||
|
1
de març 23
|
1631 |