summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2019-01-28 12:28:20 +0000
committerJorge Pinna Puissant <jpp@odoo.com>2019-01-29 13:11:31 +0000
commite2e01013496961e3548bafb046f56f5db6bdfc8a (patch)
tree88040bb6f64f12d1c8dae2893cf6c1d6d6390854 /addons
parentf22fef1776e6c09321c367dc5ccf102e2c95a992 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/sale_timesheet/models/sale_order.py2
1 files changed, 1 insertions, 1 deletions
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