Merge pull request #4828 from expsa/ensan_education_modified
education notice task 1 => odex_benefit
This commit is contained in:
commit
241d5de0e3
|
|
@ -0,0 +1,2 @@
|
|||
# odex25-standard-modules
|
||||
This Repo contains general standard modules for all projects.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -772,6 +772,13 @@ class EducationIlliterateReason(models.Model):
|
|||
|
||||
name = fields.Char(string='name')
|
||||
|
||||
|
||||
class EducationDelayReason(models.Model):
|
||||
_name = 'education.delay.reason'
|
||||
_description = "Education Delay Reason"
|
||||
|
||||
name = fields.Char(string='name', required=True)
|
||||
|
||||
class IncomeType(models.Model):
|
||||
_name = 'income.type'
|
||||
_description = "Income Type"
|
||||
|
|
|
|||
|
|
@ -5,21 +5,31 @@ class EducationEntities(models.Model):
|
|||
_name = 'education.entities'
|
||||
|
||||
name = fields.Char(string='Name')
|
||||
education_level_id = fields.Many2one('education.level', string='Education Level')
|
||||
|
||||
|
||||
class EducationLevel(models.Model):
|
||||
_name = 'education.level'
|
||||
|
||||
name = fields.Char(string='Name')
|
||||
level_expected_age = fields.Float(string="Level Expected Age")
|
||||
|
||||
class EducationClassroom(models.Model):
|
||||
_name = 'education.classroom'
|
||||
|
||||
name = fields.Char(string='Name')
|
||||
education_level_id = fields.Many2one('education.level', string='Education Level')
|
||||
|
||||
class EducationResults(models.Model):
|
||||
_name = 'education.result'
|
||||
|
||||
name = fields.Char(string='Name',compute="get_name")
|
||||
evaluation = fields.Char(string='Evaluation')
|
||||
rate_type = fields.Selection([
|
||||
('from_4', 'From 4'),
|
||||
('from_5', 'From 5'),
|
||||
('from_100', 'From 100'),
|
||||
], string='Rate Type')
|
||||
min_degree = fields.Float(string='Mini Degree')
|
||||
max_degree = fields.Float(string='Max Degree')
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
from odoo import models, fields, api, _
|
||||
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
|
||||
from dateutil.relativedelta import relativedelta as rd
|
||||
from datetime import datetime, date
|
||||
|
||||
|
||||
class EducationStatus(models.Model):
|
||||
|
|
@ -22,7 +25,7 @@ class EducationStatus(models.Model):
|
|||
('current', 'Current'),
|
||||
('previous', 'Previous')
|
||||
],
|
||||
required=True
|
||||
required=False, compute="_compute_education_status_type", store=True
|
||||
)
|
||||
education_status = fields.Selection(
|
||||
string='Education Status',
|
||||
|
|
@ -55,14 +58,22 @@ class EducationStatus(models.Model):
|
|||
'attachment_id',
|
||||
string='Educational Certificate'
|
||||
)
|
||||
|
||||
entities = fields.Many2one("education.entities", string='Entity')
|
||||
education_levels = fields.Many2one("education.level", string='Education Levels')
|
||||
classroom = fields.Many2one('education.classroom', string='Classroom')
|
||||
entities = fields.Many2one("education.entities", string='Entity', domain="[('education_level_id', '=', education_levels)]")
|
||||
classroom = fields.Many2one('education.classroom', string='Classroom', domain="[('education_level_id', '=', education_levels)]")
|
||||
rate_type = fields.Selection([
|
||||
('from_4', 'From 4'),
|
||||
('from_5', 'From 5'),
|
||||
('from_100', 'From 100'),
|
||||
], string='Rate Type')
|
||||
degree = fields.Many2one('education.result', string='Degree')
|
||||
percentage = fields.Float(string="Percentage%")
|
||||
specialization_ids = fields.Many2one('specialization.specialization', string='Specialization')
|
||||
|
||||
intermittent_reason_id = fields.Many2one('education.illiterate.reason',string='Intermittent Reason')
|
||||
intermittent_date = fields.Date(string='Intermittent Date')
|
||||
family_member_age = fields.Integer(string="Age At Level Beginning", compute='_compute_family_member_age', store=True)
|
||||
family_member_delay = fields.Boolean(string="Member Delay", compute='_compute_family_member_delay', store=True)
|
||||
delay_reason_id = fields.Many2one('education.delay.reason', string='Delay Reason')
|
||||
weak_course_ids = fields.One2many('weak.course', 'education_status_id')
|
||||
|
||||
|
||||
|
|
@ -79,6 +90,40 @@ class EducationStatus(models.Model):
|
|||
record.education_status = record.mother_grant_benefit_id.education_status or\
|
||||
record.replacement_grant_benefit_id.replacement_education_status or\
|
||||
record.family_member_id.education_status
|
||||
|
||||
@api.depends("case_study")
|
||||
def _compute_education_status_type(self):
|
||||
for rec in self:
|
||||
if rec.case_study:
|
||||
if rec.case_study == "continuous":
|
||||
rec.education_status_type = "current"
|
||||
else:
|
||||
rec.education_status_type = "previous"
|
||||
else:
|
||||
rec.education_status_type = False
|
||||
|
||||
@api.depends("education_start_date", "family_member_id", "family_member_id.birth_date")
|
||||
def _compute_family_member_age(self):
|
||||
for rec in self:
|
||||
if rec.education_start_date and rec.family_member_id and rec.family_member_id.birth_date:
|
||||
day = datetime.strptime(str(rec.family_member_id.birth_date), DEFAULT_SERVER_DATE_FORMAT)
|
||||
age = rd(rec.education_start_date, day)
|
||||
rec.family_member_age = age.years
|
||||
else:
|
||||
rec.family_member_age = 0
|
||||
|
||||
@api.depends("family_member_age", "education_levels", "education_levels.level_expected_age")
|
||||
def _compute_family_member_delay(self):
|
||||
for rec in self:
|
||||
if rec.family_member_age > 0 and rec.education_levels and rec.education_levels.level_expected_age > 0:
|
||||
if rec.family_member_age > rec.education_levels.level_expected_age:
|
||||
rec.family_member_delay = True
|
||||
else:
|
||||
rec.family_member_delay = False
|
||||
else:
|
||||
rec.family_member_delay = False
|
||||
|
||||
|
||||
|
||||
@api.onchange('education_status_type')
|
||||
def _onchange_education_status_type(self):
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -118,6 +118,7 @@ access_rent_lines,access_rent_lines,model_rent_lines,base.group_user,1,1,1,1
|
|||
access_relation_settings,access_relation_settings,model_relation_settings,,1,1,1,1
|
||||
access_attachments_settings,access_attachments_settings,model_attachments_settings,base.group_user,1,1,1,1
|
||||
access_education_illiterate_reason,access_education_illiterate_reason,model_education_illiterate_reason,base.group_user,1,1,1,1
|
||||
access_education_delay_reason,access_education_delay_reason,model_education_delay_reason,base.group_user,1,1,1,1
|
||||
access_income_type,access_income_type,model_income_type,base.group_user,1,1,1,1
|
||||
access_loan_giver,access_loan_giver,model_loan_giver,base.group_user,1,1,1,1
|
||||
access_loan_reason,access_loan_reason,model_loan_reason,base.group_user,1,1,1,1
|
||||
|
|
|
|||
|
|
|
@ -1026,6 +1026,8 @@
|
|||
parent="education_main_menu" action="study_material_action" sequence="5"/>
|
||||
<menuitem id="illiterate_reason_menu" name="Education Illiterate Reason"
|
||||
parent="education_main_menu" action="education_illiterate_reason_action" sequence="6"/>
|
||||
<menuitem id="delay_reason_menu" name="Education Delay Reason"
|
||||
parent="education_main_menu" action="education_delay_reason_action" sequence="7"/>
|
||||
<menuitem id="menu_confirm_benefit_expense" name="Benefit Expense Flow" parent="account.menu_finance_payables"
|
||||
action="action_confirm_benefit_expense" sequence="11"/>
|
||||
<menuitem id="menu_payment_orders" name="Payment Orders"
|
||||
|
|
|
|||
|
|
@ -1118,6 +1118,35 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Education Delay Reason View Form -->
|
||||
<record id="education_delay_reason_form" model="ir.ui.view">
|
||||
<field name="name">Education Delay Reason</field>
|
||||
<field name="model">education.delay.reason</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Education Delay Reason View Tree -->
|
||||
<record id="education_delay_reason_tree" model="ir.ui.view">
|
||||
<field name="name">Education Delay Reason</field>
|
||||
<field name="model">education.delay.reason</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Income Type Form and Tree -->
|
||||
<record id="income_type_form" model="ir.ui.view">
|
||||
<field name="name">Income Type</field>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="education_level_id" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
@ -20,6 +21,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Education Entities">
|
||||
<field name="name"/>
|
||||
<field name="education_level_id" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -38,6 +40,7 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="level_expected_age"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
@ -49,6 +52,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Education Level">
|
||||
<field name="name"/>
|
||||
<field name="level_expected_age"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -67,6 +71,7 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="education_level_id" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
@ -78,6 +83,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Education Classroom">
|
||||
<field name="name"/>
|
||||
<field name="education_level_id" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -97,6 +103,7 @@
|
|||
<group>
|
||||
<field name="name"/>
|
||||
<field name="evaluation" required="1"/>
|
||||
<field name="rate_type" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="min_degree" required="1"/>
|
||||
|
|
@ -113,6 +120,7 @@
|
|||
<tree string="Education Result">
|
||||
<field name="name"/>
|
||||
<field name="evaluation"/>
|
||||
<field name="rate_type"/>
|
||||
<field name="min_degree"/>
|
||||
<field name="max_degree"/>
|
||||
</tree>
|
||||
|
|
@ -159,5 +167,11 @@
|
|||
<field name="res_model">education.illiterate.reason</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="education_delay_reason_action">
|
||||
<field name="name">Education Delay Reason</field>
|
||||
<field name="res_model">education.delay.reason</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -11,19 +11,26 @@
|
|||
name="education_status_type"
|
||||
decoration-success="education_status_type == 'current'"
|
||||
decoration-danger="education_status_type == 'previous'"
|
||||
widget="badge"
|
||||
widget="badge"
|
||||
invisible="1"
|
||||
/>
|
||||
<!-- <field name="education_status" optional="hide"/> -->
|
||||
<field name="case_study" optional="hide"/>
|
||||
<field name="case_study" optional="show"/>
|
||||
<field name="intermittent_reason_id" attrs="{'invisible': [('case_study', '!=', 'intermittent')], 'required': [('case_study', '=', 'intermittent')]}"/>
|
||||
<field name="intermittent_date" attrs="{'invisible': [('case_study', '!=', 'intermittent')], 'required': [('case_study', '=', 'intermittent')]}"/>
|
||||
<field name="education_levels" optional="show" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
<field name="entities" optional="show" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
<field name="classroom" optional="show" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
<field name="rate_type"/>
|
||||
<field name="percentage"/>
|
||||
<field name="degree"/>
|
||||
<field name="education_entity" optional="hide"/>
|
||||
<field name="education_start_date" optional="show"/>
|
||||
<field name="education_end_date" optional="show"/>
|
||||
<field name="degree" optional="show"/>
|
||||
<field name="percentage" optional="show"/>
|
||||
<field name="family_member_age" optional="show"/>
|
||||
<field name="family_member_delay" attrs="{'invisible': [('family_member_delay', '=', False)]}"/>
|
||||
<field name="delay_reason_id" options="{'no_create_edit': True, 'no_create': True}" attrs="{'invisible': [('family_member_delay', '=', False)], 'required': [('family_member_delay', '=', True)]}"/>
|
||||
<field name="educational_certificate" optional="hide"/>
|
||||
<field name="entities" optional="hide"/>
|
||||
<field name="education_levels" optional="hide"/>
|
||||
<field name="classroom" optional="hide"/>
|
||||
<field name="specialization_ids" optional="hide"/>
|
||||
<!-- <field name="weak_study" optional="hide"/> -->
|
||||
</tree>
|
||||
|
|
@ -46,13 +53,15 @@
|
|||
|
||||
<!-- Basic Info -->
|
||||
<group>
|
||||
<field name="education_status_type" required="1"/>
|
||||
<field name="education_status_type" required="0" invisible="1"/>
|
||||
</group>
|
||||
|
||||
<!-- Conditional Fields (Current) -->
|
||||
<group attrs="{'invisible': [('education_status_type', '!=', 'current')]}">
|
||||
<group>
|
||||
<!-- <field name="education_status"/> -->
|
||||
<field name="case_study"/>
|
||||
<field name="intermittent_reason_id" attrs="{'invisible': [('case_study', '!=', 'intermittent')], 'required': [('case_study', '=', 'intermittent')]}"/>
|
||||
<field name="intermittent_date" attrs="{'invisible': [('case_study', '!=', 'intermittent')], 'required': [('case_study', '=', 'intermittent')]}"/>
|
||||
</group>
|
||||
|
||||
<!-- Conditional Fields (Previous) -->
|
||||
|
|
@ -62,15 +71,19 @@
|
|||
|
||||
<!-- Other Fields -->
|
||||
<group>
|
||||
<field name="education_levels" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
<field name="entities" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
<field name="classroom" options="{'no_create_edit': True, 'no_create': True}"/>
|
||||
<field name="rate_type"/>
|
||||
<field name="percentage"/>
|
||||
<field name="degree"/>
|
||||
<field name="education_entity"/>
|
||||
<field name="education_start_date"/>
|
||||
<field name="education_end_date"/>
|
||||
<field name="family_member_age"/>
|
||||
<field name="family_member_delay" attrs="{'invisible': [('family_member_delay', '=', False)]}"/>
|
||||
<field name="delay_reason_id" attrs="{'invisible': [('family_member_delay', '=', False)], 'required': [('family_member_delay', '=', True)]}"/>
|
||||
<field name="educational_certificate" widget="many2many_attachment_preview" />
|
||||
<field name="entities"/>
|
||||
<field name="education_levels"/>
|
||||
<field name="classroom"/>
|
||||
<field name="degree"/>
|
||||
<field name="percentage"/>
|
||||
<field name="specialization_ids"/>
|
||||
</group>
|
||||
<notebook>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue