Debian Codegraph @

addons/website_sale_collect/models/payment_transaction.py

raw symbols SCIP
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
2
3 from odoo import models
4
5
6 class PaymentTransaction(models.Model):
7 _inherit = 'payment.transaction'
8
9 def _post_process(self):
10 """ Override of `payment` to confirm orders with the on_site payment method and trigger
11 a picking creation. """
12 on_site_pending_txs = self.filtered(
13 lambda tx: tx.provider_id.custom_mode == 'on_site' and tx.state == 'pending'
14 )
15 on_site_pending_txs.sale_order_ids.filtered(
16 lambda so: so.state == 'draft'
17 ).with_context(send_email=True).action_confirm()
18 super()._post_process()