|
| 1 | +# Part of OpenSPP. See LICENSE file for full copyright and licensing details. |
| 2 | + |
| 3 | +from odoo import fields, models |
| 4 | + |
| 5 | + |
| 6 | +class OpenSPPStatisticsCycle(models.Model): |
| 7 | + _name = "spp.event.cycle" |
| 8 | + _description = "Event Cycle" |
| 9 | + |
| 10 | + program_id = fields.Many2one("g2p.program", "Program") |
| 11 | + cycle_id = fields.Many2one("g2p.cycle", "Cycle") |
| 12 | + event_type = fields.Selection( |
| 13 | + [ |
| 14 | + ("fgmemr1", "FG member in round 1"), |
| 15 | + ("wumem", "WU member, but not received production grant"), |
| 16 | + ("fgmemr2", "FG member in round 2"), |
| 17 | + ("impagri", "Implementation of agriculture production grants (round 1)"), |
| 18 | + ("implive", "Implementation of livestock production grants (round 1)"), |
| 19 | + ], |
| 20 | + default="fgmemr1", |
| 21 | + string="Event Type", |
| 22 | + ) |
| 23 | + no_hh_member = fields.Integer("No. of HH Member") |
| 24 | + no_indigenous = fields.Integer("No. of Indigenous") |
| 25 | + percent_indigenous = fields.Float("% of Indigenous") |
| 26 | + no_15_35 = fields.Integer("No. of Member in 15-35") |
| 27 | + percent_15_35 = fields.Float("% of Member in 15-35") |
| 28 | + no_woman_headed = fields.Integer("No. of Woman-headed HH") |
| 29 | + no_better_off = fields.Integer("No. of Better-off HH") |
| 30 | + no_medium = fields.Integer("No. of Medium HH") |
| 31 | + no_poor = fields.Integer("No. of Poor HH") |
| 32 | + no_male = fields.Integer("No. of Male") |
| 33 | + no_female = fields.Integer("No. of Female") |
| 34 | + no_both = fields.Integer("No. of Both") |
| 35 | + no_implemented = fields.Integer("No. of Implemented") |
| 36 | + no_on_going = fields.Integer("No. of On-going") |
| 37 | + no_not_implemented = fields.Integer("No. of Not Implemented") |
| 38 | + production_area = fields.Float("Production Area (ha)") |
| 39 | + agricultural_yield = fields.Float("Agricultural Yield (ton)") |
| 40 | + agricultural_productivity = fields.Float("Agricultural Productivity (ton/ha)") |
| 41 | + no_livestock_project = fields.Integer("No. of Livestock provided by project") |
| 42 | + no_livestock_present = fields.Integer("No. of Livestock at present") |
| 43 | + no_livestock_consumption = fields.Integer("No. of Livestock consumption") |
| 44 | + no_livestock_sold = fields.Integer("No. of Livestock sold") |
| 45 | + no_livestock_increase = fields.Integer("No. of Livestock increase") |
| 46 | + |
| 47 | + def get_view_id(self): |
| 48 | + """ |
| 49 | + This retrieves the View ID of this model |
| 50 | + """ |
| 51 | + return self.env["ir.ui.view"].search([("model", "=", self._name), ("type", "=", "form")], limit=1).id |
0 commit comments