[FIX] website_sale_aplicoop: evitar x2 en carrito y mostrar /Kg en granel
This commit is contained in:
parent
6628e17fef
commit
7e13ffef07
3 changed files with 15 additions and 1 deletions
|
|
@ -367,7 +367,7 @@ class AplicoopWebsiteSale(WebsiteSale):
|
|||
product_price_info: dict with price data keyed by product.id.
|
||||
|
||||
Returns:
|
||||
dict with display_price, safe_uom_category, quantity_step
|
||||
dict with display_price, safe_uom_category, quantity_step, price_unit_suffix
|
||||
"""
|
||||
price_data = product_price_info.get(product.id, {})
|
||||
price = (
|
||||
|
|
@ -379,6 +379,7 @@ class AplicoopWebsiteSale(WebsiteSale):
|
|||
|
||||
uom_category_name = ""
|
||||
quantity_step = 1
|
||||
price_unit_suffix = ""
|
||||
|
||||
if product.uom_id:
|
||||
uom = product.uom_id.sudo()
|
||||
|
|
@ -404,6 +405,8 @@ class AplicoopWebsiteSale(WebsiteSale):
|
|||
full_xmlid = f"{external_id.module}.{external_id.name}"
|
||||
if full_xmlid in fractional_categories:
|
||||
quantity_step = 0.1
|
||||
if full_xmlid == "uom.product_uom_categ_kgm":
|
||||
price_unit_suffix = "/Kg"
|
||||
except Exception as e:
|
||||
_logger.warning(
|
||||
"_prepare_product_display_info: Error detecting UoM category XML ID for product %s: %s",
|
||||
|
|
@ -415,6 +418,7 @@ class AplicoopWebsiteSale(WebsiteSale):
|
|||
"display_price": price_safe,
|
||||
"safe_uom_category": uom_category_name,
|
||||
"quantity_step": quantity_step,
|
||||
"price_unit_suffix": price_unit_suffix,
|
||||
}
|
||||
|
||||
def _get_pricing_info(self, product, pricelist, quantity=1.0, partner=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue