|
1 | | -<?xml version="1.0" encoding="utf-8"?> |
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
2 | 2 | <odoo> |
3 | 3 | <!-- Extend In-Kind Entitlement Item Form (inline form within manager) --> |
4 | 4 | <record id="view_inkind_entitlement_item_cel_form" model="ir.ui.view"> |
5 | 5 | <field name="name">spp.program.entitlement.manager.inkind.item.cel.form</field> |
6 | 6 | <field name="model">spp.program.entitlement.manager.inkind</field> |
7 | | - <field name="inherit_id" ref="spp_programs.view_entitlement_manager_inkind_form"/> |
| 7 | + <field |
| 8 | + name="inherit_id" |
| 9 | + ref="spp_programs.view_entitlement_manager_inkind_form" |
| 10 | + /> |
8 | 11 | <field name="arch" type="xml"> |
9 | 12 | <!-- Add quantity mode selection to inline form --> |
10 | | - <xpath expr="//field[@name='entitlement_item_ids']/form//field[@name='quantity']" position="before"> |
11 | | - <field name="quantity_mode" widget="radio" options="{'horizontal': true}"/> |
| 13 | + <xpath |
| 14 | + expr="//field[@name='entitlement_item_ids']/form//field[@name='quantity']" |
| 15 | + position="before" |
| 16 | + > |
| 17 | + <field |
| 18 | + name="quantity_mode" |
| 19 | + widget="radio" |
| 20 | + options="{'horizontal': true}" |
| 21 | + /> |
12 | 22 | </xpath> |
13 | 23 |
|
14 | 24 | <!-- Make quantity field conditional --> |
15 | | - <xpath expr="//field[@name='entitlement_item_ids']/form//field[@name='quantity']" position="attributes"> |
| 25 | + <xpath |
| 26 | + expr="//field[@name='entitlement_item_ids']/form//field[@name='quantity']" |
| 27 | + position="attributes" |
| 28 | + > |
16 | 29 | <attribute name="invisible">quantity_mode == 'cel'</attribute> |
17 | 30 | </xpath> |
18 | 31 |
|
19 | 32 | <!-- Add CEL quantity formula after quantity --> |
20 | | - <xpath expr="//field[@name='entitlement_item_ids']/form//field[@name='quantity']" position="after"> |
21 | | - <field name="quantity_cel_expression" |
22 | | - widget="cel_expression" |
23 | | - cel_profile="registry_groups" |
24 | | - show_symbol_browser="true" |
25 | | - show_validation_count="false" |
26 | | - invisible="quantity_mode != 'cel'" |
27 | | - placeholder="e.g., hh_size * 2"/> |
28 | | - <div invisible="quantity_mode != 'cel' or not quantity_cel_expression" class="small"> |
29 | | - <field name="quantity_cel_preview" invisible="not quantity_cel_preview" class="text-success"/> |
30 | | - <field name="quantity_cel_error" invisible="not quantity_cel_error" class="text-danger"/> |
| 33 | + <xpath |
| 34 | + expr="//field[@name='entitlement_item_ids']/form//field[@name='quantity']" |
| 35 | + position="after" |
| 36 | + > |
| 37 | + <field |
| 38 | + name="quantity_cel_expression" |
| 39 | + widget="cel_expression" |
| 40 | + cel_profile="registry_groups" |
| 41 | + show_symbol_browser="true" |
| 42 | + show_validation_count="false" |
| 43 | + invisible="quantity_mode != 'cel'" |
| 44 | + placeholder="e.g., hh_size * 2" |
| 45 | + /> |
| 46 | + <div |
| 47 | + invisible="quantity_mode != 'cel' or not quantity_cel_expression" |
| 48 | + class="small" |
| 49 | + > |
| 50 | + <field |
| 51 | + name="quantity_cel_preview" |
| 52 | + invisible="not quantity_cel_preview" |
| 53 | + class="text-success" |
| 54 | + /> |
| 55 | + <field |
| 56 | + name="quantity_cel_error" |
| 57 | + invisible="not quantity_cel_error" |
| 58 | + class="text-danger" |
| 59 | + /> |
31 | 60 | </div> |
32 | | - <field name="quantity_cel_is_valid" invisible="1"/> |
| 61 | + <field name="quantity_cel_is_valid" invisible="1" /> |
33 | 62 | </xpath> |
34 | 63 |
|
35 | 64 | <!-- Add condition mode selection --> |
36 | | - <xpath expr="//field[@name='entitlement_item_ids']/form//field[@name='condition']" position="before"> |
37 | | - <field name="condition_mode" widget="radio" options="{'horizontal': true}"/> |
| 65 | + <xpath |
| 66 | + expr="//field[@name='entitlement_item_ids']/form//field[@name='condition']" |
| 67 | + position="before" |
| 68 | + > |
| 69 | + <field |
| 70 | + name="condition_mode" |
| 71 | + nolabel="1" |
| 72 | + widget="radio" |
| 73 | + options="{'horizontal': true}" |
| 74 | + /> |
38 | 75 | </xpath> |
39 | 76 |
|
40 | 77 | <!-- Make condition field conditional --> |
41 | | - <xpath expr="//field[@name='entitlement_item_ids']/form//field[@name='condition']" position="attributes"> |
| 78 | + <xpath |
| 79 | + expr="//field[@name='entitlement_item_ids']/form//field[@name='condition']" |
| 80 | + position="attributes" |
| 81 | + > |
42 | 82 | <attribute name="invisible">condition_mode == 'cel'</attribute> |
43 | 83 | </xpath> |
44 | 84 |
|
45 | 85 | <!-- Add CEL condition expression after condition --> |
46 | | - <xpath expr="//field[@name='entitlement_item_ids']/form//field[@name='condition']" position="after"> |
47 | | - <field name="condition_cel_expression" |
48 | | - widget="cel_expression" |
49 | | - cel_profile="registry_groups" |
50 | | - show_symbol_browser="true" |
51 | | - show_validation_count="true" |
52 | | - invisible="condition_mode != 'cel'" |
53 | | - placeholder="e.g., hh_size >= 4 and child_count > 0"/> |
| 86 | + <xpath |
| 87 | + expr="//field[@name='entitlement_item_ids']/form//field[@name='condition']" |
| 88 | + position="after" |
| 89 | + > |
| 90 | + <field |
| 91 | + name="condition_cel_expression" |
| 92 | + nolabel="1" |
| 93 | + widget="cel_expression" |
| 94 | + cel_profile="registry_groups" |
| 95 | + show_symbol_browser="true" |
| 96 | + show_validation_count="true" |
| 97 | + invisible="condition_mode != 'cel'" |
| 98 | + placeholder="e.g., hh_size >= 4 and child_count > 0" |
| 99 | + /> |
54 | 100 | </xpath> |
55 | 101 | </field> |
56 | 102 | </record> |
|
59 | 105 | <record id="view_inkind_entitlement_manager_cel_form" model="ir.ui.view"> |
60 | 106 | <field name="name">spp.program.entitlement.manager.inkind.cel.form</field> |
61 | 107 | <field name="model">spp.program.entitlement.manager.inkind</field> |
62 | | - <field name="inherit_id" ref="spp_programs.view_entitlement_manager_inkind_form"/> |
| 108 | + <field |
| 109 | + name="inherit_id" |
| 110 | + ref="spp_programs.view_entitlement_manager_inkind_form" |
| 111 | + /> |
63 | 112 | <field name="arch" type="xml"> |
64 | 113 | <!-- Update the tree view inside the form to show quantity and condition modes --> |
65 | | - <xpath expr="//field[@name='entitlement_item_ids']/list/field[@name='quantity']" position="before"> |
66 | | - <field name="quantity_mode" optional="show"/> |
| 114 | + <xpath |
| 115 | + expr="//field[@name='entitlement_item_ids']/list/field[@name='quantity']" |
| 116 | + position="before" |
| 117 | + > |
| 118 | + <field name="quantity_mode" optional="show" /> |
67 | 119 | </xpath> |
68 | | - <xpath expr="//field[@name='entitlement_item_ids']/list/field[@name='multiplier_field']" position="before"> |
69 | | - <field name="condition_mode" optional="hide"/> |
| 120 | + <xpath |
| 121 | + expr="//field[@name='entitlement_item_ids']/list/field[@name='multiplier_field']" |
| 122 | + position="before" |
| 123 | + > |
| 124 | + <field name="condition_mode" optional="hide" /> |
70 | 125 | </xpath> |
71 | 126 | </field> |
72 | 127 | </record> |
|
0 commit comments