Skip to content

Commit d681f77

Browse files
Merge pull request #24 from OpenSPP/fix/inkind-entitlement-item-form-layout
fix(spp_programs): fix in-kind entitlement item form layout and product domain
2 parents ad3796f + d41ac86 commit d681f77

4 files changed

Lines changed: 33 additions & 13 deletions

File tree

spp_programs/models/entitlement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def _generate_code(self):
720720
)
721721

722722
# Product Fields
723-
product_id = fields.Many2one("product.product", "Product", domain=[("type", "=", "product")])
723+
product_id = fields.Many2one("product.product", "Product", domain=[("type", "=", "consu")])
724724
quantity = fields.Integer("Quantity", default=1)
725725
unit_price = fields.Monetary(string="Value/Unit", currency_field="currency_id")
726726
uom_id = fields.Many2one("uom.uom", "Unit of Measure")

spp_programs/models/managers/entitlement_manager_inkind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class SPPInKindEntitlementItem(models.Model):
467467
sequence = fields.Integer(default=1000)
468468
entitlement_id = fields.Many2one("spp.program.entitlement.manager.inkind", "In-kind Entitlement", required=True)
469469

470-
product_id = fields.Many2one("product.product", "Product", domain=[("type", "=", "product")], required=True)
470+
product_id = fields.Many2one("product.product", "Product", domain=[("type", "=", "consu")], required=True)
471471

472472
# non-mandatory field to store a domain that is used to verify if this item is valid for a beneficiary
473473
# For example, it could be: [('is_woman_headed_household, '=', True)]

spp_programs/views/cel/entitlement_inkind_cel_views.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
>
6969
<field
7070
name="condition_mode"
71+
nolabel="1"
7172
widget="radio"
7273
options="{'horizontal': true}"
7374
/>
@@ -88,6 +89,7 @@
8889
>
8990
<field
9091
name="condition_cel_expression"
92+
nolabel="1"
9193
widget="cel_expression"
9294
cel_profile="registry_groups"
9395
show_symbol_browser="true"

spp_programs/views/managers/entitlement_manager_inkind_view.xml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,40 @@ Part of OpenSPP. See LICENSE file for full copyright and licensing details.
7474
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
7575
colspan="4"
7676
/>
77-
<field name="quantity" />
78-
<field
79-
name="uom_id"
80-
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
81-
/>
77+
</group>
78+
<group colspan="4" col="4">
79+
<group colspan="2">
80+
<field name="quantity" />
81+
</group>
82+
<group colspan="2">
83+
<field
84+
name="uom_id"
85+
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
86+
/>
87+
</group>
88+
</group>
89+
<separator
90+
string="Condition (Optional)"
91+
class="mt-3"
92+
/>
93+
<group name="condition_section" col="1">
8294
<field
8395
name="condition"
84-
colspan="4"
96+
nolabel="1"
8597
widget="domain"
8698
options="{'model': 'res.partner'}"
8799
/>
88-
<field
89-
name="multiplier_field"
90-
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
91-
/>
92-
<field name="max_multiplier" />
100+
</group>
101+
<group colspan="4" col="4">
102+
<group colspan="2">
103+
<field
104+
name="multiplier_field"
105+
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
106+
/>
107+
</group>
108+
<group colspan="2">
109+
<field name="max_multiplier" />
110+
</group>
93111
</group>
94112
</form>
95113
</field>

0 commit comments

Comments
 (0)