<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<object-views xmlns="http://axelor.com/xml/ns/object-views" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_5.2.xsd">

	<menuitem name="menu-project-root" order="-103" title="Projects" icon="fa-tasks"  if="__config__.app.isApp('project')"
	     icon-background="#3f6bb9"/> 	

	<menuitem name="project-folder" parent="menu-project-root" title="Project Folder" action="project.folder" order="5"/>
	<action-view name="project.folder" title="Project Folder" model="com.axelor.apps.project.db.ProjectFolder">
		<view type="grid" name="project-folder-grid"/>
		<view type="form" name="project-folder-form"/>
	</action-view>

	<menuitem name="project-all" parent="menu-project-root" order="10"
			  title="Projects"
			  action="project.all"/>
	<action-view name="project.all" title="Projects" model="com.axelor.apps.project.db.Project">
		<view type="grid" name="project-grid"/>
		<view type="form" name="project-form"/>
		<view type="kanban" name="project-kanban"/>
		<domain>self.isProject = true and (self.projectTypeSelect = :_xProjectTypeSelect or self.projectTypeSelect = 0 or self.projectTypeSelect = null)</domain>
		<context name="_fromProject" expr="eval:true"/>
		<context name="_xProjectTypeSelect" expr="eval: __repo__(Project).TYPE_PROJECT"/>
	</action-view>

	<menuitem name="project-phases" parent="menu-project-root" title="Project phases" action="all.phases" order="15"/>
	<action-view name="all.phases" title="Project phases" model="com.axelor.apps.project.db.Project">
		<view type="grid" name="project-grid"/>
		<view type="form" name="project-form"/>
		<view type="kanban" name="project-kanban"/>
		<domain>self.isProject = true and self.projectTypeSelect = :_xProjectTypeSelect</domain>
		<context name="_fromProject" expr="eval:true"/>
		<context name="_xProjectTypeSelect" expr="eval: __repo__(Project).TYPE_PHASE"/>
	</action-view>

	<menuitem name="project-open-tasks" parent="menu-project-root" title="Tasks" order="20" action="all.open.project.tasks"/>
	<action-view name="all.open.project.tasks" title="Project Tasks" model="com.axelor.team.db.TeamTask">
		<view type="kanban" name="team-task-kanban"/>
		<view type="grid" name="team-task-grid"/>
		<view type="form" name="team-task-form"/>
		<domain>self.project.statusSelect IN (1,2) and self.typeSelect = 'task'</domain>
		<context name="_typeSelect" expr="eval: com.axelor.team.db.repo.TeamTaskRepository.TYPE_TASK"/>
	</action-view>

	<menuitem name="project-open-tickets" parent="menu-project-root" title="Tickets" order="21" action="all.open.project.tickets" if-module="axelor-business-support" if="__config__.app.isApp('business-support')"/>
	<action-view name="all.open.project.tickets" title="Ticket" model="com.axelor.team.db.TeamTask">
		<view type="kanban" name="team-task-kanban"/>
		<view type="grid" name="team-task-grid"/>
		<view type="form" name="team-task-form"/>
		<view-param name="forceTitle" value="true"/>
		<domain>self.project.statusSelect IN (1,2) and self.typeSelect = 'ticket'</domain>
		<context name="_typeSelect" expr="eval: com.axelor.team.db.repo.TeamTaskRepository.TYPE_TICKET"/>
	</action-view>

	<menuitem name="project-wiki" parent="menu-project-root" title="Wiki" action="all.wiki" order="30"/>
	<action-view name="all.wiki" title="Project Wiki" model="com.axelor.apps.project.db.Wiki">
		<view type="grid" name="wiki-grid"/>
		<view type="form" name="wiki-form"/>
	</action-view>

	<menuitem name="project-template" parent="menu-project-root" order="38" title="Template"/>

	<menuitem name="project-task-template" parent="project-template" title="Task template" action="project.task.template"/>
	<action-view name="project.task.template" title="Task template" model="com.axelor.apps.project.db.TaskTemplate">
		<view type="grid" name="task-template-grid"/>
		<view type="form" name="task-template-form"/>
	</action-view>

	<menuitem name="project-project-template" parent="project-template" title="Project template" action="project.project.template"/>
	<action-view name="project.project.template" title="Project template" model="com.axelor.apps.project.db.ProjectTemplate">
		<view type="grid" name="project-template-grid"/>
		<view type="form" name="project-template-form"/>
	</action-view>

	<menuitem title="Historical" name="project-historical" parent="menu-project-root" order="39" icon="fa-clock-o"/>

	<menuitem name="project-task-history" parent="project-historical" title="Task history" action="all.tasks.history"/>
	<action-view name="all.tasks.history" title="Task history" model="com.axelor.team.db.TeamTask">
		<view type="grid" name="team-task-grid"/>
		<view type="form" name="team-task-form"/>
		<domain>self.status = 'closed' or self.status = 'canceled'</domain>
	</action-view>

  <menuitem name="project-reporting" parent="menu-project-root" order="40" title="Reportings" icon="fa-bar-chart"/>

	<menuitem name="project-reporting-my-projects" parent="project-reporting" order="31" title="My projects" action="project.my.projects"/>
	<action-view name="project.my.projects" title="My projects">
		<view type="dashboard" name="project-my-projects"/>
	</action-view>
	
	<menuitem name="project-reporting-planned-charge" parent="project-reporting" order="32" title="Planned charge" action="project.planned.charge"/>
	<action-view name="project.planned.charge" title="Planned charge">
		<view type="dashboard" name="project-planned-charge"/>
	</action-view>

	<menuitem name="project-resource-booking" title="Resource bookings" order="35" parent="menu-project-root" action="project.resource.booking" if="__config__.app.getApp('project').getResourceManagement()" />
	<action-view name="project.resource.booking" title="Resource bookings" model="com.axelor.apps.project.db.ResourceBooking">
		<view type="grid" name="resource-booking-grid" />
		<view type="form" name="resource-booking-form" />
		<view type="calendar" name="resource-booking-calendar" />
	</action-view>
	
    <!-- PROJECT CONFIGURATION -->
	<menuitem name="project-configurations" parent="menu-project-root" title="Configuration" order="41" icon="fa-cog"/>
	
	<menuitem name="team-task-category" parent="project-configurations" title="Category" action="team.task.category"/>
	<action-view name="team.task.category" title="Team Task Category" model="com.axelor.apps.project.db.TeamTaskCategory">
		<view type="grid" name="team-task-category-grid"/>
		<view type="form" name="team-task-category-form"/>
	</action-view>
	
	<menuitem name="project-resource-type" parent="project-configurations" title="Resource types" action="project.resource.types" if="__config__.app.getApp('project').getResourceManagement()" />
	<action-view name="project.resource.types" title="Resource types" model="com.axelor.apps.project.db.ResourceType">
		<view type="grid" name="resource-type-grid"/>
		<view type="form" name="resource-type-form"/>
	</action-view>

	<menuitem name="project-resource" title="project-Resources" order="32" parent="project-configurations" action="project.resource" if="__config__.app.getApp('project').getResourceManagement()" />
	<action-view name="project.resource" title="Resources" model="com.axelor.apps.project.db.Resource">
		<view type="grid" name="resource-grid" />
		<view type="form" name="resource-form" />
	</action-view>

</object-views>
