i need to send notification when i create new employee, the mail going well but i need to take the employee name to the mail body
that is my code
@api.model
def create(self, vals):
result = super(hr_employee, self).create(vals)
noti = {'subject': "new member are coming",
'body': "MR( " + str(
self.ar_name) + " ) has been one of our team"}
result.message_post(
message_type='notification',
subtype='mail.mt_comment',
partner_ids=[1],
**noti
)
return result
i get the name = False
and the is an examble
**MR( False ) has been one of our team
--
Administrator**
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Бухоблік
- Склад
- PoS
- Project
- MRP
Це запитання позначене
1
Відповісти
3725
Переглядів
Hi,
Instead of self.ar_name try vals['ar_name']
def create(self, vals):
result = super(hr_employee, self).create(vals)
noti = {'subject': "new member are coming",
'body': "MR( " + str(
vals['ar_name']) + " ) has been one of our team"}
result.message_post(
message_type='notification',
subtype='mail.mt_comment',
partner_ids=[1],
**noti
)
return result
Thanks
thanks dear , it worked well , can you tell me briefly the difference between self and vals
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
РеєстраціяRelated Posts | Відповіді | Переглядів | Дія | |
---|---|---|---|---|
|
2
лип. 25
|
163 | ||
|
0
груд. 24
|
944 | ||
|
2
жовт. 24
|
1077 | ||
|
1
серп. 24
|
2181 | ||
|
2
лип. 24
|
1458 |