[FIX] replaced invoice_id with move_id

This commit is contained in:
Raphael Ritter 2021-08-23 20:26:34 +02:00
parent 4c52882550
commit 8c01fd05d8

View File

@ -10,8 +10,8 @@ class AccountMoveLine(models.Model):
def _prepare_payment_line_vals(self, payment_order): def _prepare_payment_line_vals(self, payment_order):
vals = super(AccountMoveLine, self)._prepare_payment_line_vals( vals = super(AccountMoveLine, self)._prepare_payment_line_vals(
payment_order) payment_order)
if self.invoice_id and self.invoice_id.reference_type in ['isr', 'QRR', 'SCOR']: if self.move_id and self.move_id.reference_type in ['isr', 'QRR', 'SCOR']:
if self.invoice_id.reference_type == 'isr': if self.move_id.reference_type == 'isr':
vals['local_instrument'] = 'CH01' vals['local_instrument'] = 'CH01'
if vals['communication']: if vals['communication']:
vals['communication'] = vals['communication'].replace(' ', '') vals['communication'] = vals['communication'].replace(' ', '')