Commit 0a460ee8 authored by Daniel Santibáñez Polanco's avatar Daniel Santibáñez Polanco
Browse files

Cambios relacionados a la moneda

parent e313743f
......@@ -107,6 +107,12 @@ class Exportacion(models.Model):
return True
return False
def currency_base(self):
result = super(Exportacion, self).currency_base()
if not self._es_exportacion():
return result
return self.currency_id
def _totales_normal(self, currency_id, MntExe, MntNeto, IVA, TasaIVA,
MntTotal=0, MntBase=0):
if not self._es_exportacion():
......@@ -141,17 +147,6 @@ class Exportacion(models.Model):
Totales['MntTotOtrMnda'] = MntTotal
return Totales
def _aplicar_gdr(self, MntExe):
gdr = self.porcentaje_dr()
MntExe *= gdr
return self.currency_id.round( MntExe )
def _totales(self, MntExe=0, no_product=False, taxInclude=False):
MntExe, MntNeto, MntIVA, TasaIVA, MntTotal, MntBase = super(Exportacion, self)._totales(MntExe, no_product, taxInclude)
if self._es_exportacion():
MntExe = self._aplicar_gdr(MntExe)
return MntExe, MntNeto, MntIVA, TasaIVA, MntTotal, MntBase
def _bultos(self, bultos):
Bultos = []
for b in bultos:
......@@ -251,5 +246,12 @@ class Exportacion(models.Model):
res = super(Exportacion, self)._encabezado(MntExe, no_product, taxInclude)
if not self._es_exportacion():
return res
if not res.get('OtraMoneda'):
another_currency_id = self.env.ref('base.CLP').with_context(
MntExe, MntNeto, IVA, TasaIVA, MntTotal, MntBase = self._totales(MntExe, no_product, taxInclude)
res['OtraMoneda'] = self._totales_otra_moneda(
another_currency_id, MntExe, MntNeto, IVA, TasaIVA,
MntTotal, MntBase)
res['Transporte'] = self._transporte()
return res
# -*- coding: utf-8 -*-
from odoo import fields, models, api, _
class Exportacion(models.Model):
_name = "account.invoice.exportacion"
......@@ -15,7 +14,6 @@ class Exportacion(models.Model):
r.total_bultos = tot_bultos
def _get_tot_from_recargos(self):
for r in self:
mnt_seguro = 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment