From ffee8f28396428a1b3775415fa3822442ffeaebd Mon Sep 17 00:00:00 2001 From: Shamnas Koyani Date: Mon, 27 Apr 2026 17:46:05 +0530 Subject: [PATCH] [FIX] contract: show smart buttons when partner has contracts The "Sale Contracts" and "Purchase Contracts" smart buttons on the partner form were hidden when customer_rank == 0 / supplier_rank == 0. Partners created outside the Sales/Purchase flows (e.g. via the Contacts module) keep these ranks at 0, so users could not reach linked contracts from the partner form even when they existed. Extend the invisible expression to also consider sale_contract_count and purchase_contract_count, which are already rendered by the statinfo widget on each button. A button is now shown whenever the partner has contracts of that type, regardless of rank. Closes #1412 --- contract/views/res_partner_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contract/views/res_partner_view.xml b/contract/views/res_partner_view.xml index 8e4a18ae21..859d9bf964 100644 --- a/contract/views/res_partner_view.xml +++ b/contract/views/res_partner_view.xml @@ -14,7 +14,7 @@ groups="account.group_account_invoice" icon="fa-book" context="{'default_contract_type': 'sale', 'contract_type': 'sale'}" - invisible="customer_rank == 0" + invisible="customer_rank == 0 and sale_contract_count == 0" help="Show the sale contracts for this partner" >