2021-06-30 06:38:22 +00:00
|
|
|
# copyright 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
|
2021-07-21 11:01:38 +00:00
|
|
|
from flectra import models, api
|
2021-06-30 06:38:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AccountMoveLine(models.Model):
|
2021-07-21 11:01:38 +00:00
|
|
|
_inherit = 'account.move.line'
|
2021-06-30 06:38:22 +00:00
|
|
|
|
|
|
|
def _prepare_payment_line_vals(self, payment_order):
|
2021-07-21 11:01:38 +00:00
|
|
|
vals = super(AccountMoveLine, self)._prepare_payment_line_vals(
|
|
|
|
payment_order)
|
|
|
|
if self.invoice_id and self.invoice_id.reference_type in ['isr', 'QRR', 'SCOR']:
|
|
|
|
if self.invoice_id.reference_type == 'isr':
|
|
|
|
vals['local_instrument'] = 'CH01'
|
|
|
|
if vals['communication']:
|
|
|
|
vals['communication'] = vals['communication'].replace(' ', '')
|
2021-06-30 06:38:22 +00:00
|
|
|
return vals
|