12345678910111213141516171819202122232425262728293031323334 |
- # -*- coding: utf-8 -*-
- from openerp.http import request
- def check_base_currency():
- company_currency = request.env.user.company_id.currency_id
- other_currencies = request.env['res.currency'].search([('base', '=', True), ('id', '!=', company_currency.id)])
- if other_currencies:
- for c in other_currencies:
- c.write({
- 'base': False
- })
- if not company_currency.base:
- company_currency.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
- }
|