This question has been flagged
2 Replies
6928 Views

I am finding problems when setting the permissions of an own created module. When inserting permissions lines in the ir.model.access.csv file, I keep getting this error:

Line 1 : No matching record found for external id 'model_crm_partner_tracking' in field 'Object'

The line included in system/ir.model.access.csv is as follows:

"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_cbk_crm_partner_tracking_manager","access_cbk_crm_partner_tracking_manager", "model_crm_partner_tracking", "base.group_sale_manager",1,1,1,1

And the class is:

class crm_partner_tracking (osv.osv):       
    _name = "crm.partner.tracking"  
    _columns = {        
        'partner_id': fields.many2one("res.partner", string="Partner", ondelete="CASCADE"), 
        'note': fields.char('Note', required=True),        
        'note_date' : fields.date('Note date', required=True),
    }    
crm_partner_tracking()

The content of the __openerp__.py is:

{
    'name': 'CRM Information',
    'version': '0.1',      
    'images': [],    
    'depends': ['sale','sale_commission'],
    'category': 'CRM',
    'sequence': 23,
    'demo': [],
    'update_xml': [                   
        'partner_view.xml',  
        'security/ir.model.access.csv',                       
    ],
    'test': [],
    'installable': True,
    'auto_install': False,
    'css': [],
}

Do you have any idea of what am I doing wrong?

Avatar
Discard
Author Best Answer

Found the solution!

It seems that the blank spaces in .csv file (before "model_crm_partner_tracking" and "base.group_sale_manager") were causing the problem:

"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_cbk_crm_partner_tracking_manager","access_cbk_crm_partner_tracking_manager", "model_crm_partner_tracking", "base.group_sale_manager",1,1,1,1

Avatar
Discard
Best Answer

Hi

In OpenERP v7, the line "crm_partner_tracking()" is useless. You load the "partner_view.xml" file before the "security/ir.model.access.csv" file, Have you another record which are not a view, action or menu

Avatar
Discard
Author

Hi, thank you for your answer. I tried to change the order of load (loading first the .csv file) and the problem persists. There are no more records (apart from the view). The only thing that has not been mentioned in the question is the existence of some other classes in the .py file apart from crm_partner_tracking.