From f983d71ea319a660833df3ab377b60954343ad56 Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Wed, 20 May 2026 18:20:02 +0200 Subject: [PATCH 1/2] [FIX] website_sale_aplicoop: fix account.tax access error and duplicate home-delivery handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add sudo() to pricelist_item and fiscal position fallback in _get_pricing_info so portal users can price the delivery product without triggering an AccessError on account.tax. Remove the redundant #home-delivery-btn click handler from website_sale.js — home_delivery.js already owns that button via bindShopHomeDeliveryButton(), which manages the active class and localStorage cart. Co-Authored-By: Claude Sonnet 4.6 --- .../controllers/website_sale_pricing.py | 4 ++-- .../static/src/js/website_sale.js | 22 ------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/website_sale_aplicoop/controllers/website_sale_pricing.py b/website_sale_aplicoop/controllers/website_sale_pricing.py index a4d7f7a..caeae9c 100644 --- a/website_sale_aplicoop/controllers/website_sale_pricing.py +++ b/website_sale_aplicoop/controllers/website_sale_pricing.py @@ -140,7 +140,7 @@ def _get_pricing_info( product=product, quantity=quantity, target_currency=currency ) price_before_discount = price - pricelist_item = env["product.pricelist.item"].browse(rule_id) + pricelist_item = env["product.pricelist.item"].sudo().browse(rule_id) if pricelist_item and pricelist_item._show_discount_on_shop(): price_before_discount = pricelist_item._compute_price_before_discount( product=product, @@ -155,7 +155,7 @@ def _get_pricing_info( fiscal_position = ( website.fiscal_position_id.sudo() if website and getattr(website, "fiscal_position_id", False) - else env["account.fiscal.position"] + else env["account.fiscal.position"].sudo() ) product_taxes = product.sudo().taxes_id._filter_taxes_by_company(company) taxes = fiscal_position.map_tax(product_taxes) if product_taxes else product_taxes diff --git a/website_sale_aplicoop/static/src/js/website_sale.js b/website_sale_aplicoop/static/src/js/website_sale.js index 5326427..d79d3b7 100644 --- a/website_sale_aplicoop/static/src/js/website_sale.js +++ b/website_sale_aplicoop/static/src/js/website_sale.js @@ -854,28 +854,6 @@ }); } - // Home-delivery toggle button (shop sidebar) - var homeDeliveryBtn = document.getElementById("home-delivery-btn"); - if (homeDeliveryBtn) { - // Restore persisted preference on page load - var storedDelivery = sessionStorage.getItem( - "eskaera_is_delivery_" + self.orderId - ); - if (storedDelivery === "true") { - homeDeliveryBtn.classList.add("active"); - } - homeDeliveryBtn.addEventListener("click", function (e) { - e.preventDefault(); - var isNowActive = !homeDeliveryBtn.classList.contains("active"); - homeDeliveryBtn.classList.toggle("active", isNowActive); - sessionStorage.setItem( - "eskaera_is_delivery_" + self.orderId, - isNowActive ? "true" : "false" - ); - console.log("[HOME_DELIVERY_BTN] toggled to:", isNowActive); - }); - } - // Buttons to clear cart (header + footer) var clearCartBtns = [ document.getElementById("clear-cart-btn"), From 07bd63253783ab12f8825cb637a2b050b6aebc98 Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Wed, 20 May 2026 18:23:55 +0200 Subject: [PATCH 2/2] [FIX] stock_picking_batch_custom: fix zebra striping selectors for Odoo 18 Replace old Odoo 16/17 class names (.o_list_view_table) with Odoo 18 equivalents (table.o_list_table, tr.o_data_row) so zebra striping renders correctly in the detailed operations list view. Co-Authored-By: Claude Sonnet 4.6 --- .../static/src/css/stock_picking_batch.css | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/stock_picking_batch_custom/static/src/css/stock_picking_batch.css b/stock_picking_batch_custom/static/src/css/stock_picking_batch.css index 52f70bb..dc6667a 100644 --- a/stock_picking_batch_custom/static/src/css/stock_picking_batch.css +++ b/stock_picking_batch_custom/static/src/css/stock_picking_batch.css @@ -1,18 +1,15 @@ -/* zebra striping for list views in this module */ +/* zebra striping for list views in this module (Odoo 18 selectors) */ -/* Target Odoo list/tree view tables. Use a specific, but broad selector to - avoid interfering globally with other modules. */ -.o_list_view .o_list_view_table tbody tr:nth-child(even) td { +table.o_list_table tbody tr.o_data_row:nth-child(even) td { background-color: rgba(0, 0, 0, 0.03); } -/* Slight hover contrast to improve row focus */ -.o_list_view .o_list_view_table tbody tr:hover td { +table.o_list_table tbody tr.o_data_row:hover td { background-color: rgba(0, 0, 0, 0.045); } -/* Ensure checkboxes / toggle columns maintain contrast */ -.o_list_view .o_list_view_table tbody tr:nth-child(even) td .o_field_widget, -.o_list_view .o_list_view_table tbody tr:nth-child(even) td .o_field_widget * { +/* Ensure field widgets inside striped rows stay transparent */ +table.o_list_table tbody tr.o_data_row:nth-child(even) td .o_field_widget, +table.o_list_table tbody tr.o_data_row:nth-child(even) td .o_field_widget * { background: transparent; }