Skip to content

Commit

Permalink
Merge pull request #18 from onesteinbv/16.0-fix-project_role
Browse files Browse the repository at this point in the history
[FIX] project_role: pass company from env rather than users default company to prevent multicompany issues and use avatar_128 for user image
  • Loading branch information
ByteMeAsap authored Apr 24, 2024
2 parents d21925c + 0cb31c0 commit d03d5ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions project_role/models/project_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class ProjectProject(models.Model):
@api.model
def _default_inherit_assignments(self):
company = self.env["res.company"].browse(
self._context.get("company_id", self.env.user.company_id.id)
self._context.get("company_id", self.env.company.id)
)
return company.project_inherit_assignments

@api.model
def _default_limit_role_to_assignments(self):
company = self.env["res.company"].browse(
self._context.get("company_id", self.env.user.company_id.id)
self._context.get("company_id", self.env.company.id)
)
return company.project_limit_role_to_assignments

Expand Down
2 changes: 1 addition & 1 deletion project_role/tests/test_project_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setUp(self):
self.Project = self.env["project.project"]
self.Role = self.env["project.role"]
self.Assignment = self.env["project.assignment"]
self.company_id = self.env.user.company_id
self.company_id = self.env.company

def test_create_assignment(self):
user = self.ResUsers.sudo().create(
Expand Down
2 changes: 1 addition & 1 deletion project_role/views/project_assignment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="row">
<div class="col-2">
<img
t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)"
t-att-src="kanban_image('res.users', 'avatar_128', record.user_id.raw_value)"
t-att-title="record.user_id.value"
t-att-alt="record.user_id.value"
width="40"
Expand Down

0 comments on commit d03d5ce

Please sign in to comment.