跳至內容
選單
此問題已被標幟
1 回覆
6252 瀏覽次數


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
2217
1
10月 19
6791
1
7月 22
2548
1
4月 22
3218
1
11月 19
7693