res_currency.py 299 B

123456789101112
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request
  3. _MODEL = 'res.currency'
  4. def check_base_currency():
  5. base_currency = request.env[_MODEL].search([('base', '=', True)])
  6. if not base_currency:
  7. request.env.user.company_id.currency_id.write({
  8. 'base': True
  9. })