Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
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
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati| Post correlati | Risposte | Visualizzazioni | Attività | |
|---|---|---|---|---|
|  | 1 apr 24  | 2287 | ||
|  | 2 gen 24  | 2251 | ||
| 
            
                Error message 
            
            
                    Risolto
            
         |  | 2 nov 23  | 3421 | |
| 
            
                change in currency configuration
            
            
                    Risolto
            
         |  | 1 mar 24  | 2603 | |
| 
            
                Currency automatic conversion 
            
            
                    Risolto
            
         |  | 1 mar 23  | 2599 | 
