[T2736] Non-existent account_id on tax. Using a method instead.

Merged Facundo Barral requested to merge T2736 into 15.0-preStable

Fixed error traceback:

File "/opt/odoo/auto/addons/l10n_ar_eynes/models/account_payment_order.py", line 907, in onchange_payment_line
    amount = self.payment_order_amount_hook()
  File "/opt/odoo/auto/addons/l10n_ar_eynes/models/account_payment_order.py", line 452, in payment_order_amount_hook
    amount += self.compute_advance_payment_retentions(amount)
  File "/opt/odoo/auto/addons/l10n_ar_eynes/models/account_payment_order.py", line 529, in compute_advance_payment_retentions
    retention_line_vals = self._prepare_advanced_payment_retention(
  File "/opt/odoo/auto/addons/l10n_ar_eynes/models/account_payment_order.py", line 546, in _prepare_advanced_payment_retention
    'account_id': advance_ret.retention_id.tax_id.account_id.id,
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
AttributeError: 'account.tax' object has no attribute 'account_id'
Edited by Facundo Barral

Merge request reports