From 24f295b9882bfe0ee195ec9bef1af2959efff31d Mon Sep 17 00:00:00 2001 From: "Valentin Vallaeys (vava)" Date: Mon, 18 Sep 2023 16:24:04 +0200 Subject: [PATCH] [FIX] delivery: fix delivery price in catalog controller Part-of: odoo/odoo#135811 --- addons/delivery/__init__.py | 1 + addons/delivery/controllers/catalog.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/delivery/__init__.py b/addons/delivery/__init__.py index 33bbab569d0..5b75d1ea8c5 100644 --- a/addons/delivery/__init__.py +++ b/addons/delivery/__init__.py @@ -1,4 +1,5 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. +from . import controllers from . import models from . import wizard diff --git a/addons/delivery/controllers/catalog.py b/addons/delivery/controllers/catalog.py index 7fd42447847..22ba59bf428 100644 --- a/addons/delivery/controllers/catalog.py +++ b/addons/delivery/controllers/catalog.py @@ -1,10 +1,12 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo.http import request, Controller +from odoo.http import request, route +from odoo.addons.sale.controllers.catalog import CatalogController -class CatalogController(Controller): +class CatalogControllerDelivery(CatalogController): + @route() def sale_product_catalog_update_sale_order_line_info(self, order_id, product_id, quantity): """ Override of `sale` to recompute the delivery prices. @@ -15,7 +17,7 @@ class CatalogController(Controller): the quantity selected. :rtype: float """ - price_unit = super.sale_product_catalog_update_sale_order_line_info( + price_unit = super().sale_product_catalog_update_sale_order_line_info( order_id, product_id, quantity ) order = request.env['sale.order'].browse(order_id)