Skip to content

Commit

Permalink
Update demo data. (#81)
Browse files Browse the repository at this point in the history
* [IMP]:#5816:openeducat:xml,demo data: udpate demo data to have dates dynamic around current dates and to have data in the dashboard

* [IMP]:#5816:openeducat:xml,demo data: udpate demo data to have dates dynamic around current dates and to have data in the dashboard

* [FIX]:#5817:openeducat:xml,demo data: fix the date by giving relativedelta in addition of months and dates to generate it dynamicaly

* [FIX] Fix for the pep8 and flake8 and pylint issues

* [FIX] change the version with prefix 9.0 and set license in openerp
  • Loading branch information
Siddharth Kanojiya authored and parthivgls committed Aug 30, 2016
1 parent 75dff8c commit dd79b3f
Show file tree
Hide file tree
Showing 461 changed files with 6,232 additions and 2,611 deletions.
3 changes: 0 additions & 3 deletions openeducat_achievement/__init__.py
Expand Up @@ -20,6 +20,3 @@
##############################################################################

from . import models


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
10 changes: 4 additions & 6 deletions openeducat_achievement/__openerp__.py
Expand Up @@ -21,7 +21,8 @@

{
'name': 'OpenEduCat Achievement',
'version': '2.4.0',
'version': '9.0.2.4.0',
'license': 'LGPL-3',
'category': 'Openerp Education',
"sequence": 3,
'summary': 'Manage Achievement',
Expand All @@ -42,13 +43,10 @@
'static/description/openeducat_achievement_banner.jpg',
],
'demo': [
'demo/op.achievement.type.csv',
'demo/op.achievement.csv',
'demo/achievement_type_demo.xml',
'demo/achievement_demo.xml',
],
'installable': True,
'auto_install': False,
'application': True,
}


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4 changes: 2 additions & 2 deletions openeducat_achievement/achievement_menu.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<menuitem id="menu_op_achievement_type_sub" name="Achievement Types"
parent="openeducat_core.menu_op_school_config_activity" sequence="20"
Expand All @@ -9,4 +9,4 @@
parent="openeducat_core.menu_op_general_student" sequence="20"
action="act_open_op_achievement_view" groups="openeducat_core.group_op_back_office,openeducat_core.group_op_back_office_admin" />
</data>
</openerp>
</odoo>
39 changes: 39 additions & 0 deletions openeducat_achievement/demo/achievement_demo.xml
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">

<record id="op_achievement_1" model="op.achievement">
<field name="description">Got first rank in paper presentation at
tech first.
</field>
<field name="achievement_date"
eval="(DateTime.today() - relativedelta(months=2)).strftime('%Y-%m-14 %H:%M')" />
<field name="faculty_id" ref="openeducat_core.op_faculty_6" />
<field name="student_id" ref="openeducat_core.op_student_1" />
<field name="achievement_type" ref="op_achievement_type_2" />
</record>

<record id="op_achievement_2" model="op.achievement">
<field name="description">Got gold medal in national level
competition.
</field>
<field name="achievement_date"
eval="(DateTime.today() - relativedelta(months=3)).strftime('%Y-%m-22 %H:%M')" />
<field name="faculty_id" ref="openeducat_core.op_faculty_1" />
<field name="student_id" ref="openeducat_core.op_student_6" />
<field name="achievement_type" ref="op_achievement_type_1" />
</record>

<record id="op_achievement_3" model="op.achievement">
<field name="description">Got first rank in code master at tech
first.
</field>
<field name="achievement_date"
eval="(DateTime.today() - relativedelta(months=10)).strftime('%Y-%m-03 %H:%M')" />
<field name="faculty_id" ref="openeducat_core.op_faculty_3" />
<field name="student_id" ref="openeducat_core.op_student_20" />
<field name="achievement_type" ref="op_achievement_type_2" />
</record>

</data>
</odoo>
15 changes: 15 additions & 0 deletions openeducat_achievement/demo/achievement_type_demo.xml
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">

<record id="op_achievement_type_1" model="op.achievement.type">
<field name="name">Gold Medal</field>
<field name="code">gm</field>
</record>
<record id="op_achievement_type_2" model="op.achievement.type">
<field name="name">First Rank in National Level Event</field>
<field name="code">nle</field>
</record>

</data>
</odoo>
4 changes: 0 additions & 4 deletions openeducat_achievement/demo/op.achievement.csv

