跳至内容
菜单
此问题已终结
1 回复
6281 查看


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.

形象
丢弃
最佳答案

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

   

形象
丢弃
相关帖文 回复 查看 活动
1
11月 20
2234
1
10月 19
6817
1
7月 22
2562
1
4月 22
3227
1
11月 19
7709