Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to hide tickets from unsolicited users?

By
Andrew
on 9/17/14, 10:18 AM 1,086 views

Hello, i'm developing a a ticket module. But i have no ideea how to make my tickets visible only for asigned users?  Now every ticket is visible for everyone. I would be happy if someone will give me a hint. Thanks.

 

A piece of code:

 

from osv import fields, osv
from openerp.addons.crm import crm
from openerp.addons import project


class support_form(osv.osv):
        _name = "cf.support"
        _description = 'cf.support Module'
        _inherit = 'mail.thread'
        _order = "state desc, priority,id"
          
        _columns = { 
                'name': fields.char('Name', required=True),
                'state': fields.selection(crm.AVAILABLE_STATES, 'State', select=True, track_visibility='onchange'),
                'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True , track_visibility='onchange'),
                'description': fields.text('Description', required=1),
                'private': fields.boolean('Private'),
                'contract':fields.many2one('account.analytic.account', 'Analytic account', track_visibility='onchange'),
                'partner_id': fields.many2many('res.users', track_visibility='onchange'),
                'deadline': fields.date('Deadline', track_visibility='onchange'),
                'create_date': fields.date('Create_date', readonly=True),
        }   

        _defaults = { 
                'state': crm.AVAILABLE_STATES[0][0],
                'priority': crm.AVAILABLE_PRIORITIES[2][0],
                'created_by': lambda obj, cr, uid, context: uid,
        }   
~                              

 

 

P.s. I'm fresh in programming.

0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 9/17/14, 3:28 PM

You can achieve it using security record rules ...using this one can set rules for an object like who can see/edit etc .......

i know that. But I want to make that my tickets would be visible only for owner. And Administrator would have posibility to se them all.

Andrew
on 9/18/14, 4:50 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/17/14, 10:18 AM
Seen: 1086 times
Last updated: 3/16/15, 8:10 AM