Skip to content

Commit

Permalink
[IMP] improved views concerning categories & tags
Browse files Browse the repository at this point in the history
- added string "Partner-Tag" if the category refers to Partner-tags instead of worker category (fsm.category)
- added groups-access to tag-ids used in views, to only show tags if "manage tags" (fsm.tags) is enabled
- added groups-access to category_ids used in views, to only show category if "manage categories" (fsm.category) is enabled
  • Loading branch information
NICO-SOLUTIONS committed Aug 13, 2023
1 parent 7a3e97c commit c4bcd77
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
1 change: 1 addition & 0 deletions fieldservice/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Nils Coenen <nils.coenen@nico-solutions.de>
4 changes: 3 additions & 1 deletion fieldservice/views/fsm_location.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<field name="complete_name" />
<field
name="category_id"
string="Partner-Tags"
widget="many2many_tags"
options="{'color_field': 'color'}"
/>
Expand Down Expand Up @@ -154,6 +155,7 @@
<field
name="category_id"
widget="many2many_tags"
string="Partner-Tags"
options="{'color_field': 'color'}"
/>
</group>
Expand Down Expand Up @@ -299,7 +301,7 @@
<field name="country_id" />
<field name="description" />
<field name="tz" />
<field name="category_id" />
<field name="category_id" string="Partner-Tags" />
<field name="ref" />
<group expand="0" string="Group By">
<filter
Expand Down
17 changes: 11 additions & 6 deletions fieldservice/views/fsm_order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,19 @@
</div>
<group>
<group>
<field
name="type"
options="{'no_create': True, 'no_open': True}"
/>
<field
name="template_id"
groups="fieldservice.group_fsm_template"
/>
<field
name="type"
options="{'no_create': True, 'no_open': True}"
/>
<field name="priority" widget="priority" />
<field
name="tag_ids"
widget="many2many_tags"
groups="fieldservice.group_fsm_tag"
options="{'color_field': 'color', 'no_create_edit': True}"
/>
</group>
Expand Down Expand Up @@ -110,6 +111,7 @@
name="category_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
groups="fieldservice.group_fsm_category"
/>
<field name="request_early" />
<field name="request_late" />
Expand All @@ -130,13 +132,15 @@
>
<tree>
<field name="name" />
<field name="phone" />
<field name="email" />
<field
name="category_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
groups="fieldservice.group_fsm_category"
/>
<field name="phone" />
<field name="email" />
<field name="calendar_id" />
</tree>
</field>
</group>
Expand Down Expand Up @@ -296,6 +300,7 @@
<field
name="tag_ids"
widget="many2many_tags"
groups="fieldservice.group_fsm_tag"
options="{'color_field': 'color'}"
/>
</div>
Expand Down
4 changes: 3 additions & 1 deletion fieldservice/views/fsm_person.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
name="category_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
groups="fieldservice.group_fsm_category"
/>
<field name="calendar_id" />
</tree>
Expand All @@ -23,7 +24,7 @@
<field name="arch" type="xml">
<search string="Search FSM Workers">
<field name="name" />
<field name="category_ids" />
<field name="category_ids" groups="fieldservice.group_fsm_category" />
<field name="territory_ids" groups="fieldservice.group_fsm_territory" />
<field name="location_ids" />
</search>
Expand Down Expand Up @@ -100,6 +101,7 @@
name="category_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
groups="fieldservice.group_fsm_category"
/>
<label for="street" string="Address" />
<div class="o_address_format">
Expand Down
8 changes: 8 additions & 0 deletions fieldservice/views/fsm_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
<tree>
<field name="name" />
<field name="duration" />
<field name="type_id" />
<field
name="category_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
groups="fieldservice.group_fsm_category"
/>
<field name="team_id" groups="fieldservice.group_fsm_team" />
<field name="company_id" groups="base.group_multi_company" />
</tree>
</field>
Expand Down

0 comments on commit c4bcd77

Please sign in to comment.