[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).
This commit is contained in:
Damien Bouvy
2016-11-07 11:45:59 +01:00
parent 229fab5fa0
commit 929cfc2616
+1 -1
View File
@@ -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