Guest User

Untitled

a guest
Aug 16th, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. class custom_maintenance_notify(models.Model):
  2.     _name = MaintenanceRequest
  3.     _inherit = ['maintenance.request','mail.thread']
  4.  
  5.     @api.model
  6.     def create(self, vals):
  7.         record = super(MaintenanceRequest, self).create(vals)
  8.        
  9.         template_id = self.env.ref('custom_maintenance.new_request_template').id
  10.         if template_id:
  11.             record.message_post_with_template(template_id)
  12.         return record
Advertisement
Add Comment
Please, Sign In to add comment