Advertisement
Guest User

Untitled

a guest
Feb 10th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.23 KB | None | 0 0
  1. import datetime
  2. import time
  3. import openerp
  4. from openerp.osv import osv, fields
  5. from openerp import tools
  6. from openerp.tools.translate import _
  7.  
  8.    
  9. class Course(osv.osv):
  10.     _name = "forum.course"
  11.     _inherit = ['mail.thread', 'ir.needaction_mixin']
  12.        
  13.     _columns = {
  14.               'name' : fields.char(string="Question Title", size=256, required=True),
  15.               'description' : fields.text(string="Question Description", required=True),
  16.               'date_of_q_created': fields.datetime('Date of Created'),
  17.               'category_question': fields.many2one('forum.categ', 'Question Category'),
  18.               'create_uid': fields.many2one('res.users', 'Question Created By', readonly=True),
  19.                }
  20.  
  21.     def function_which_post_msg(self, cr, uid, ids, context=None):
  22.         self.message_post(cr, uid, ids, body=_("New Question has been <b>created</b>"), context=context)
  23.  
  24.     def create(self, cr, uid, ids, context=None):
  25.         self.function_which_post_msg(cr, uid, ids, context=context)
  26.    
  27.  
  28.    
  29.  
  30. Course()
  31. class question_categ(osv.osv):
  32.     _name='forum.categ'
  33.     _description='category of Question'
  34.     _columns={
  35.        'name':fields.char('Create a Category type',size=100)
  36.     }
  37. question_categ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement