mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 15:52:01 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import sale
|
||||
from . import slides
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.http import request
|
||||
from odoo.addons.website_sale.controllers.main import WebsiteSale
|
||||
|
||||
|
||||
class WebsiteSaleSlides(WebsiteSale):
|
||||
|
||||
def _prepare_shop_payment_confirmation_values(self, order):
|
||||
values = super()._prepare_shop_payment_confirmation_values(order)
|
||||
if order.order_line.product_id.channel_ids:
|
||||
channel_partners = request.env['slide.channel.partner'].sudo().search([
|
||||
('partner_id', '=', order.partner_id.id),
|
||||
('channel_id', 'in', order.order_line.product_id.channel_ids.ids),
|
||||
])
|
||||
values['course_memberships'] = {
|
||||
channel_partner.channel_id: channel_partner
|
||||
for channel_partner in channel_partners
|
||||
}
|
||||
return values
|
||||
|
|
@ -8,10 +8,10 @@ from odoo.tools import format_amount
|
|||
|
||||
class WebsiteSaleSlides(WebsiteSlides):
|
||||
|
||||
@route('/slides/get_course_products', type='json', auth='user')
|
||||
@route('/slides/get_course_products', type='jsonrpc', auth='user')
|
||||
def get_course_products(self):
|
||||
"""Return a list of the course products values with formatted price."""
|
||||
products = request.env['product.product'].search([('detailed_type', '=', 'course')])
|
||||
products = request.env['product.product'].search([('service_tracking', '=', 'course')])
|
||||
|
||||
return [{
|
||||
'id': product.id,
|
||||
|
|
@ -25,9 +25,7 @@ class WebsiteSaleSlides(WebsiteSlides):
|
|||
# search the product to apply ACLs, notably on published status, to avoid access errors
|
||||
product = request.env['product.product'].search([('id', '=', channel.product_id.id)]) if channel.product_id else request.env['product.product']
|
||||
if product:
|
||||
pricelist = request.website.get_current_pricelist()
|
||||
values['product_info'] = channel.product_id.product_tmpl_id._get_combination_info(product_id=channel.product_id.id, pricelist=pricelist)
|
||||
values['product_info']['currency_id'] = request.website.currency_id
|
||||
values['product_info'] = product._get_combination_info_variant()
|
||||
else:
|
||||
values['product_info'] = False
|
||||
return values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue