From 997c371a560752fcd7fad7cffdeff4376a2530f4 Mon Sep 17 00:00:00 2001 From: "Thomas Lefebvre (thle)" Date: Wed, 24 Aug 2022 11:11:17 +0000 Subject: [PATCH] [FIX] sale, account: disable selection with a private address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to repoduce: - create a customer with a private address (first select "individual" to show the selection field) - create a quotation (and/or invoice) and select this customer - this customer cannot receive an email and cannot be contacted afterwards (this behavior is intended) Issue: - it's possible to choose this type of client Cause: - there is no address type filter for this field Solution: - add a condition in the domain of the field opw-2909395 closes odoo/odoo#100487 X-original-commit: a24384b7ede2a132125d24681cba7056bc64ccbe Signed-off-by: Lefebvre Thomas (thle) Signed-off-by: William André (wan) --- addons/account/views/account_move_views.xml | 1 + addons/sale/models/sale_order.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 0405e16e14d..57bc310bda5 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -773,6 +773,7 @@ context="{ 'res_partner_search_mode': (context.get('default_move_type', 'entry') in ('out_invoice', 'out_refund', 'out_receipt') and 'customer') or (context.get('default_move_type', 'entry') in ('in_invoice', 'in_refund', 'in_receipt') and 'supplier') or False, 'show_address': 1, 'default_is_company': True, 'show_vat': True}" + domain="[('type', '!=', 'private'), ('company_id', 'in', (False, company_id))]" options='{"always_reload": True, "no_quick_create": True}' attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"/>