[ADD]ADD notify for done task+add request in project invoice
This commit is contained in:
parent
07f318dad9
commit
cdc8cb98f2
|
|
@ -75,10 +75,10 @@ class ProjectTask(models.Model):
|
||||||
project_no = "Unknown Project"
|
project_no = "Unknown Project"
|
||||||
|
|
||||||
# Create a mail notification for users in both groups
|
# Create a mail notification for users in both groups
|
||||||
self.env['mail.message'].create({
|
rec.env['mail.message'].create({
|
||||||
'message_type': "notification",
|
'message_type': "notification",
|
||||||
'body': _("Task %s is done for project %s and needs your action") % (rec._name, project_no),
|
'body': _("Task %s is done for project %s and needs your action") % (rec.name, project_no),
|
||||||
'subject': _("Invoice Request"),
|
'subject': _("Done Task"),
|
||||||
'partner_ids': [(6, 0, user_ids.mapped('partner_id').ids)],
|
'partner_ids': [(6, 0, user_ids.mapped('partner_id').ids)],
|
||||||
'notification_ids': [(0, 0, {
|
'notification_ids': [(0, 0, {
|
||||||
'res_partner_id': user.partner_id.id,
|
'res_partner_id': user.partner_id.id,
|
||||||
|
|
@ -86,8 +86,8 @@ class ProjectTask(models.Model):
|
||||||
}) for user in user_ids if user.partner_id],
|
}) for user in user_ids if user.partner_id],
|
||||||
'model': rec._name,
|
'model': rec._name,
|
||||||
'res_id': rec.id if rec.id else False, # Ensure res_id exists
|
'res_id': rec.id if rec.id else False, # Ensure res_id exists
|
||||||
'author_id': self.env.user.partner_id.id if self.env.user.partner_id else False,
|
'author_id': rec.env.user.partner_id.id if rec.env.user.partner_id else False,
|
||||||
'email_from': self.env.user.partner_id.email if self.env.user.partner_id else 'noreply@company.com'
|
'email_from': rec.env.user.partner_id.email if rec.env.user.partner_id else 'noreply@company.com'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue