From 929cfc26166d9bc59bd332a6f0533ae67ce65d80 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Mon, 7 Nov 2016 11:04:16 +0100 Subject: [PATCH] [FIX] sale_timesheet: stpo creating tasks in wrong project When confirming a SO as the admin, for example through the website_quote module, browse the product with the correct company to get the right project (this is a company_dependent field). --- addons/sale_timesheet/models/sale_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/sale_service.py b/addons/sale_timesheet/models/sale_service.py index d34b55f4708..04f41dbacee 100644 --- a/addons/sale_timesheet/models/sale_service.py +++ b/addons/sale_timesheet/models/sale_service.py @@ -54,7 +54,7 @@ class procurement_order(osv.osv): def _get_project(self, cr, uid, procurement, context=None): project_project = self.pool.get('project.project') - project = procurement.product_id.project_id + project = procurement.product_id.with_context(force_company=procurement.company_id.id).project_id if not project and procurement.sale_line_id: # find the project corresponding to the analytic account of the sales order account = procurement.sale_line_id.order_id.project_id