Skip to content

Commit

Permalink
fix view attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
brian10048 committed Nov 16, 2023
1 parent a8d1dd1 commit b511ea3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
6 changes: 3 additions & 3 deletions fieldservice/views/fsm_location.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
/></span>
<br />
<span
attrs="{'invisible': [('date_localization', '=', False)]}"
invisible="not date_localization"
>Updated on:
<field
name="date_localization"
Expand All @@ -237,7 +237,7 @@
<br />
</span>
<button
attrs="{'invisible': ['|', ('partner_latitude', '!=', 0), ('partner_longitude', '!=', 0)]}"
invisible="(partner_latitude != 0) or (partner_longitude != 0)"
icon="fa-gear"
string="Compute based on address"
title="Compute Localization"
Expand All @@ -246,7 +246,7 @@
class="btn btn-link p-0"
/>
<button
attrs="{'invisible': [('partner_latitude', '=', 0), ('partner_longitude', '=', 0)]}"
invisible="partner_latitude == partner_longitude == 0"
icon="fa-refresh"
string="Refresh"
title="Refresh Localization"
Expand Down
10 changes: 5 additions & 5 deletions fieldservice/views/fsm_order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
class="oe_highlight"
type="object"
groups="fieldservice.group_fsm_user"
attrs="{'invisible': [('stage_id', 'in', (%(fieldservice.fsm_stage_completed)d, %(fieldservice.fsm_stage_cancelled)d))]}"
invisible="stage_id.is_closed"
/>
<button
id="action_cancel"
name="action_cancel"
string="Cancel Order"
type="object"
groups="fieldservice.group_fsm_dispatcher"
attrs="{'invisible': [('stage_id', 'in', (%(fieldservice.fsm_stage_completed)d, %(fieldservice.fsm_stage_cancelled)d))]}"
invisible="stage_id.is_closed"
/>
<field
name="stage_id"
Expand Down Expand Up @@ -75,7 +75,7 @@
<field name="internal_type" invisible="1" />
<field
name="equipment_id"
attrs="{'invisible':[('internal_type', 'not in',['repair', 'maintenance'])]}"
invisible="internal_type not in ['repair', 'maintenance']"
groups="fieldservice.group_fsm_equipment"
options="{'no_create': True}"
domain="[('current_location_id','=',location_id)]"
Expand Down Expand Up @@ -180,11 +180,11 @@
string="Equipments"
groups="fieldservice.group_fsm_equipment"
name="equipements_page"
attrs="{'invisible': [('internal_type', 'in', ['repair', 'maintenance'])]}"
invisible="internal_type in ['repair', 'maintenance']"
>
<field
name="equipment_ids"
attrs="{'required': [('internal_type', 'not in', ['repair', 'maintenance'])]}"
required="internal_type not in ['repair', 'maintenance']"
options="{'no_create': True}"
domain="[('current_location_id','=',location_id)]"
>
Expand Down
13 changes: 6 additions & 7 deletions fieldservice/views/fsm_person.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<field
name="active_partner"
Expand All @@ -74,12 +74,11 @@
/>
<div
class="alert alert-info text-center o_form_header"
attrs="{'invisible': [
'|', '|',
'&amp;', ('active', '=', True), ('active_partner', '=', True),
'&amp;', ('active', '=', False), ('active_partner', '=', False),
'&amp;', ('active', '=', True), ('active_partner', '=', False),
]}"
invisible="
(active and active_partner) or
(not active and not active_partner) or
(active and not active_partner)
"
role="alert"
>
<a class="close" data-dismiss="alert" href="#">x</a>
Expand Down
2 changes: 1 addition & 1 deletion fieldservice/views/fsm_stage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<group>
<group>
Expand Down
2 changes: 1 addition & 1 deletion fieldservice/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<button
class="oe_stat_button"
type="object"
attrs="{'invisible': [('owned_location_count', '=', 0)]}"
invisible="owned_location_count = 0"
name="action_open_owned_locations"
icon="fa-map-marker"
context="{'default_owner_id': id}"
Expand Down

0 comments on commit b511ea3

Please sign in to comment.