bank-payment/account_banking_mandate_sale/wizard/sale_make_invoice_advance.py

18 lines
586 B
Python
Raw Permalink Normal View History

2021-03-23 19:28:51 +00:00
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from flectra import models, api
class SaleAdvancePaymentInv(models.TransientModel):
_inherit = 'sale.advance.payment.inv'
@api.multi
def _create_invoice(self, order, so_line, amount):
"""Copy mandate from sale order to invoice"""
inv = super(SaleAdvancePaymentInv, self)._create_invoice(
order, so_line, amount)
if order.mandate_id:
inv.mandate_id = order.mandate_id.id
return inv