From fc986dc22dbc44e93c6d122fbad1a71d472c9651 Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Mon, 23 Nov 2020 13:46:08 +0000 Subject: [PATCH] [FIX] account,sale: let a user print his invoices If a user has no access to Invoicing module, he can not send and print his invoices. To reproduce the error: (Need sale_management,account) 1. Connect with admin account 2. Settings > Users & Companies 3. Create/Edit a salesman - Remove access rights to Invoicing module 4. Connect with this user 5. Create & Confirm a SO 6. Edit the SO and fill in the "Delivered" field, Save 7. Click on "Create Invoice", "Create Invoice" 7. Connect with admin account 8. Invoicing > Go to the previously created invoice 9. Confirm it 10. Connect with the user account 11. Sales > previously created SO > "1 Invoices" => The user can read the invoice, but he can not send and print it. This is an error. OPW-2389428 closes odoo/odoo#64508 X-original-commit: f64f7ca309f9228e58b1487a286f2302ff8f035e Signed-off-by: Adrien Widart --- addons/account/security/account_security.xml | 7 +++++++ addons/account/views/account_move_views.xml | 6 ++---- addons/sale/security/ir.model.access.csv | 1 + addons/sale/security/sale_security.xml | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index fd9b95655b7..6fc42d68ea8 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -260,6 +260,13 @@ + + Readonly Invoice Send and Print + + [(1, '=', 1)] + + + Analytic Default multi company rule diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 9b2b89dada9..4f029a9dd82 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -543,13 +543,11 @@ type="object" string="Send & Print" attrs="{'invisible':['|', '|', ('state', '!=', 'posted'), ('is_move_sent', '=', True), ('move_type', 'not in', ('out_invoice', 'out_refund'))]}" - class="oe_highlight" - groups="account.group_account_invoice"/> + class="oe_highlight"/>