From 87600e18bb05d506a974b78ebfca13c016afd540 Mon Sep 17 00:00:00 2001 From: Enrique Date: Wed, 9 Oct 2019 17:03:51 +0200 Subject: [PATCH] [12.0][FIX] contract & contract_sale - security fix The lowest model access for contract.contract model is group_account_invoice group. However the addon adds two smart buttons to res.partner view without any security restrictions and without compute_sudo attribute on computed fields. This causes the view to crash when a user without the proper permissions tries to access the res.partner form view. The solution adds groups_id to the partner form views in which the buttons are added, so the only loads when the user has proper permissions. Other way to solve it would be to add compute_sudo attribute to the relevant fields, but this causes an access error when the user clicks on the smart buttons. --- contract/views/res_partner_view.xml | 1 + contract_sale/__manifest__.py | 1 + contract_sale/views/res_partner_view.xml | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 contract_sale/views/res_partner_view.xml diff --git a/contract/views/res_partner_view.xml b/contract/views/res_partner_view.xml index 378f9cb3..cda22f4a 100644 --- a/contract/views/res_partner_view.xml +++ b/contract/views/res_partner_view.xml @@ -6,6 +6,7 @@ res.partner +