|
@@ -1,5 +1,5 @@
|
|
# -*- coding: utf-8 -*-
|
|
# -*- coding: utf-8 -*-
|
|
-from openerp import models, fields
|
|
|
|
|
|
+from openerp import models, fields, api
|
|
|
|
|
|
class ResCurrency(models.Model):
|
|
class ResCurrency(models.Model):
|
|
_inherit = 'res.currency'
|
|
_inherit = 'res.currency'
|
|
@@ -9,3 +9,32 @@ class ResCurrency(models.Model):
|
|
decimal_places = fields.Integer(string='Decimal Places', default=0, required=True)
|
|
decimal_places = fields.Integer(string='Decimal Places', default=0, required=True)
|
|
thousands_separator = fields.Selection([('.', '.'),(',', ',')],'thousands Separator', default=".", required=True)
|
|
thousands_separator = fields.Selection([('.', '.'),(',', ',')],'thousands Separator', default=".", required=True)
|
|
symbol_position = fields.Selection([('before', 'Antes del importe'),('after', 'Después del importe')],'Symbol Position', default="before", required=True)
|
|
symbol_position = fields.Selection([('before', 'Antes del importe'),('after', 'Después del importe')],'Symbol Position', default="before", required=True)
|
|
|
|
+
|
|
|
|
+ @api.model
|
|
|
|
+ def currency_utility(self):
|
|
|
|
+ # Actualizar Moneda Guarani
|
|
|
|
+ currency_pyg = self.env['res.currency'].search([('name', '=', 'PYG')])
|
|
|
|
+ currency_pyg.write({
|
|
|
|
+ 'decimal_separator': ',',
|
|
|
|
+ 'decimal_places': 0,
|
|
|
|
+ 'thousands_separator' : '.',
|
|
|
|
+ 'symbol_position' : 'before'
|
|
|
|
+ } )
|
|
|
|
+
|
|
|
|
+ # Actualizar Moneda Rela - Peso
|
|
|
|
+ currency_brl_ars = self.env['res.currency'].search([('name', 'in', ['BRL','ARS'])])
|
|
|
|
+ currency_brl_ars.write({
|
|
|
|
+ 'decimal_separator': ',',
|
|
|
|
+ 'decimal_places': 2,
|
|
|
|
+ 'thousands_separator': '.',
|
|
|
|
+ 'symbol_position': 'before'
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ # Actualizar Moneda Dolar
|
|
|
|
+ currency_usd = self.env['res.currency'].search([('name', '=', 'USD')])
|
|
|
|
+ currency_usd.write({
|
|
|
|
+ 'decimal_separator': '.',
|
|
|
|
+ 'decimal_places': 2,
|
|
|
|
+ 'thousands_separator': ',',
|
|
|
|
+ 'symbol_position': 'before'
|
|
|
|
+ })
|