Skip to content

Commit a83958b

Browse files
Siddharth Kanojiyaparthivgls
authored andcommitted
session enhancement with mail reminder and travis fix (openeducat#100)
* [IMP] wizard for multiple session confirmation and send mail * [IMP] change from api.one to api.multi in methods and other travis fixes
1 parent 50be782 commit a83958b

File tree

86 files changed

+862
-696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+862
-696
lines changed

openeducat_activity/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module provide feature of Activity Management.

openeducat_activity/__manifest__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@
2121

2222
{
2323
'name': 'OpenEduCat Activity',
24-
'version': '3.0.0',
24+
'version': '10.0.3.0.0',
2525
'license': 'LGPL-3',
2626
'category': 'Education',
2727
"sequence": 3,
2828
'summary': 'Manage Activities',
2929
'complexity': "easy",
30-
'description': """
31-
This module provide feature of Activity Manangement.
32-
33-
""",
3430
'author': 'Tech Receptives',
3531
'website': 'http://www.openeducat.org',
3632
'depends': ['openeducat_core'],
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
22
access_op_activity_student,name_op_activity_student,model_op_activity,openeducat_core.group_op_student,1,0,0,0
33
access_op_activity_back_office,name_op_activity_student_back_office,model_op_activity,openeducat_core.group_op_back_office,1,1,1,1
4-
,,,,,,,
54
access_op_activity_type_student,name_op_activity_type_student,model_op_activity_type,openeducat_core.group_op_student,1,0,0,0
65
access_op_activity_type_back_office,name_op_activity_type_back_office,model_op_activity_type,openeducat_core.group_op_back_office,1,1,1,0
76
access_op_activity_type_back_office_admin,name_op_activity_type_back_office_admin,model_op_activity_type,openeducat_core.group_op_back_office_admin,1,1,1,1

openeducat_activity/wizard/student_migrate_wizard.py

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -36,55 +36,60 @@ class StudentMigrate(models.TransientModel):
3636
student_ids = fields.Many2many(
3737
'op.student', string='Student(s)', required=True)
3838

39-
@api.one
39+
@api.multi
4040
@api.constrains('course_from_id', 'course_to_id')
4141
def _check_admission_register(self):
42-
if self.course_from_id == self.course_to_id:
43-
raise ValidationError(_("From Course must not be same \
44-
as To Course!"))
42+
for record in self:
43+
if record.course_from_id == record.course_to_id:
44+
raise ValidationError(_("From Course must not be same \
45+
as To Course!"))
4546

46-
if self.course_from_id.parent_id:
47-
if self.course_from_id.parent_id != self.course_to_id.parent_id:
47+
if record.course_from_id.parent_id:
48+
if record.course_from_id.parent_id != \
49+
record.course_to_id.parent_id:
50+
raise ValidationError(_(
51+
"Can't migrate, As selected courses don't \
52+
share same parent course!"))
53+
else:
4854
raise ValidationError(_(
49-
"Can't migrate, As selected courses don't \
50-
share same parent course!"))
51-
else:
52-
raise ValidationError(_(
53-
"Can't migrate, Proceed for new admission"))
55+
"Can't migrate, Proceed for new admission"))
5456

5557
@api.onchange('course_from_id')
5658
def onchange_course_id(self):
5759
self.student_ids = False
5860

59-
@api.one
61+
@api.multi
6062
def student_migrate_forward(self):
61-
activity_type = self.env["op.activity.type"]
62-
act_type = activity_type.search([('name', '=', 'Migration')], limit=1)
63-
if not act_type:
64-
act_type = activity_type.create({'name': 'Migration'})
63+
for record in self:
64+
activity_type = self.env["op.activity.type"]
65+
act_type = activity_type.search(
66+
[('name', '=', 'Migration')], limit=1)
67+
if not act_type:
68+
act_type = activity_type.create({'name': 'Migration'})
6569

66-
for student in self.student_ids:
67-
activity_vals = {
68-
'student_id': student.id,
69-
'type_id': act_type.id,
70-
'date': self.date,
71-
'description': 'Migration From' +
72-
self.course_from_id.name + ' to ' + self.course_to_id.name
73-
}
74-
self.env['op.activity'].create(activity_vals)
75-
student_course = self.env['op.student.course'].search(
76-
[('student_id', '=', student.id), ('course_id', '=',
77-
self.course_from_id.id)])
78-
student_course.write({'course_id': self.course_to_id.id})
79-
reg_id = self.env['op.subject.registration'].create({
80-
'student_id': student.id,
81-
'batch_id': self.batch_id.id,
82-
'course_id': self.course_to_id.id,
83-
'min_unit_load': self.course_to_id.min_unit_load or 0.0,
84-
'max_unit_load': self.course_to_id.max_unit_load or 0.0,
85-
'state': 'draft',
86-
})
87-
reg_id.get_subjects()
88-
if not self.optional_sub:
89-
reg_id.action_submitted()
90-
reg_id.action_approve()
70+
for student in record.student_ids:
71+
activity_vals = {
72+
'student_id': student.id,
73+
'type_id': act_type.id,
74+
'date': self.date,
75+
'description': 'Migration From' +
76+
record.course_from_id.name +
77+
' to ' + record.course_to_id.name
78+
}
79+
self.env['op.activity'].create(activity_vals)
80+
student_course = self.env['op.student.course'].search(
81+
[('student_id', '=', student.id),
82+
('course_id', '=', record.course_from_id.id)])
83+
student_course.write({'course_id': record.course_to_id.id})
84+
reg_id = self.env['op.subject.registration'].create({
85+
'student_id': student.id,
86+
'batch_id': record.batch_id.id,
87+
'course_id': record.course_to_id.id,
88+
'min_unit_load': record.course_to_id.min_unit_load or 0.0,
89+
'max_unit_load': record.course_to_id.max_unit_load or 0.0,
90+
'state': 'draft',
91+
})
92+
reg_id.get_subjects()
93+
if not record.optional_sub:
94+
reg_id.action_submitted()
95+
reg_id.action_approve()

openeducat_admission/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is gives the feature of admission process.

openeducat_admission/__manifest__.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@
2121

2222
{
2323
'name': "OpenEduCat Admission",
24-
'version': '3.0.0',
24+
'version': '10.0.3.0.0',
2525
'license': 'LGPL-3',
2626
'category': 'Education',
2727
'sequence': 3,
2828
'summary': "Manage Admissions""",
2929
'complexity': "easy",
30-
'description': """
31-
This is gives the feature of admission process.
32-
""",
3330
'author': 'Tech Receptives',
3431
'website': 'http://www.openeducat.org',
3532
'depends': ['openeducat_fees', 'openeducat_core'],
@@ -52,10 +49,10 @@
5249
'demo/student_fees_details_demo.xml',
5350
],
5451
'test': [
55-
'test/res_users_creation.yml',
56-
'test/batch_course_fees.yml',
57-
'test/admission_register_creation.yml',
58-
],
52+
'test/res_users_creation.yml',
53+
'test/batch_course_fees.yml',
54+
'test/admission_register_creation.yml',
55+
],
5956
'images': [
6057
'static/description/openeducat_admission_banner.jpg',
6158
],

0 commit comments

Comments
 (0)