1234567891011121314151617181920212223242526272829 |
- # -*- coding: utf-8 -*-
- from openerp.http import request
- _MODEL = 'res.currency'
- def check_base_currency():
- base_currency = request.env[_MODEL].search([('base', '=', True)])
- if not base_currency:
- request.env.user.company_id.currency_id.write({
- 'base': True
- })
- def get_base_currency():
- currency = request.env.user.company_id.currency_id
- return {
- 'id': currency.id,
- 'name': currency.display_name,
- 'base': currency.base,
- 'symbol': currency.symbol,
- 'position': currency.position,
- 'rateSilent': currency.rate_silent,
- 'decimalSeparator': currency.decimal_separator,
- 'decimalPlaces': currency.decimal_places,
- 'thousandsSeparator': currency.thousands_separator
- }
|