Skip to Content
Menu
This question has been flagged
1 Odpoveď
6153 Zobrazenia


Hello, I trying to adding mail.thread in model res.partner.bank to get log of any change in some field using track visibility onchange. so I adding mail.thread and display it on the bottom of res.partner.bank view form page. Its working well if I edit existed record, but when I create new record its display error :

The requested operation cannot be completed due to security restrictions. Please contact your system administrator.


(Document type: Message, Operation: create) - (Records: [1071], User: 2)


My user has access to create message model by the way as my user has access to internal user group who can CRUD message model.

Avatar
Zrušiť
Best Answer

Hello Fahmi,


You can inherit in such a way as mail.thread is an abstract model. Already, in odoo we have all the CRUD rights in mail.message.user. So you might have some other issue in your code.


class ResPartnerBank(models.Model):

    _name = "res.partner.bank"

    _inherit = ['res.partner.bank','mail.thread']


    partner_bank = fields.Char(track_visibility='onchange', string="partner Bank")

    activity_ids = fields.One2many('mail.activity', 'bank_id', string='Activities')

    message_ids = fields.One2many(auto_join=False)


class MailActivity(models.Model):

    _inherit = "mail.activity"


    bank_id = fields.Many2one('res.partner.bank', ondelete='cascade')

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
nov 20
2095
1
okt 19
6668
1
júl 22
2435
1
apr 22
3107
1
nov 19
7580