Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from odoo import models, fields, api
- class MaintenanceRequest(models.Model):
- _inherit = 'maintenance.request'
- @api.model
- def create(self, vals):
- record = super().create(vals)
- template_id = self.env.ref('custom_maintenance.new_request_template').id
- if template_id:
- record.message_post_with_template(template_id)
- return record
Advertisement
Add Comment
Please, Sign In to add comment