from odoo import models, fields, api, _
from odoo.exceptions import UserError

class HelpdeskSla(models.Model):
    _inherit = 'sh.helpdesk.sla'

    @api.model
    def create(self,vals):
        
        res = super(HelpdeskSla, self).create(vals)
        if res.sh_team_id:
            res.update({'sh_ticket_type_id': res.sh_team_id.helpdesk_ticket_type_id.id})
        return res