[IMP] delivery, sale: use pricelist price in catalog

task-3076912

Part-of: odoo/odoo#135811
This commit is contained in:
Valentin Vallaeys (vava)
2023-09-28 18:20:19 +00:00
parent 24f295b988
commit 3c236e00c0
2 changed files with 10 additions and 4 deletions
+4 -2
View File
@@ -7,7 +7,9 @@ from odoo.addons.sale.controllers.catalog import CatalogController
class CatalogControllerDelivery(CatalogController):
@route()
def sale_product_catalog_update_sale_order_line_info(self, order_id, product_id, quantity):
def sale_product_catalog_update_sale_order_line_info(
self, order_id, product_id, quantity, **kwargs
):
""" Override of `sale` to recompute the delivery prices.
:param int order_id: The sale order, as a `sale.order` id.
@@ -18,7 +20,7 @@ class CatalogControllerDelivery(CatalogController):
:rtype: float
"""
price_unit = super().sale_product_catalog_update_sale_order_line_info(
order_id, product_id, quantity
order_id, product_id, quantity, **kwargs
)
order = request.env['sale.order'].browse(order_id)
if order:
+6 -2
View File
@@ -7,7 +7,7 @@ from odoo.tools import groupby
class CatalogController(Controller):
@route('/sales/catalog/sale_order_lines_info', auth='user', type='json')
def sale_product_catalog_get_sale_order_lines_info(self, order_id, product_ids):
def sale_product_catalog_get_sale_order_lines_info(self, order_id, product_ids, **kwargs):
""" Returns products information to be shown in the catalog.
:param int order_id: The sale order, as a `sale.order` id.
@@ -50,12 +50,15 @@ class CatalogController(Controller):
products=request.env['product.product'].browse(product_ids),
currency=order.currency_id,
date=order.date_order,
**kwargs,
).items()
})
return sale_order_line_info
@route('/sales/catalog/update_sale_order_line_info', auth='user', type='json')
def sale_product_catalog_update_sale_order_line_info(self, order_id, product_id, quantity):
def sale_product_catalog_update_sale_order_line_info(
self, order_id, product_id, quantity, **kwargs
):
""" Update sale order line information on a given sale order for a given product.
:param int order_id: The sale order, as a `sale.order` id.
@@ -77,6 +80,7 @@ class CatalogController(Controller):
quantity=1.0,
currency=sol.order_id.currency_id,
date=sol.order_id.date_order,
**kwargs,
)
sol.unlink()
return price_unit