Skip to content

Commit

Permalink
[FIX] l10n_ar_account_withholding: trying to avoid
Browse files Browse the repository at this point in the history
closes #795

Signed-off-by: pablohmontenegro <pam@adhoc.com.ar>
  • Loading branch information
zaoral committed Jan 31, 2024
1 parent 61d9033 commit bfa6e11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion l10n_ar_account_withholding/models/account_tax.py
Expand Up @@ -258,7 +258,10 @@ def _compute_amount(
self, base_amount, price_unit, quantity=1.0, product=None, partner=None, fixed_multiplicator=1):
if self.amount_type == 'partner_tax':
date = self._context.get('invoice_date', fields.Date.context_today(self))
if not date:

# Parche para intentar que al intentar corregir el problema que surge al intentar consultar la alicuota
# para la fecha que estamos usando para forzar la actualizacion de la cotizacion
if not date or str(date) == '1970-01-01':
date = fields.Date.context_today(self)
partner = partner and partner.sudo()
return base_amount * self.sudo().get_partner_alicuota_percepcion(partner, date)
Expand Down

0 comments on commit bfa6e11

Please sign in to comment.