forked from JayVora-SerpentCS/OdooEduERP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexam_class_result.py
48 lines (43 loc) · 1.98 KB
/
exam_class_result.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2011-Today Serpent Consulting Services PVT. LTD.
# (<http://www.serpentcs.com>)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api, _
class ResultPrint(models.TransientModel):
_name = 'result.print'
_description = 'students result'
standard_id = fields.Many2one("school.standard", "Standard",
required=True)
exam_id = fields.Many2one("exam.exam", "Exam")
year_id = fields.Many2one('academic.year', 'Academic Year', required=True)
@api.multi
def get_result(self):
domain = []
for result_line in self:
domain = [('standard_id', '=', result_line.standard_id.id),
('s_exam_ids', '=', result_line.exam_id.id)]
return {'name': _('Result Info'),
'view_type': 'form',
"view_mode": 'tree,form',
'res_model': 'exam.result',
'type': 'ir.actions.act_window',
'domain': domain,
}
return True