# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details

from odoo import api, exceptions, fields, models, tools, _
from odoo.exceptions import UserError, AccessError, ValidationError
from odoo.osv import expression
import math
from datetime import datetime, time, timedelta
from odoo.tools.float_utils import float_round
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, ustr
import dateutil.parser


class AccountAnalyticLineSubProject(models.Model):
    _inherit = 'account.analytic.line'

    # sub_project = fields.Many2many('project.project', 'project_subproject_timesheet_rel', 'project_id', 'id',
    #                                domain="[('is_sub_project', '=', True),('parent_project', '=', False)]",
    #                                string='Sub Project')



    # @api.onchange('project_id')
    # def _onchange_parent_project_id(self):
    #     if self.project_id:
    #         parent_project = self.env['project.project'].search([('sub_project', '=', self.project_id.id)], limit=1)
    #         if parent_project:
    #             self.parent_project = parent_project.id
    #         else:
    #             self.parent_project = False
    #     else:
    #         self.parent_project = False