Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
4 Antwoorden
16665 Weergaven


Avatar
Annuleer
Beste antwoord

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
Avatar
Annuleer
Beste antwoord

how to get from the ODOO screen itself

Avatar
Annuleer
Beste antwoord

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,
 }

Avatar
Annuleer
Beste antwoord
self.env.company.currency_id
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
apr. 24
1618
2
jan. 24
1719
2
nov. 23
2582
1
mrt. 24
1911
1
mrt. 23
1949