|
1 | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
2 | 2 | <odoo> |
3 | | - <!-- Extend Program Form: add geofences to Overview tab --> |
| 3 | + <!-- Extend Program Form: add geofences to Configuration tab --> |
4 | 4 | <record id="view_program_form_geofence" model="ir.ui.view"> |
5 | 5 | <field name="name">spp.program.form.geofence</field> |
6 | 6 | <field name="model">spp.program</field> |
7 | | - <field name="inherit_id" ref="spp_programs.view_program_list_form" /> |
8 | | - <field name="priority">99</field> |
| 7 | + <field name="inherit_id" ref="spp_programs.view_program_form_config_cards" /> |
| 8 | + <field name="priority">101</field> |
9 | 9 | <field name="arch" type="xml"> |
10 | 10 | <!-- Add stat button for geofence count --> |
11 | 11 | <xpath expr="//div[hasclass('oe_button_box')]" position="inside"> |
|
20 | 20 | </button> |
21 | 21 | </xpath> |
22 | 22 |
|
23 | | - <!-- Add geofences to Overview tab --> |
| 23 | + <!-- Add Geographic Scope card before the Eligibility section --> |
24 | 24 | <xpath |
25 | | - expr="//group[@name='additional_overview_section']" |
26 | | - position="attributes" |
| 25 | + expr="//page[@name='configuration']//div[hasclass('card')][1]" |
| 26 | + position="before" |
27 | 27 | > |
28 | | - <attribute name="invisible">0</attribute> |
29 | | - </xpath> |
30 | | - <xpath |
31 | | - expr="//group[@name='additional_overview_section']" |
32 | | - position="inside" |
33 | | - > |
34 | | - <separator string="Geographic Scope" colspan="2" /> |
35 | | - <field |
36 | | - name="geofence_ids" |
37 | | - nolabel="1" |
38 | | - colspan="2" |
39 | | - readonly="state == 'ended'" |
40 | | - > |
41 | | - <list delete="1" editable="bottom"> |
42 | | - <field name="name" readonly="1" /> |
43 | | - <field name="geofence_type" optional="hide" readonly="1" /> |
44 | | - <field name="area_sqkm" string="Area (sq km)" readonly="1" /> |
45 | | - </list> |
46 | | - </field> |
| 28 | + <div class="card mb-3 shadow-sm"> |
| 29 | + <div |
| 30 | + class="card-header d-flex justify-content-between align-items-center py-2 bg-info-subtle" |
| 31 | + > |
| 32 | + <div class="d-flex align-items-center"> |
| 33 | + <i |
| 34 | + class="fa fa-map-marker fa-lg me-3 text-info" |
| 35 | + title="Geographic Scope" |
| 36 | + /> |
| 37 | + <div> |
| 38 | + <h5 class="mb-0">Geographic Scope</h5> |
| 39 | + <small |
| 40 | + class="text-muted" |
| 41 | + >Define where this program operates</small> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + <div class="d-flex align-items-center gap-2"> |
| 45 | + <span |
| 46 | + class="badge rounded-pill bg-success" |
| 47 | + invisible="not geofence_ids" |
| 48 | + > |
| 49 | + <i class="fa fa-check me-1" /> |
| 50 | + <field |
| 51 | + name="geofence_count" |
| 52 | + class="d-inline" |
| 53 | + /> geofence(s) |
| 54 | + </span> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + <div class="card-body py-3"> |
| 58 | + <field |
| 59 | + name="geofence_ids" |
| 60 | + nolabel="1" |
| 61 | + readonly="state == 'ended'" |
| 62 | + > |
| 63 | + <list editable="bottom"> |
| 64 | + <field name="name" readonly="1" /> |
| 65 | + <field |
| 66 | + name="geofence_type" |
| 67 | + optional="hide" |
| 68 | + readonly="1" |
| 69 | + /> |
| 70 | + <field |
| 71 | + name="area_sqkm" |
| 72 | + string="Area (sq km)" |
| 73 | + readonly="1" |
| 74 | + /> |
| 75 | + </list> |
| 76 | + </field> |
| 77 | + </div> |
| 78 | + </div> |
47 | 79 | </xpath> |
48 | 80 | </field> |
49 | 81 | </record> |
|
0 commit comments