from openerp import api, fields, models class ResCurrency(models.Model): _inherit = 'res.currency' @api.model def get_currencies(self): domain = [('active', '=', True)] currencies = [] # if self.env.user.store_id: # domain.append(('company_id', '=', self.env.user.store_id.company_id.id)) # else: # domain.append(('company_id', '=', self.env.user.company_id.id)) # print domain for currency in self.env['res.currency'].search(domain): currencies.append({ 'id': currency.id, 'name': currency.name, 'display_name': currency.display_name, 'accuracy': currency.accuracy, 'base': currency.base, 'position': currency.position, 'rate': currency.rate, 'rounding': currency.rounding, 'symbol': currency.symbol, 'company': { 'id': currency.company_id.id, 'name': currency.company_id.name } }) return currencies