Files
odoo_source/addons/delivery/controllers/catalog.py
T
Horacio Tellezandchevalierv 216fa84fbe [ADD] sale: add a products catalog view on the sale order
Currently, Fields Sales are struggling to create quotations or sale
orders directly from the customer place. One of the issues is that it
is not easy to quickly add products to the SO. Products must be added
one by one and, in mobile, it requires completing a form with
quantities, ... for each new line.  

This commit introduces a catalog view that allows users to select
products in a faster and easier way than before, both in desktop and
mobile view.

Task - 3062080

closes odoo/odoo#106382

Related: odoo/enterprise#37915
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: chevalierv <vcr@odoo.com>
2023-05-12 20:51:51 +02:00

25 lines
981 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.http import request, Controller
class CatalogController(Controller):
def sale_product_catalog_update_sale_order_line_info(self, order_id, product_id, quantity):
""" Override of `sale` to recompute the delivery prices.
:param int order_id: The sale order, as a `sale.order` id.
:param int product_id: The product, as a `product.product` id.
:param float quantity: The quantity selected in the product catalog.
:return: The unit price price of the product, based on the pricelist of the sale order and
the quantity selected.
:rtype: float
"""
price_unit = super.sale_product_catalog_update_sale_order_line_info(
order_id, product_id, quantity
)
order = request.env['sale.order'].browse(order_id)
if order:
order.onchange_order_line()
return price_unit