From e2e01013496961e3548bafb046f56f5db6bdfc8a Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Mon, 28 Jan 2019 12:28:20 +0000 Subject: [PATCH] [FIX] sale_timesheet: project from SO in multicompany Have a product of type service with : - Service tracking : Create a task in a new project - Project template : A project of the company - Re-invoicing Policy : No Create a SO with the product, and validate it. Before this commit, when the project was generated. It was generated in the company of the super user, and not in the company of the SO. Now, the project is generated in the company of the SO. OPW-1927005 closes odoo/odoo#30607 --- addons/sale_timesheet/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_timesheet/models/sale_order.py b/addons/sale_timesheet/models/sale_order.py index 9f7613ccf51..75e7953e903 100644 --- a/addons/sale_timesheet/models/sale_order.py +++ b/addons/sale_timesheet/models/sale_order.py @@ -51,7 +51,7 @@ class SaleOrder(models.Model): def _action_confirm(self): """ On SO confirmation, some lines should generate a task or a project. """ result = super(SaleOrder, self)._action_confirm() - self.mapped('order_line').sudo()._timesheet_service_generation() + self.mapped('order_line').sudo().with_context(default_company_id=self.company_id.id)._timesheet_service_generation() return result @api.multi