This file was deleted.

3 changes: 0 additions & 3 deletions openeducat_achievement/demo/op.achievement.type.csv

This file was deleted.

2 changes: 0 additions & 2 deletions openeducat_achievement/models/__init__.py
Expand Up @@ -21,5 +21,3 @@

from . import achievement
from . import achievement_type

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2 changes: 0 additions & 2 deletions openeducat_achievement/models/achievement.py
Expand Up @@ -33,5 +33,3 @@ class OpAchievement(models.Model):
description = fields.Text('Description', required=True)
achievement_date = fields.Date(
'Date', required=True, default=fields.Date.today())

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2 changes: 0 additions & 2 deletions openeducat_achievement/models/achievement_type.py
Expand Up @@ -27,5 +27,3 @@ class OpAchievementType(models.Model):

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

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4 changes: 2 additions & 2 deletions openeducat_achievement/views/achievement_type_view.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<record id="view_op_achievement_type_tree" model="ir.ui.view">
<field name="name">op.achievement.type.tree</field>
Expand Down Expand Up @@ -68,4 +68,4 @@
<field name="view_id" ref="view_op_achievement_type_tree" />
</record>
</data>
</openerp>
</odoo>
4 changes: 2 additions & 2 deletions openeducat_achievement/views/achievement_view.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<record id="view_op_achievement_tree" model="ir.ui.view">
<field name="name">op.achievement.tree</field>
Expand Down Expand Up @@ -85,4 +85,4 @@
<field name="view_id" ref="view_op_achievement_tree" />
</record>
</data>
</openerp>
</odoo>
3 changes: 0 additions & 3 deletions openeducat_activity/__init__.py
Expand Up @@ -21,6 +21,3 @@

from . import models
from . import wizard


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
10 changes: 4 additions & 6 deletions openeducat_activity/__openerp__.py
Expand Up @@ -21,7 +21,8 @@

{
'name': 'OpenEduCat Activity',
'version': '2.4.0',
'version': '9.0.2.4.0',
'license': 'LGPL-3',
'category': 'Openerp Education',
"sequence": 3,
'summary': 'Manage Activities',
Expand All @@ -42,8 +43,8 @@
'activity_menu.xml'
],
'demo': [
'demo/op.activity.type.csv',
'demo/op.activity.csv',
'demo/activity_type_demo.xml',
'demo/activity_demo.xml',
],
'images': [
'static/description/openeducat_activity_banner.jpg',
Expand All @@ -52,6 +53,3 @@
'auto_install': False,
'application': True,
}


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
5 changes: 3 additions & 2 deletions openeducat_activity/activity_menu.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<menuitem id="menu_op_activity_sub" name="Activity Logs"
parent="openeducat_core.menu_op_general_student" sequence="10"
Expand All @@ -12,4 +12,5 @@
parent="openeducat_core.menu_op_general_main" sequence="30"
action="act_open_student_migrate_view" groups="openeducat_core.group_op_back_office,openeducat_core.group_op_back_office_admin" />
</data>
</openerp>
</odoo>

24 changes: 24 additions & 0 deletions openeducat_activity/demo/activity_demo.xml
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">

<record id="op_activity_1" model="op.activity">
<field name="description">Migrated in higher standard</field>
<field name="date"
eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-14 %H:%M')" />
<field name="faculty_id" ref="openeducat_core.op_faculty_1" />
<field name="student_id" ref="openeducat_core.op_student_1" />
<field name="type_id" ref="op_activity_type_1" />
</record>

<record id="op_activity_2" model="op.activity">
<field name="description">Reached 1 hour late</field>
<field name="date"
eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-12 %H:%M')" />
<field name="faculty_id" ref="openeducat_core.op_faculty_2" />
<field name="student_id" ref="openeducat_core.op_student_2" />
<field name="type_id" ref="op_activity_type_2" />
</record>

</data>
</odoo>
14 changes: 14 additions & 0 deletions openeducat_activity/demo/activity_type_demo.xml
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="op_activity_type_1" model="op.activity.type">
<field name="name">Migration</field>
</record>
<record id="op_activity_type_2" model="op.activity.type">
<field name="name">Late Application</field>
</record>
<record id="op_activity_type_3" model="op.activity.type">
<field name="name">Misbehaviour</field>
</record>
</data>
</odoo>
3 changes: 0 additions & 3 deletions openeducat_activity/demo/op.activity.csv

