<?xml version="1.0" ?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">

	<module name="project" package="com.axelor.team.db"/>

	
	<entity name="TeamTask">
		<many-to-one name="project" ref="com.axelor.apps.project.db.Project" title="Project"/>

        <string name="fullName" namecolumn="true" title="Name" search="id,name"/>
	  	
	  	<many-to-one name="parentTask" ref="com.axelor.team.db.TeamTask" title="Parent task"/>
	 	<many-to-one name="teamTaskCategory" ref="com.axelor.apps.project.db.TeamTaskCategory" title="Category"/>
    	<integer name="progressSelect" title="Progress" selection="project.task.progress.select"/>
    	<many-to-one name="team" ref="com.axelor.team.db.Team" title="Team"/>
    	<one-to-many name="teamTaskList" ref="com.axelor.team.db.TeamTask" mappedBy="parentTask"/>
	  
		<many-to-many name="membersUserSet" ref="com.axelor.auth.db.User" title="Followers"/>
		<string name="description" title="Description" large="true"/>
		<many-to-one name="product" ref="com.axelor.apps.base.db.Product" title="Product"/>
		<many-to-one name="unit" ref="com.axelor.apps.base.db.Unit" title="Unit"/>
		<decimal name="quantity" title="Quantity"/>
		<decimal name="unitPrice" title="Unit price" />
		<many-to-one name="currency" ref="com.axelor.apps.base.db.Currency" title="Currency" index="false"/>
		
		<!-- Gantt view fields -->
		
		<decimal name="plannedProgress" title="Planned progress" />
		<many-to-many name="finishToStartSet" title="Predecessors tasks" ref="TeamTask" />
		<many-to-many name="startToStartSet" title="Tasks to start before start" ref="TeamTask"/>
		<many-to-many name="finishToFinishSet" title="Tasks to finish before finish" ref="TeamTask"/>
		<decimal name="durationHours" title="Duration hours" />
		<date name="taskEndDate" title="Task end" />

		<one-to-many name="timerList" ref="com.axelor.apps.base.db.Timer"/>
		
		<decimal name="budgetedTime" title="Estimated time"/>
		<many-to-one name="metaFile" title="Signature" ref="com.axelor.meta.db.MetaFile" />

	 <track replace="true">
	 	<field name="status"/>
	 	<field name="teamTaskCategory"/>
	 	<field name="progressSelect"/>
	 	<field name="assignedTo"/>
	 	<message if="true" on="UPDATE">Task updated</message>
	 </track>
	  
	</entity>

</domain-models>
