I overrided the function create from 'mail.message' but there is nothing happen I want to create task I did a custom module but it seems that there is nothing happen like I got the wrong originaly function
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hi,
In Odoo 15, you can create a task when a message is created by using the mail thread feature and the mail.message model. Here is an example of a new model that creates a task when a message is created:
class MyModel(models.Model):
_inherit = ['mail.thread', 'mail.message']
@api.model
def create(self, vals):
task = self.env['project.task'].create({
'name': vals.get('subject', ''),
'user_id': vals.get('author_id', False),
})
vals['task_id'] = task.id
message = super(MyModel, self).create(vals)
return message
In this example, when a new message is created, a new task is created with the subject of the message and the author of the message as the assigned user. The task is linked to the message using the task_id field.
Regards
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
نوفمبر 24
|
991 | ||
|
1
يوليو 24
|
1084 | ||
|
2
يوليو 23
|
2924 | ||
|
1
مايو 23
|
2255 | ||
|
0
سبتمبر 22
|
102 |