コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
6284 ビュー


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
2238
1
10月 19
6820
1
7月 22
2566
1
4月 22
3255
1
11月 19
7711