From f10c03ac68dc01d94ccd637b299e684f4b65dbd2 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 30 Jul 2015 13:56:56 +0200 Subject: [PATCH] [FIX] sale: onchange task_work The unticked option in Sales settings "Prepare invoices based on task's activities" doesn't have to uninstall the options "Record timesheet lines per tasks" and "Generate tasks from sale orders" in Project settings. When "Prepare invoices based on task's activities" is unticked, this fix avoid to uninstall these options each time we go to Sales settings because "onchange_task_work" is triggered each time we go to Sales settings. opw:645833 --- addons/sale/res_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index 164213f1f59..697659c0df6 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -119,6 +119,8 @@ Example: Product: this product is deprecated, do not purchase more than 5. return {} def onchange_task_work(self, cr, uid, ids, task_work, context=None): + if not task_work: + return {'value': {}} return {'value': { 'module_project_timesheet': task_work, 'module_project_mrp': task_work,