Skip to content

Commit

Permalink
[MIG] project_role: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiadavid committed Apr 7, 2024
1 parent 79b08bf commit f6483aa
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion project_role/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Project Roles",
"version": "16.0.1.0.3",
"version": "17.0.1.0.0",
"category": "Project",
"website": "https://github.com/OCA/project",
"author": "CorporateHub, Odoo Community Association (OCA)",
Expand Down
3 changes: 2 additions & 1 deletion project_role/models/project_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def _check(self):
):
if assignment.project_id:
error = _(
"User %(USER)s can not be assigned to role %(ROLE)s on %(PROJECT)s."
"User %(USER)s can not be assigned to role %(ROLE)s on "
"%(PROJECT)s."
) % {
"USER": assignment.user_id.name,
"ROLE": assignment.role_id.name,
Expand Down
4 changes: 3 additions & 1 deletion project_role/models/project_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def _project_role_create_assignment_values(self, vals_list):
for values in vals_list:
company = None
if values.get("company_id"):
company = companies.filtered(lambda c: c.id == values["company_id"])
company = companies.filtered(
lambda c, v=values: c.id == v["company_id"]
)
if company and "inherit_assignments" not in values:
values["inherit_assignments"] = company.project_inherit_assignments

Expand Down
8 changes: 2 additions & 6 deletions project_role/views/project_assignment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<field name="active" invisible="1" />
<group>
Expand Down Expand Up @@ -48,11 +48,7 @@
<field name="arch" type="xml">
<tree editable="top">
<field name="company_id" groups="base.group_multi_company" />
<field
name="project_id"
domain="[('active', '=', True)]"
invisible="context.get('default_project_id', False)"
/>
<field name="project_id" domain="[('active', '=', True)]" />
<field name="role_id" />
<field name="user_id" domain="[('active', '=', True)]" />
</tree>
Expand Down
10 changes: 10 additions & 0 deletions project_role/views/project_project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
<field name="limit_role_to_assignments" />
</group>
</page>
<notebook position="inside">
<page name="assignments" string="Assignments">
<field name="assignment_ids">
<tree>
<field name="role_id" />
<field name="user_id" />
</tree>
</field>
</page>
</notebook>
</field>
</record>
</odoo>
2 changes: 1 addition & 1 deletion project_role/views/project_role.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<field name="active" invisible="1" />
<group>
Expand Down
2 changes: 1 addition & 1 deletion project_role/views/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="project.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@data-key='project']" position="inside">
<xpath expr="//app[@name='project']" position="inside">
<div name="section_roles_and_assignments">
<h2>Roles &amp; Assignments</h2>
<div class="row mt16 o_settings_container">
Expand Down

0 comments on commit f6483aa

Please sign in to comment.