Skip to content

Commit

Permalink
Add unique constraint and update index pages for modules: 10.0 (#122)
Browse files Browse the repository at this point in the history
* [ADD] Add support links in index pages

* [IMP] code unique constraints and other changes

* [IMP] update test case for build fix

* [IMP] check for session conflict for faculty with alrady created lectures
  • Loading branch information
Siddharth Kanojiya authored and parthivgls committed Sep 28, 2017
1 parent 182cc81 commit 4a63844
Show file tree
Hide file tree
Showing 42 changed files with 250 additions and 286 deletions.
26 changes: 9 additions & 17 deletions openeducat_activity/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,14 @@ <h2 class="oe_slogan">Student Activity</h2>
</div>
</section>

<section class="jumbotron"
style="color: white; background-color: #606061;">
<div class="container">
<div class="row">
<div class="col-md-9">
<p class="mt16">
<strong>Need help or just looking for more information on OpenEduCat ?
We are ready and waiting for your questions.</strong>
</p>
</div>
<div class="col-md-3">
<a class="btn btn-primary btn-lg pull-right mt8"
style="color: #FFFFFF !important;"
href="https://www.openeducat.org/page/website.contactus"><i
class="fa fa-arrow-right"></i> Contact Us Now </a>
</div>
</div>
<section class="oe_container">
<div class="oe_mt16 oe_mb16">
<h2 class="oe_slogan">Need Any Help?</h2>
</div>
<div class="oe_slogan">
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="mailto:support@openeducat.org"><i class="fa fa-envelope"></i> Email </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-phone"></i> Contact Us </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-check-square"></i> Request Customization </a>
<a class="mt8 btn btn-primary btn-lg" style="color: #FFFFFF !important;margin-right: 7px;" href="https://www.openeducat.org/page/return-and-refund-policy"><i class="fa fa-share-square" style=""></i> Returns and Refunds Policy</a>
</div>
</section>
1 change: 1 addition & 0 deletions openeducat_admission/models/admission.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def onchange_student(self):
self.street2 = student.street2 or False
self.phone = student.phone or False
self.mobile = student.mobile or False
self.email = student.email or False
self.zip = student.zip or False
self.city = student.city or False
self.country_id = student.country_id and \
Expand Down
26 changes: 9 additions & 17 deletions openeducat_admission/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,14 @@ <h2 class="oe_slogan">Time Period based Report</h2>
</div>
</section>

<section class="jumbotron"
style="color: white; background-color: #606061;">
<div class="container">
<div class="row">
<div class="col-md-9">
<p class="mt16">
<strong>Need help or just looking for more information on OpenEduCat ?
We are ready and waiting for your questions.</strong>
</p>
</div>
<div class="col-md-3">
<a class="btn btn-primary btn-lg pull-right mt8"
style="color: #FFFFFF !important;"
href="https://www.openeducat.org/page/website.contactus"><i
class="fa fa-arrow-right"></i> Contact Us Now </a>
</div>
</div>
<section class="oe_container">
<div class="oe_mt16 oe_mb16">
<h2 class="oe_slogan">Need Any Help?</h2>
</div>
<div class="oe_slogan">
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="mailto:support@openeducat.org"><i class="fa fa-envelope"></i> Email </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-phone"></i> Contact Us </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-check-square"></i> Request Customization </a>
<a class="mt8 btn btn-primary btn-lg" style="color: #FFFFFF !important;margin-right: 7px;" href="https://www.openeducat.org/page/return-and-refund-policy"><i class="fa fa-share-square" style=""></i> Returns and Refunds Policy</a>
</div>
</section>
2 changes: 1 addition & 1 deletion openeducat_admission/test/batch_course_fees.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
-
!record {model: op.batch, id: batch_test}:
name: 'BOA-S1'
code: 'boas1'
code: 'boas1t'
course_id: course_test
start_date: !eval str(int(time.strftime('%Y')) - 1) +'-06-02'
end_date: !eval str(int(time.strftime('%Y')) + 2) +'-06-02'
Expand Down
2 changes: 1 addition & 1 deletion openeducat_assignment/models/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OpAssignment(models.Model):
required=True)
assignment_type_id = fields.Many2one(
'op.assignment.type', 'Assignment Type', required=True)
marks = fields.Float('Marks', track_visibility='onchange')
marks = fields.Float('Marks', required=True, track_visibility='onchange')
description = fields.Text('Description', required=True)
state = fields.Selection(
[('draft', 'Draft'), ('publish', 'Published'),
Expand Down
1 change: 1 addition & 0 deletions openeducat_assignment/models/assignment_sub_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class OpAssignmentSubLine(models.Model):
submission_date = fields.Datetime(
'Submission Date', readonly=True,
default=lambda self: fields.Datetime.now(), required=True)
marks = fields.Float('Marks', track_visibility='onchange')
note = fields.Text('Note')
user_id = fields.Many2one(
'res.users', related='student_id.user_id', string='User')
Expand Down
6 changes: 5 additions & 1 deletion openeducat_assignment/models/assignment_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ class OpAssignmentType(models.Model):
_name = 'op.assignment.type'

name = fields.Char('Name', size=256, required=True)
code = fields.Char('Code', size=4, required=True)
code = fields.Char('Code', size=16, required=True)

_sql_constraints = [
('unique_assignment_type_code',
'unique(code)', 'Code should be unique per assignment type!')]
29 changes: 10 additions & 19 deletions openeducat_assignment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,14 @@ <h2 class="oe_slogan">Assignment Submission</h2>
</div>
</section>


<section class="jumbotron"
style="color: white; background-color: #606061;">
<div class="container">
<div class="row">
<div class="col-md-9">
<p class="mt16">
<strong>Need help or just looking for more information on
OpenEduCat ? We are ready and waiting for your questions.</strong>
</p>
</div>
<div class="col-md-3">
<a class="btn btn-primary btn-lg pull-right mt8"
style="color: #FFFFFF !important;"
href="https://www.openeducat.org/page/website.contactus"><i
class="fa fa-arrow-right"></i> Contact Us Now </a>
</div>
</div>
</div>
<section class="oe_container">
<div class="oe_mt16 oe_mb16">
<h2 class="oe_slogan">Need Any Help?</h2>
</div>
<div class="oe_slogan">
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="mailto:support@openeducat.org"><i class="fa fa-envelope"></i> Email </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-phone"></i> Contact Us </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-check-square"></i> Request Customization </a>
<a class="mt8 btn btn-primary btn-lg" style="color: #FFFFFF !important;margin-right: 7px;" href="https://www.openeducat.org/page/return-and-refund-policy"><i class="fa fa-share-square" style=""></i> Returns and Refunds Policy</a>
</div>
</section>
6 changes: 3 additions & 3 deletions openeducat_assignment/test/assignment_sub_values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-
!record {model: op.assignment.type, id: assignment_type_ea_test}:
name: 'External Assignment'
code: 'ea'
code: 'exa'
-
Backoffice Admin can create batch, course, student, faculty and partner there for I checked it with that user who is backoffice admin.
-
Expand All @@ -27,7 +27,7 @@
-
!record {model: op.batch, id: batch_test}:
name: 'BOA-S1'
code: 'boas1'
code: 'boas1t'
course_id: course_test
start_date: !eval str(int(time.strftime('%Y')) - 1) +'-06-02'
end_date: !eval str(int(time.strftime('%Y')) + 2) +'-06-02'
Expand Down Expand Up @@ -61,7 +61,7 @@
-
!record {model: op.subject, id: subject_fa_test}:
name: 'Financial Accounting'
code: 'BOA1-001'
code: 'BOA1-001t'
type: 'theory'
-
I create 1st Partner for student
Expand Down
1 change: 1 addition & 0 deletions openeducat_assignment/views/assignment_sub_line_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<field name="student_id" domain="[('user_id','=',uid)]"/>
<field name="assignment_id" domain="[('allocation_ids','=',student_id),('state','=','publish')]"/>
<field name="submission_date" />
<field name="marks" attrs="{'readonly':[('state','=','accept')]}" />
</group>
<group string="Description">
<field name="description" nolabel="1" />
Expand Down
6 changes: 5 additions & 1 deletion openeducat_attendance/models/attendance_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ class OpAttendanceRegister(models.Model):
name = fields.Char(
'Name', size=16, required=True, track_visibility='onchange')
code = fields.Char(
'Code', size=8, required=True, track_visibility='onchange')
'Code', size=16, required=True, track_visibility='onchange')
course_id = fields.Many2one(
'op.course', 'Course', required=True, track_visibility='onchange')
batch_id = fields.Many2one(
'op.batch', 'Batch', required=True, track_visibility='onchange')
subject_id = fields.Many2one(
'op.subject', 'Subject', track_visibility='onchange')

_sql_constraints = [
('unique_attendance_register_code',
'unique(code)', 'Code should be unique per attendance register!')]

@api.onchange('course_id')
def onchange_course(self):
self.batch_id = False
30 changes: 11 additions & 19 deletions openeducat_attendance/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,14 @@ <h2 class="oe_slogan">Attendace Report</h2>
</div>
</section>

<section class="jumbotron"
style="color: white; background-color: #606061;">
<div class="container">
<div class="row">
<div class="col-md-9">
<p class="mt16">
<strong>Need help or just looking for more information on
OpenEduCat ? We are ready and waiting for your questions.</strong>
</p>
</div>
<div class="col-md-3">
<a class="btn btn-primary btn-lg pull-right mt8"
style="color: #FFFFFF !important;"
href="https://www.openeducat.org/page/website.contactus"><i
class="fa fa-arrow-right"></i> Contact Us Now </a>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_mt16 oe_mb16">
<h2 class="oe_slogan">Need Any Help?</h2>
</div>
<div class="oe_slogan">
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="mailto:support@openeducat.org"><i class="fa fa-envelope"></i> Email </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-phone"></i> Contact Us </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-check-square"></i> Request Customization </a>
<a class="mt8 btn btn-primary btn-lg" style="color: #FFFFFF !important;margin-right: 7px;" href="https://www.openeducat.org/page/return-and-refund-policy"><i class="fa fa-share-square" style=""></i> Returns and Refunds Policy</a>
</div>
</section>
2 changes: 1 addition & 1 deletion openeducat_attendance/test/attendance_process_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Create an Attendance Register
-
!record {model: op.attendance.register, id: attendance_register_test}:
code: 'BOA-S1A1'
code: 'BOA-S1A1T'
name: 'BOA-S1A1'
course_id: course_test
batch_id: batch_test
Expand Down
2 changes: 1 addition & 1 deletion openeducat_attendance/test/attendance_sub_value_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-
!record {model: op.batch, id: batch_test}:
name: 'BOA-S1'
code: 'boas1'
code: 'boas1t'
course_id: course_test
start_date: !eval str(int(time.strftime('%Y')) - 1) +'-06-02'
end_date: !eval str(int(time.strftime('%Y')) + 2) +'-06-02'
Expand Down
6 changes: 5 additions & 1 deletion openeducat_classroom/models/classroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ class OpClassroom(models.Model):
_name = 'op.classroom'

name = fields.Char('Name', size=16, required=True)
code = fields.Char('Code', size=4, required=True)
code = fields.Char('Code', size=16, required=True)
course_id = fields.Many2one('op.course', 'Course')
batch_id = fields.Many2one('op.batch', 'Batch')
capacity = fields.Integer(string='No of Person')
facilities = fields.One2many(
'op.facility.line', 'classroom_id', string='Facility Lines')
asset_line = fields.One2many('op.asset', 'asset_id', 'Asset')

_sql_constraints = [
('unique_classroom_code',
'unique(code)', 'Code should be unique per classroom!')]

@api.onchange('course_id')
def onchange_course(self):
self.batch_id = False
26 changes: 9 additions & 17 deletions openeducat_classroom/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,14 @@ <h2 class="oe_slogan">Classroom</h2>
</div>
</section>

<section class="jumbotron"
style="color: white; background-color: #606061;">
<div class="container">
<div class="row">
<div class="col-md-9">
<p class="mt16">
<strong>Need help or just looking for more information on OpenEduCat ?
We are ready and waiting for your questions.</strong>
</p>
</div>
<div class="col-md-3">
<a class="btn btn-primary btn-lg pull-right mt8"
style="color: #FFFFFF !important;"
href="https://www.openeducat.org/page/website.contactus"><i
class="fa fa-arrow-right"></i> Contact Us Now </a>
</div>
</div>
<section class="oe_container">
<div class="oe_mt16 oe_mb16">
<h2 class="oe_slogan">Need Any Help?</h2>
</div>
<div class="oe_slogan">
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="mailto:support@openeducat.org"><i class="fa fa-envelope"></i> Email </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-phone"></i> Contact Us </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-check-square"></i> Request Customization </a>
<a class="mt8 btn btn-primary btn-lg" style="color: #FFFFFF !important;margin-right: 7px;" href="https://www.openeducat.org/page/return-and-refund-policy"><i class="fa fa-share-square" style=""></i> Returns and Refunds Policy</a>
</div>
</section>
6 changes: 5 additions & 1 deletion openeducat_core/models/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@
class OpBatch(models.Model):
_name = 'op.batch'

code = fields.Char('Code', size=8, required=True)
code = fields.Char('Code', size=16, required=True)
name = fields.Char('Name', size=32, required=True)
start_date = fields.Date(
'Start Date', required=True, default=fields.Date.today())
end_date = fields.Date('End Date', required=True)
course_id = fields.Many2one('op.course', 'Course', required=True)

_sql_constraints = [
('unique_batch_code',
'unique(code)', 'Code should be unique per batch!')]

@api.multi
@api.constrains('start_date', 'end_date')
def check_dates(self):
Expand Down
6 changes: 5 additions & 1 deletion openeducat_core/models/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ class OpCategory(models.Model):
_name = 'op.category'

name = fields.Char('Name', size=256, required=True)
code = fields.Char('Code', size=4, required=True)
code = fields.Char('Code', size=16, required=True)

_sql_constraints = [
('unique_category_code',
'unique(code)', 'Code should be unique per category!')]
6 changes: 5 additions & 1 deletion openeducat_core/models/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OpCourse(models.Model):
_name = 'op.course'

name = fields.Char('Name', required=True)
code = fields.Char('Code', size=8, required=True)
code = fields.Char('Code', size=16, required=True)
parent_id = fields.Many2one('op.course', 'Parent Course')
section = fields.Char('Section', size=32, required=True)
evaluation_type = fields.Selection(
Expand All @@ -35,3 +35,7 @@ class OpCourse(models.Model):
subject_ids = fields.Many2many('op.subject', string='Subject(s)')
max_unit_load = fields.Float("Maximum Unit Load")
min_unit_load = fields.Float("Minimum Unit Load")

_sql_constraints = [
('unique_course_code',
'unique(code)', 'Code should be unique per course!')]
5 changes: 5 additions & 0 deletions openeducat_core/models/subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ class OpSubject(models.Model):
subject_type = fields.Selection(
[('compulsory', 'Compulsory'), ('elective', 'Elective')],
'Subject Type', default="compulsory", required=True)

_sql_constraints = [
('unique_subject_code',
'unique(code)', 'Code should be unique per subject!'),
]
29 changes: 10 additions & 19 deletions openeducat_core/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,14 @@ <h2 class="oe_slogan">Batch Management</h2>
</div>
</section>


<section class="jumbotron"
style="color: white; background-color: #606061;">
<div class="container">
<div class="row">
<div class="col-md-9">
<p class="mt16">
<strong>Need help or just looking for more information on OpenEduCat ?
We are ready and waiting for your questions.</strong>
</p>
</div>
<div class="col-md-3">
<a class="btn btn-primary btn-lg pull-right mt8"
style="color: #FFFFFF !important;"
href="https://www.openeducat.org/page/website.contactus"><i
class="fa fa-arrow-right"></i> Contact Us Now </a>
</div>
</div>
</div>
<section class="oe_container">
<div class="oe_mt16 oe_mb16">
<h2 class="oe_slogan">Need Any Help?</h2>
</div>
<div class="oe_slogan">
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="mailto:support@openeducat.org"><i class="fa fa-envelope"></i> Email </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-phone"></i> Contact Us </a>
<a class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;" href="https://www.openeducat.org/page/contactus"><i class="fa fa-check-square"></i> Request Customization </a>
<a class="mt8 btn btn-primary btn-lg" style="color: #FFFFFF !important;margin-right: 7px;" href="https://www.openeducat.org/page/return-and-refund-policy"><i class="fa fa-share-square" style=""></i> Returns and Refunds Policy</a>
</div>
</section>

0 comments on commit 4a63844

Please sign in to comment.