This file was deleted.

4 changes: 0 additions & 4 deletions openeducat_activity/demo/op.activity.type.csv

This file was deleted.

3 changes: 0 additions & 3 deletions openeducat_activity/models/__init__.py
Expand Up @@ -22,6 +22,3 @@
from . import activity
from . import activity_type
from . import student


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3 changes: 0 additions & 3 deletions openeducat_activity/models/activity.py
Expand Up @@ -32,6 +32,3 @@ class OpActivity(models.Model):
type_id = fields.Many2one('op.activity.type', 'Activity Type')
description = fields.Text('Description')
date = fields.Date('Date', default=fields.Date.today())


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3 changes: 0 additions & 3 deletions openeducat_activity/models/activity_type.py
Expand Up @@ -26,6 +26,3 @@ class OpActivityType(models.Model):
_name = 'op.activity.type'

name = fields.Char('Name', size=128, required=True)


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
3 changes: 0 additions & 3 deletions openeducat_activity/models/student.py
Expand Up @@ -27,6 +27,3 @@ class OpStudent(models.Model):

activity_log = fields.One2many(
'op.activity', 'student_id', 'Activity Log')


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4 changes: 2 additions & 2 deletions openeducat_activity/views/activity_type_view.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<record id="view_op_activity_type_tree" model="ir.ui.view">
<field name="name">op.activity.type.tree</field>
Expand Down Expand Up @@ -59,4 +59,4 @@
<field name="view_id" ref="view_op_activity_type_tree" />
</record>
</data>
</openerp>
</odoo>
4 changes: 2 additions & 2 deletions openeducat_activity/views/activity_view.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<record id="view_op_activity_tree" model="ir.ui.view">
<field name="name">op.activity.tree</field>
Expand Down Expand Up @@ -75,4 +75,4 @@
<field name="view_id" ref="view_op_activity_tree" />
</record>
</data>
</openerp>
</odoo>
4 changes: 2 additions & 2 deletions openeducat_activity/views/student_view.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<record id="view_op_student_form_timetable_inherit" model="ir.ui.view">
<field name="name">op.student.form.timetable_inherit</field>
Expand All @@ -15,4 +15,4 @@
</field>
</record>
</data>
</openerp>
</odoo>
3 changes: 0 additions & 3 deletions openeducat_activity/wizard/__init__.py
Expand Up @@ -20,6 +20,3 @@
###############################################################################

from . import student_migrate_wizard


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
16 changes: 7 additions & 9 deletions openeducat_activity/wizard/student_migrate_wizard.py
Expand Up @@ -19,7 +19,7 @@
#
###############################################################################

from openerp import models, fields, api
from openerp import models, fields, api, _
from openerp.exceptions import ValidationError


Expand All @@ -38,17 +38,18 @@ class StudentMigrate(models.TransientModel):
@api.constrains('course_from_id', 'course_to_id')
def _check_admission_register(self):
if self.course_from_id == self.course_to_id:
raise ValidationError("From Course must not be same as To Course!")
raise ValidationError(_("From Course must not be same \
as To Course!"))

if self.course_from_id.parent_id:
if self.course_from_id.parent_id != \
self.course_to_id.parent_id:
raise ValidationError(
raise ValidationError(_(
"Can't migrate, As selected courses don't \
share same parent course!")
share same parent course!"))
else:
raise ValidationError(
"Can't migrate, Proceed for new admission")
raise ValidationError(_(
"Can't migrate, Proceed for new admission"))

@api.one
@api.onchange('course_from_id')
Expand All @@ -70,6 +71,3 @@ def student_migrate_forward(self):
}
self.env['op.activity'].create(activity_vals)
student.write({'course_id': self.course_to_id.id})


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4 changes: 2 additions & 2 deletions openeducat_activity/wizard/student_migrate_wizard_view.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<openerp>
<odoo>
<data>
<record model="ir.ui.view" id="student_migrate_form">
<field name="name">student.migrate.form</field>
Expand Down Expand Up @@ -56,4 +56,4 @@
<field name="view_id" ref="student_migrate_form" />
</record>
</data>
</openerp>
</odoo>
3 changes: 0 additions & 3 deletions openeducat_admission/__init__.py
Expand Up @@ -22,6 +22,3 @@
from . import models
from . import report
from . import wizard


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

0 comments on commit dd79b3f

Please sign in to comment.