From 8092e43d6f54e5421a3c9d9955862430f71dfd8f Mon Sep 17 00:00:00 2001 From: "Hansun (hale)" Date: Fri, 27 Jan 2023 14:55:04 +0000 Subject: [PATCH] [FIX] stock_account: Allow inventory users to view the bill To reproduce the issue: 1. On [Settings]>[Users & Companies]>[Users] add a user with: - admin rights to purchase and accounting, user right to inventory - admin rights to all three 2. Go to [Purchase], create a RFQ and click Create Bill 3. On the top right corner left of Receipt, Vendor Bills will be shown 4. It is only viewed by user with admin rights to all three apps Request: Allow Inventory users to view vendor bills as in pre-versions Applicable versions: 16.0 up to master opw-3135682 closes odoo/odoo#111564 X-original-commit: bee4d91d030e305ba8c44704a38c4fd8d614997b Signed-off-by: Adrien Widart Signed-off-by: Lee, Hansun (hale) --- addons/stock_account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/models/account_move.py b/addons/stock_account/models/account_move.py index d1601c4eed7..0a84779d207 100644 --- a/addons/stock_account/models/account_move.py +++ b/addons/stock_account/models/account_move.py @@ -16,7 +16,7 @@ class AccountMove(models.Model): for move in self: for line in move.line_ids: # if a line has correction layers hide the 'Reset to Darft' button - if line._get_stock_valuation_layers(move).stock_valuation_layer_ids.filtered('account_move_line_id'): + if line.sudo()._get_stock_valuation_layers(move).stock_valuation_layer_ids.filtered('account_move_line_id'): move.show_reset_to_draft_button = False break