You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
579 B

  1. # -*- coding: utf-8 -*-
  2. # © 2017 Akretion (http://www.akretion.com)
  3. # @author: Alexis de Lattre <alexis.delattre@akretion.com>
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from odoo import models
  6. class SaleAdvancePaymentInv(models.TransientModel):
  7. _inherit = 'sale.advance.payment.inv'
  8. def _create_invoice(self, order, so_line, amount):
  9. inv = super(SaleAdvancePaymentInv, self)._create_invoice(
  10. order, so_line, amount)
  11. if order.agreement_id:
  12. inv.agreement_id = order.agreement_id.id
  13. return inv