l10n-switzerland-flectra/l10n_ch_pain_base/models/account_move_line.py

19 lines
732 B
Python
Raw Normal View History

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).
from flectra import models, api
2021-06-30 06:38:22 +00:00
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
2021-06-30 06:38:22 +00:00
def _prepare_payment_line_vals(self, payment_order):
vals = super(AccountMoveLine, self)._prepare_payment_line_vals(
payment_order)
2021-08-23 18:26:34 +00:00
if self.move_id and self.move_id.reference_type in ['isr', 'QRR', 'SCOR']:
if self.move_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