Skip to content

Commit a5090ac

Browse files
author
bosd
committed
[FIX] contract: portal contract page crashes on sale-order JS interaction
Opening a contract in the portal raised a client-side TypeError: can't access property "dataset", this.el.querySelector(...) is null at SaleUpdateLineButton.setup() The portal_contract_page template used the wrapper class "o_portal_sale_sidebar", which is the binding selector for the sale and sale_management frontend interactions (SaleSidebar, SaleUpdateLineButton, PortalPrepayment). SaleUpdateLineButton.setup() runs `this.el.querySelector("table#sales_order_table").dataset`, which is null on a contract page (no sale-order table) -> the whole interaction bundle throws and the page errors. The contract portal page needs no JS interaction, so switch to the neutral "o_portal_sidebar" class. Layout is pure bootstrap grid and is unaffected. Introduced by the portal contract page redesign (bbf9fa8).
1 parent e4057d6 commit a5090ac

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

contract/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
{
1414
"name": "Recurring - Contracts Management",
15-
"version": "19.0.1.1.3",
15+
"version": "19.0.1.1.4",
1616
"category": "Contract Management",
1717
"license": "AGPL-3",
1818
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",

contract/views/contract_portal_templates.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,17 @@
9393
/>
9494
</t>
9595
</t>
96-
<div class="row o_portal_sale_sidebar">
96+
<!--
97+
NB: do NOT use the class "o_portal_sale_sidebar" here. That
98+
class is the binding selector for the sale / sale_management
99+
frontend interactions (SaleSidebar, SaleUpdateLineButton,
100+
PortalPrepayment). SaleUpdateLineButton.setup() does
101+
`this.el.querySelector("table#sales_order_table").dataset`,
102+
which throws a TypeError on the contract page because there is
103+
no sale-order table here. The contract portal page needs no JS
104+
interaction, so use the neutral "o_portal_sidebar" class.
105+
-->
106+
<div class="row o_portal_sidebar">
97107
<div class="d-flex col-lg-4 col-xxl-3 d-print-none">
98108
<div
99109
id="sidebar_content"

0 commit comments

Comments
 (0)