| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 3 |
|
| 4 |
from odoo.http import request |
| 5 |
from odoo.addons.website_sale.controllers.main import WebsiteSale |
| 6 |
|
| 7 |
|
| 8 |
class WebsiteSaleSlides(WebsiteSale): |
| 9 |
|
| 10 |
def _prepare_shop_payment_confirmation_values(self, order): |
| 11 |
values = super()._prepare_shop_payment_confirmation_values(order) |
| 12 |
if order.order_line.product_id.channel_ids: |
| 13 |
channel_partners = request.env['slide.channel.partner'].sudo().search([ |
| 14 |
('partner_id', '=', order.partner_id.id), |
| 15 |
('channel_id', 'in', order.order_line.product_id.channel_ids.ids), |
| 16 |
]) |
| 17 |
values['course_memberships'] = { |
| 18 |
channel_partner.channel_id: channel_partner |
| 19 |
for channel_partner in channel_partners |
| 20 |
} |
| 21 |
return values |