[IMP] delivery, sale: use pricelist price in catalog
task-3076912 Part-of: odoo/odoo#135811
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user