from odoo import api, fields, models


class SubProject(models.Model):
    _inherit = "project.project"
    #_description = "Sub Project"

    is_sub_project = fields.Boolean("Is Sub Project")
    sub_project = fields.Many2many('project.project', 'project_subproject_rel', 'project_id',
                              'id', string='Sub Project')

class InheritProjectTask(models.Model):
    _inherit = 'project.task'

    sub_project = fields.Many2many('project.project', related='project_id.sub_project', string='Sub Project')

