[FIX] website_sale_aplicoop: Fix multiple flake8 warnings
- B007: Rename unused loop variable 'cat_id' to '_cat_id' - F841: Remove unused variable 'current_user' in eskaera_shop - F841: Remove unused variable 'is_delivery' in save_cart_draft - E741: Rename ambiguous lambda variable 'l' to 'line' - F841: Remove unused exception variable 'e' in confirm_eskaera - F841: Remove unused variable 'current_group_order' in confirm_order_from_portal
This commit is contained in:
parent
1f37f289ba
commit
a128c1ee1e
1 changed files with 3 additions and 8 deletions
|
|
@ -293,7 +293,7 @@ class AplicoopWebsiteSale(WebsiteSale):
|
||||||
|
|
||||||
# Identificar categorías raíz (sin padre en la lista) y organizar jerarquía
|
# Identificar categorías raíz (sin padre en la lista) y organizar jerarquía
|
||||||
roots = []
|
roots = []
|
||||||
for cat_id, cat_info in category_map.items():
|
for _cat_id, cat_info in category_map.items():
|
||||||
parent_id = cat_info["parent_id"]
|
parent_id = cat_info["parent_id"]
|
||||||
|
|
||||||
# Si el padre no está en la lista de categorías disponibles, es una raíz
|
# Si el padre no está en la lista de categorías disponibles, es una raíz
|
||||||
|
|
@ -359,7 +359,6 @@ class AplicoopWebsiteSale(WebsiteSale):
|
||||||
Soporta búsqueda y filtrado por categoría.
|
Soporta búsqueda y filtrado por categoría.
|
||||||
"""
|
"""
|
||||||
group_order = request.env["group.order"].browse(order_id)
|
group_order = request.env["group.order"].browse(order_id)
|
||||||
current_user = request.env.user
|
|
||||||
|
|
||||||
if not group_order.exists():
|
if not group_order.exists():
|
||||||
return request.redirect("/eskaera")
|
return request.redirect("/eskaera")
|
||||||
|
|
@ -1071,7 +1070,6 @@ class AplicoopWebsiteSale(WebsiteSale):
|
||||||
# Get cart items and pickup date
|
# Get cart items and pickup date
|
||||||
items = data.get("items", [])
|
items = data.get("items", [])
|
||||||
pickup_date = data.get("pickup_date") # Date from group_order
|
pickup_date = data.get("pickup_date") # Date from group_order
|
||||||
is_delivery = data.get("is_delivery", False) # If home delivery selected
|
|
||||||
|
|
||||||
if not items:
|
if not items:
|
||||||
return request.make_response(
|
return request.make_response(
|
||||||
|
|
@ -1586,7 +1584,7 @@ class AplicoopWebsiteSale(WebsiteSale):
|
||||||
|
|
||||||
# Find if product already exists in draft
|
# Find if product already exists in draft
|
||||||
existing_line = existing_draft.order_line.filtered(
|
existing_line = existing_draft.order_line.filtered(
|
||||||
lambda l: l.product_id.id == product_id
|
lambda line: line.product_id.id == product_id
|
||||||
)
|
)
|
||||||
|
|
||||||
if existing_line:
|
if existing_line:
|
||||||
|
|
@ -1753,7 +1751,7 @@ class AplicoopWebsiteSale(WebsiteSale):
|
||||||
# Convert to int
|
# Convert to int
|
||||||
try:
|
try:
|
||||||
order_id = int(order_id)
|
order_id = int(order_id)
|
||||||
except (ValueError, TypeError) as e:
|
except (ValueError, TypeError):
|
||||||
_logger.warning("confirm_eskaera: Invalid order_id: %s", order_id)
|
_logger.warning("confirm_eskaera: Invalid order_id: %s", order_id)
|
||||||
return request.make_response(
|
return request.make_response(
|
||||||
json.dumps({"error": f"Invalid order_id format: {order_id}"}),
|
json.dumps({"error": f"Invalid order_id format: {order_id}"}),
|
||||||
|
|
@ -2110,9 +2108,6 @@ class AplicoopWebsiteSale(WebsiteSale):
|
||||||
# Store items in localStorage by passing via URL parameter or session
|
# Store items in localStorage by passing via URL parameter or session
|
||||||
# We'll use sessionStorage in JavaScript to avoid URL length limits
|
# We'll use sessionStorage in JavaScript to avoid URL length limits
|
||||||
|
|
||||||
# Get the current group order for comparison
|
|
||||||
current_group_order = request.env["group.order"].browse(group_order_id)
|
|
||||||
|
|
||||||
# Check if the order being loaded is from the same group order
|
# Check if the order being loaded is from the same group order
|
||||||
# If not, don't restore the old pickup fields - use the current group order's fields
|
# If not, don't restore the old pickup fields - use the current group order's fields
|
||||||
same_group_order = sale_order.group_order_id.id == group_order_id
|
same_group_order = sale_order.group_order_id.id == group_order_id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue