تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6132 أدوات العرض


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
نوفمبر 20
2075
1
أكتوبر 19
6657
1
يوليو 22
2381
1
أبريل 22
3089
Message in chatter تم الحل
1
نوفمبر 19
7550