[FIX] project: progate company in project on AA creation

When allowing timesheet on a project, the project generate
an analytic account if not given. When creating that account,
the company should be the one of the project (origin document)
rather than the one of the current user.

Task-1999686
This commit is contained in:
jem-odoo
2019-07-04 15:28:24 +00:00
parent ddb13a520f
commit 26bc10486e
+1 -1
View File
@@ -408,7 +408,7 @@ class Project(models.Model):
def _create_analytic_account_from_values(self, values):
analytic_account = self.env['account.analytic.account'].create({
'name': values.get('name', _('Unknown Analytic Account')),
'company_id': values.get('company_id', self.env.user.company_id.id),
'company_id': values.get('company_id') or self.env.company.id,
'partner_id': values.get('partner_id'),
'active': True,
})