From 884fe142353f353eb436178b958c8dd4bb55b40e Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Mon, 25 Jun 2018 10:34:18 +0200 Subject: [PATCH] [FIX] sale_timesheet: prevent CRUD from plan project for SO/INV When coming from the project overview throught the sale orders, or invoices stat buttons, creating the object will not linked it to the project. This might confuse the users. The CRUD operation should be prevent from there, as this is reporting. --- addons/sale_timesheet/controllers/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale_timesheet/controllers/main.py b/addons/sale_timesheet/controllers/main.py index 975c8543785..5101a699f0b 100644 --- a/addons/sale_timesheet/controllers/main.py +++ b/addons/sale_timesheet/controllers/main.py @@ -414,7 +414,9 @@ class SaleTimesheetController(http.Controller): elif res_model == 'sale.order': action = clean_action(request.env.ref('sale.action_orders').read()[0]) action['domain'] = domain + action['context'] = {'create': False, 'edit': False, 'delete': False} # No CRUD operation when coming from overview elif res_model == 'account.invoice': action = clean_action(request.env.ref('account.action_invoice_tree1').read()[0]) action['domain'] = domain + action['context'] = {'create': False, 'edit': False, 'delete': False} # No CRUD operation when coming from overview return action