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.

18 lines
623 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 LasLabs Inc.
  3. # Copyright 2019 Therp BV <https://therp.nl>.
  4. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
  5. # pylint: disable=missing-docstring,protected-access
  6. from odoo import api, models
  7. class SaleOrder(models.Model):
  8. _inherit = 'sale.order'
  9. @api.multi
  10. def action_confirm(self):
  11. """ If we have a contract in the order, set it up """
  12. for order in self:
  13. # create_contract() already filters on contract order lines.
  14. order.order_line.create_contract()
  15. return super(SaleOrder, self).action_confirm()