Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spp_programs/models/entitlement.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def _generate_code(self):
)

# Product Fields
product_id = fields.Many2one("product.product", "Product", domain=[("type", "=", "product")])
product_id = fields.Many2one("product.product", "Product", domain=[("type", "=", "consu")])
quantity = fields.Integer("Quantity", default=1)
unit_price = fields.Monetary(string="Value/Unit", currency_field="currency_id")
uom_id = fields.Many2one("uom.uom", "Unit of Measure")
Expand Down
2 changes: 1 addition & 1 deletion spp_programs/models/managers/entitlement_manager_inkind.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class SPPInKindEntitlementItem(models.Model):
sequence = fields.Integer(default=1000)
entitlement_id = fields.Many2one("spp.program.entitlement.manager.inkind", "In-kind Entitlement", required=True)

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

# non-mandatory field to store a domain that is used to verify if this item is valid for a beneficiary
# For example, it could be: [('is_woman_headed_household, '=', True)]
Expand Down
2 changes: 2 additions & 0 deletions spp_programs/views/cel/entitlement_inkind_cel_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
>
<field
name="condition_mode"
nolabel="1"
widget="radio"
options="{'horizontal': true}"
/>
Expand All @@ -88,6 +89,7 @@
>
<field
name="condition_cel_expression"
nolabel="1"
widget="cel_expression"
cel_profile="registry_groups"
show_symbol_browser="true"
Expand Down
40 changes: 29 additions & 11 deletions spp_programs/views/managers/entitlement_manager_inkind_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,40 @@ Part of OpenSPP. See LICENSE file for full copyright and licensing details.
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
colspan="4"
/>
<field name="quantity" />
<field
name="uom_id"
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
/>
</group>
<group colspan="4" col="4">
<group colspan="2">
<field name="quantity" />
</group>
<group colspan="2">
<field
name="uom_id"
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
/>
</group>
</group>
<separator
string="Condition (Optional)"
class="mt-3"
/>
<group name="condition_section" col="1">
<field
name="condition"
colspan="4"
nolabel="1"
widget="domain"
options="{'model': 'res.partner'}"
/>
<field
name="multiplier_field"
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
/>
<field name="max_multiplier" />
</group>
<group colspan="4" col="4">
<group colspan="2">
<field
name="multiplier_field"
options="{'no_open':True,'no_create':True,'no_create_edit':True}"
/>
</group>
<group colspan="2">
<field name="max_multiplier" />
</group>
</group>
</form>
</field>
Expand Down
Loading