<?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">

	<grid name="project-grid" title="Projects" model="com.axelor.apps.project.db.Project">
		<toolbar>
			<button name="projectPlanningBtn" title="Project planning" onClick="action-project-view-project-planning-wizard" if="__config__.app.isApp('employee')" if-module="axelor-human-resource"/>
		</toolbar>
		<menubar>
			<menu name="projectToolsMenu" title="Tools" icon="fa-wrench" showTitle="true">
				<item name="ganttWithUserItem" title="Gantt with user" action="action-project-open-popup-select-users"/>
				<item name="ganttWithProjectItem"  title="Gantt with project" action="action-project-open-popup-select-projects"/>
			</menu>
		</menubar>
		<hilite background="primary" if="isProject &amp;&amp; projectTypeSelect == 1"/>
		<hilite background="info" if="isProject &amp;&amp; projectTypeSelect == 2"/>
		<field name="code"/>
		<field name="name"/>
    <field name="parentProject"/>
		<field name="clientPartner"/>
		<field name="assignedTo"/>
		<field name="fromDate" />
		<field name="toDate" />
		<field name="dueDate" />
		<field name="imputable" width="90"/>
		<button name="openGanttBtn" title="Gantt" icon="fa-tasks" onClick="action-project-open-gantt"/>
		<field name="isProject" hidden="true"/>
		<field name="projectTypeSelect" hidden="true"/>
	</grid>

	<grid name="folder-project-grid" title="Projects" model="com.axelor.apps.project.db.Project">
		<field name="fullName"/>
		<field name="company" if="__config__.app.getApp('base').getEnableMultiCompany()"/>
		<field name="clientPartner"/>
	</grid>

	<form name="project-form" title="Project"
		model="com.axelor.apps.project.db.Project" onLoad="action-project-on-load-group"
		onNew="action-project-group-on-new-project">
		<menubar>
			<menu name="projectReportsMenu" title="Reports" showTitle="true" icon="fa-files-o">
				<item if-module="axelor-business-project" name="planificationAndCostsItem" title="Planification and costs"
					action="save,action-project-method-print-planif-and-cost" />
				<item if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
				name="financialReportItem" title="Financial Report" showIf="isBusinessProject"
					action="save,action-project-method-print-project" />
			</menu>
			<menu name="projectToolsMenu" title="Tools" showTitle="true" icon="fa-wrench">
				<item name="ganttItem" title="Gantt" showIf="isProject" action="action-project-open-gantt" />
				<item name="bookResourceItem" title="Book resource" showIf="isProject" if=" __config__.app.getApp('project')?.resourceManagement"
					action="save,action-project-book-resource" />
			</menu>
		</menubar>
		<panel name="mainPanel">
			<panel name="detailsPanel" colSpan="12">
				<field name="statusSelect" showTitle="false" readonly="true"
					colSpan="8" widget="NavSelect" />
				<field name="$viewerProjectTags" showTitle="false" colSpan="4"
					readonly="true">
					<viewer
						depends="isBusinessProject,isProject,projectTypeSelect,$toInvoiceCounter,id">
							<![CDATA[
								<h4 style="text-align: right;">
									<span class="label label-default" style="background-color: #FD6217; margin: 5px 0 !important; display: inline-table; line-height: initial; border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 0.4em;" ng-show="record.isBusinessProject" x-translate>To Invoice</span><span class="label label-default" style="background-color: #FFAA00; margin: 5px 0 !important; display: inline-table; line-height: initial; border-top-left-radius: 0; border-bottom-left-radius: 0;" ng-show="record.isBusinessProject &amp;&amp; record.id">{{record.$toInvoiceCounter}}</span>
									<span class="label label-default" style="background-color: #86BC25; margin: 5px 0 !important; display: inline-table; line-height: initial;" ng-show="record.isProject &amp;&amp; record.projectTypeSelect == 1" x-translate>Project</span>
									<span class="label label-default" style="background-color: #86BC25; margin: 5px 0 !important; display: inline-table; line-height: initial;" ng-show="record.isProject &amp;&amp; record.projectTypeSelect == 2" x-translate>Project phase</span>
									<span class="label label-default" style="background-color: #2185D0; margin: 5px 0 !important; display: inline-table; line-height: initial;" ng-show="record.isBusinessProject" x-translate>Business</span>
								</h4>
							]]>
						</viewer>
				</field>
			</panel>

			<panel name="informationPanel" colSpan="10">
				<field name="fullName" showTitle="false" colSpan="12"
					css="label-bold bold large">
					<editor x-show-titles="false">
						<panel name="seq" colSpan="3">
						<field name="code" showTitle="false" colSpan="12" required="true" if="__config__.app.getApp('project')?.generateProjectSequence"
							css="label-bold bold large" x-bind="{{code|unaccent|uppercase}}" />
						<field name="code" showTitle="false" colSpan="12" required="true" if="!__config__.app.getApp('project')?.generateProjectSequence"
							css="label-bold bold large" x-bind="{{code|unaccent|uppercase}}" />
						</panel>
						<field name="name" showTitle="false" colSpan="6" required="true"
							css="label-bold bold large" />
					</editor>
				</field>
			</panel>
		</panel>
		<panel name="detailsPanel">
			<panel name="generalInfoPanel" colSpan="12">
				<field name="company" form-view="company-form" grid-view="company-grid"
					colSpan="3"  canEdit="false"/>
				<field name="clientPartner" domain="self.isCustomer = true AND :company member of self.companySet" onChange="action-project-method-get-partner-data"
					requiredIf="isBusinessProject" form-view="partner-form" grid-view="partner-grid"
					colSpan="3" if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
					showIf="isBusinessProject" />
				<field name="currency" colSpan="3"
					if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
					showIf="isBusinessProject" canEdit="false"/>
				<field name="priceList" colSpan="3"
					if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
					showIf="isBusinessProject" canEdit="false"/>
				<field name="contactPartner" onSelect="action-attrs-domain-on-contact-partner"
					form-view="partner-form" grid-view="partner-grid" colSpan="6"
					if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
					showIf="isBusinessProject" />
					<field name="customerAddress" grid-view="address-grid" form-view="address-form"
					if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
          showIf="isBusinessProject" domain="self IN (SELECT address FROM PartnerAddress where partner = :clientPartner)"/>
			</panel>
			<field name="progress" showIf="isProject" widget="Progress" colSpan="12">
				<editor>
					<field name="progress" showTitle="false" colSpan="3" />
				</editor>
			</field>
			<field name="description" colSpan="12" widget="html" />
		</panel>

		<panel-tabs name="mainPanelTab">
			<panel title="Task Tree" name="taskTreePanel" showIf="isProject">
				<panel title="Phases" name="phasesPanel"
					showIf="isProject &amp;&amp; childProjectList.length > 0" colSpan="12" showTitle="false">
					<button name="addPhaseBtn" title="New" colSpan="2"
						css="btn-custom text-left" icon="fa-plus" onClick="save,action-project-view-phase-new" />
					<button name="allPhasesBtn" title="All phases" colSpan="4"
						css="btn-custom text-left" icon="fa-tasks" onClick="save,action-project-view-phase-all" />
					<button name="allPhaseTasksBtn" title="All phase tasks" colSpan="6"
						css="btn-custom text-left" icon="fa-tasks"
						onClick="save,action-project-phase-view-show-phase-task" />
					<panel-dashlet name="projectPhaseTreeDashletPanel" title="Phases" colSpan="12"
						action="tree:project-phase-tree" />
				</panel>
				<button name="addTaskBtn" title="New task" colSpan="2"
					css="btn-custom text-left" icon="fa-plus" onClick="save,action-project-add-task" />
				<button name="addTicketBtn" title="New ticket" colSpan="2" css="btn-custom text-left" icon="fa-plus" onClick="save,action-project-add-ticket" if-module="axelor-business-support" if="__config__.app.isApp('business-support')"/>
				<button name="allTaskBtn" title="All tasks" colSpan="2"
					css="btn-custom text-left" icon="fa-tasks"
					onClick="action-project-view-show-related-tasks" />
				<panel-dashlet name="projectTaskTreeDashletPanel" title="Task Tree" colSpan="12"
					action="action-view-show-project-task-tree" />
				<panel-dashlet name="taskInvoicingDashletPanel" title="Task Invoicing" colSpan="12" 
					action="action-dashlet-project-show-all-invoicing-task" if="__config__.app.isApp('business-project')" canSearch="true"/>
			</panel>
			<panel title="Members" name="membersPanel">
				<field name="team" title="Team"
					readonlyIf="synchronize || extendsMembersFromParent" colSpan="6"
					canNew="false" canEdit="false" />
				<field name="synchronize" readonlyIf="extendsMembersFromParent"
					colSpan="2" widget="boolean-switch" />
				<field name="extendsMembersFromParent" hidden="true"
					showIf="projectTypeSelect == 2" colSpan="3" widget="boolean-switch" />
				<field name="membersUserSet" colSpan="12"
					widget="TagSelect" canNew="false" form-view="user-form" grid-view="user-grid" />
				<button name="importMemberBtn" title="Import all members"
					showIf="team != null" readonlyIf="extendsMembersFromParent" colSpan="3"
					onClick="action-project-method-import-members" />
				<panel title="Planning" name="planningPanel" colSpan="12"
					 if="__config__.app.isApp('employee')" if-module="axelor-human-resource">
					<field name="totalPlannedHrs" readonly="true">
						<viewer><![CDATA[
		                   	<span>{{record.totalPlannedHrs}} </span><span x-translate>hours</span>
		       			]]></viewer>
					</field>
					<spacer name="totalPlannedHrsSpacer" colSpan="6" />
					<button name="planPlanningBtn" title="Plan project" css="btn-custom text-left" onClick="save,action-project-view-project-planning-wizard"  hideIf="$popup()" colSpan="3"/>
					<button name="addMultipleLinesBtn" title="Add multiple lines" css="btn-custom text-left" onClick="save,action-project-view-add-multiple-project-planning-time" colSpan="3" hideIf="$popup()"/>
					<button name="addProjectPlanningTimeLineBtn" title="New line"  css="btn-custom text-left" colSpan="3" onClick="save,action-project-view-project-planning-time-add-new,save" />
					<button name="removeProjectPlanningTimeLineBtn" title="Remove lines" css="btn-custom text-left" colSpan="3" onClick="save,action-project-attrs-project-planning-time-remove,save" />
					<field name="$projectPlanningTimeSet" hidden="true" type="many-to-many" widget="TagSelect" title="Planned Time Planning"
					colSpan="12" target="com.axelor.apps.project.db.ProjectPlanningTime" canEdit="false" canNew="false" 
					grid-view="project-planning-time-grid" form-view="project-planning-time-form"/>
					<button name="removeSelectedPlanningTimeBtn" colSpan="4" hidden="true"  title="Remove selected lines"  onClick="action-project-validate-remove-project-planning-time,action-project-planning-time-method-remove-project-planning-time"/>
					<button name="cancelRemovePlanningTimeBtn" colSpan="4" hidden="true" title="Cancel" onClick="action-project-attrs-project-planning-time-cancel-remove" />
					<panel-dashlet name="projectPlanningTimePanel" title="Planned Time Planning" action="action-project-dashlet-project-planning-time" colSpan="12" canSearch="true"/>
				</panel>
			</panel>
			
			<panel title="Log Times" name="logTimesPanel"
				 if="__config__.app.isApp('timesheet')" if-module="axelor-human-resource">
				<field name="timeSpent" title="Time Spent" readonly="true"
					colSpan="3" />
				<panel-dashlet name="validatedTimesheetsPanel" action="action-project-dashlet-validated-timeshet-lines" title="Validated Timesheet lines" colSpan="12" canSearch="true"/>
				<panel-dashlet name="waitingTimesheetLinesPanel" action="action-project-dashlet-project-waiting-timeshet-lines" title="Waiting Timesheet lines" colSpan="12" canSearch="true"/>
			</panel>
			<panel title="Sales" name="salesPanel"  showIf="isBusinessProject"
				if="__config__.app.isApp('business-project')
				&amp;&amp; __config__.app.getApp('business-project').getShowSaleOrderLineRelatedToProject()" 
				if-module="axelor-business-project">
				<button name="generateQuotationBtn" title="Generate quotation"
					onClick="action-project-method-generate-quotation" css="btn-custom text-left"  />
				<button name="showSaleOrderLinesBtn" title="Show sale order lines" 
						css="btn-custom" icon="fa-line-chart" onClick="action-project-view-show-sale-order-lines" />
				<panel-dashlet name="saleQuotationPanel" action="action-project-dashlet-sale-quotation" colSpan="12" canSearch="true"/>
				<panel-dashlet name="saleOrderPanel" action="action-project-dashlet-sale-order" colSpan="12" canSearch="true"/>
				<button name="selectNewSOLinesBtn" title="Select new lines" css="btn-custom text-left" onClick="save,action-project-attrs-sales-order-line-select-lines"  hideIf="$popup() || $readonly()" colSpan="3"/>
				<button name="manageSOLinesBtn" title="Manage lines" css="btn-custom text-left" onClick="save,action-project-attrs-sales-order-line-manage-lines"  hideIf="$popup() || $readonly()" colSpan="3"/>
				<field name="$salesOrderLineSet" hidden="true" type="many-to-many" widget="TagSelect" title="Sale order lines"
					colSpan="12" target="com.axelor.apps.sale.db.SaleOrderLine" canEdit="false" canNew="false" 
					grid-view="sale-order-line-project-grid" form-view="sale-order-line-form"/>
				<button-group name="SOLinesBtnGroup" colSpan="4">
					<button name="addSelectedSOLinesBtn" hidden="true" title="Add selected lines" onClick="action-sale-order-line-method-set-project"/>
       				<button name="unlinkSelectedSOLinesBtn" hidden="true"  title="Unlink selected lines"  onClick="action-validate-unset-project,action-sale-order-line-method-unset-project"/>
				</button-group>
				<button name="cancelManageSOLinesBtn" colSpan="4" hidden="true" title="Cancel" onClick="action-project-attrs-sales-order-line-cancel-manage-lines" />
				<panel-dashlet name="saleOrderLinePanel" action="action-project-view-show-confirmed-sale-order-lines" colSpan="12" canSearch="true"/>
				<panel-dashlet name="customerDeliveriesPanel" action="action-project-dashlet-customer-deliveries" colSpan="12"/>
			</panel>
			<panel title="Purchases" name="purchasesPanel"  showIf="isBusinessProject"
				if="__config__.app.isApp('business-project')  
					&amp;&amp; __config__.app.getApp('business-project').getShowPurchaseOrderLineRelatedToProject()" 
					if-module="axelor-business-project">
				<button name="generatePurchaseQuotationBtn" title="Generate quotation"
					onClick="action-project-method-generate-purchase-quotation" css="btn-custom text-left"  />	
				<button name="showPurchaseOrderLinesBtn" title="Show purchase order lines"
						css="btn-custom" icon="fa-shopping-cart"
						onClick="action-project-view-show-purchase-order-lines" />
				<panel-dashlet name="purchaseQuotationPanel" action="action-project-project-purchase-quotation" colSpan="12" canSearch="true"/>
				<panel-dashlet name="purchaseOrderPanel" action="action-project-dashlet-purchase-order" colSpan="12" canSearch="true"/>
				<button name="selectNewPOLinesBtn" title="Select new lines" css="btn-custom text-left" onClick="save,action-project-attrs-purchase-order-line-select-lines"  hideIf="$popup() || $readonly()" colSpan="3"/>
				<button name="managePOLinesBtn" title="Manage lines" css="btn-custom text-left" onClick="save,action-project-attrs-purchase-order-line-manage-lines"  hideIf="$popup() || $readonly()" colSpan="3"/>
				<field name="$purchaseOrderLineSet" hidden="true" type="many-to-many" widget="TagSelect" title="Purchase order lines"
					colSpan="12" target="com.axelor.apps.purchase.db.PurchaseOrderLine" canEdit="false" canNew="false" 
					grid-view="purchase-order-line-project-grid" form-view="purchase-order-line-form"/>
				<button-group name="POLinesBtnGroup" colSpan="4">
					<button name="addSelectedPOLinesBtn" hidden="true" title="Add selected lines" onClick="action-purchase-order-line-method-set-project"/>
       				<button name="unlinkSelectedPOLinesBtn" hidden="true"  title="Unlink selected lines"  onClick="action-validate-unset-project,action-purchase-order-line-method-unset-project"/>
				</button-group>
				<button name="cancelManagePOLinesBtn" colSpan="4" hidden="true" title="Cancel" onClick="action-project-attrs-purchase-order-line-cancel-manage-lines" />
				<panel-dashlet name="purchaseOrderLinePanel" action="action-project-view-show-confirmed-purchase-order-lines" colSpan="12" canSearch="true"/>
				<panel-dashlet name="supplierArrivalsPanel" action="action-project-dashlet-supplier-arrivals" colSpan="12"/>
			</panel>
			<panel name="resourceBookingListPanel" title="Resource booking" if="__config__.app.getApp('project').resourceManagement">
				<panel-related name="resourceBookingListPanel" field="resourceBookingList" form-view="resource-booking-form" grid-view="resource-booking-grid-incl-project" colSpan="12"/>
			</panel>
			<panel title="Expenses" name="expensesPanel"  showIf="isBusinessProject"
				if="__config__.app.isApp('business-project') 
				&amp;&amp;  __config__.app.getApp('business-project').getShowExpenseLineRelatedToProject()"
				if-module="axelor-business-project">
				<button name="showExpenseLinesBtn" title="Show expense lines" css="btn-custom text-left"
						icon="fa-credit-card" onClick="action-project-view-show-expense-lines" />
				<panel-dashlet name="expenseWaitingPanel" action="action-project-dashlet-expense-waiting" colSpan="12" canSearch="true"/>
				<panel-dashlet name="expensePanel" action="action-project-dashlet-expense-validated" colSpan="12" canSearch="true"/>
				<button name="selectNewExpenseLinesBtn" title="Select new lines" css="btn-custom text-left" onClick="save,action-project-attrs-expense-line-select-lines"  hideIf="$popup() || $readonly()" colSpan="3"/>
				<button name="manageExpenseLinesBtn" title="Manage lines" css="btn-custom text-left" onClick="save,action-project-attrs-expense-line-manage-lines"  hideIf="$popup() || $readonly()" colSpan="3"/>
				<field name="$expenseLineSet" hidden="true" type="many-to-many" widget="TagSelect" title="Expense lines"
					colSpan="12" target="com.axelor.apps.hr.db.ExpenseLine" canEdit="false" canNew="false" 
					grid-view="expense-line-project-grid" form-view="expense-line-form"/>
				<button-group name="expenseLinesBtnGroup" colSpan="4">
					<button name="addSelectedExpenseLinesBtn" hidden="true" title="Add selected lines" onClick="action-expense-line-method-set-project"/>
       				<button name="unlinkSelectedExpenseLinesBtn" hidden="true"  title="Unlink selected lines"  onClick="action-validate-unset-project,action-expense-line-method-unset-project"/>
				</button-group>
				<button name="cancelManageExpenseLinesBtn" colSpan="4" hidden="true" title="Cancel" onClick="action-project-attrs-expense-line-cancel-manage-lines" />
				<panel-dashlet name="expenseLinePanel" action="action-project-view-show-validated-expense-lines" colSpan="12" canSearch="true"/>
			</panel>
			<panel title="Production" name="productionPanel"  showIf="isBusinessProject"
				 if-module="axelor-business-production"
				 if="__config__.app.isApp('business-project') 
				 &amp;&amp; __config__.app.getApp('business-project').getShowProductionOrderRelatedToProject()">
				<button
						name="showProductionOrdersBtn"
						title="Show production orders" css="btn-custom text-left" icon="fa-cogs"
						onClick="action-project-view-show-production-orders" />
				<panel-related
					colSpan="12" field="productionOrderList"
					canSelect="true" canNew="false" canEdit="false" canSearch="true" name="productionOrderList"/>
			</panel>
			<panel title="Invoicing" name="invoicingPanel"  showIf="isBusinessProject"
				 if="__config__.app.isApp('business-project')" if-module="axelor-business-project">
				<field name="toInvoice" title="Project.toInvoice" colSpan="3" onChange="action-project-attrs-set-invoicing-sequence"/>
				<field name="isInvoicingTimesheet" colSpan="3"/>
				<field name="isInvoicingExpenses" colSpan="3" />
				<field name="isInvoicingPurchases" colSpan="3" />
				<field name="invoicingSequenceSelect" showIf="toInvoice" requiredIf="toInvoice" selection-in="[1,2]" colSpan="6"/>
				<spacer name="invoicingSequenceSelectSpacer" colSpan="6"/>
				<button name="showInvoicingProjectsBtn" title="Create invoicing project"
						css="btn-custom" icon="fa-file-text-o"
						onClick="save,action-project-view-show-invoicing-projects"/>
				<field name="invoicingComment" colSpan="12" />
				<panel-related name="manualElementListPanel" colSpan="12" field="manualElementList" form-view="manual-element-form" grid-view="manual-element-grid"/>
				<panel-dashlet name="allinvoicingProjectsPanel" action="action-dashlet-project-show-all-invoicing-project" colSpan="12" />
				<panel-dashlet name="customerInvoicePanel" action="action-project-dashlet-customer-invoices" colSpan="12" if="__config__.app.getApp('business-project').getShowSaleInvoiceLineRelatedToProject()" canSearch="true"/>
				<button name="selectNewCustomerInvoiceLinesBtn" title="Select new lines" css="btn-custom text-left" onClick="save,action-project-attrs-customer-invoice-line-select-lines"  hideIf="$popup() || $readonly()" colSpan="3" if="__config__.app.getApp('business-project').getShowSaleInvoiceLineRelatedToProject()" />
				<button name="manageCustomerInvoiceLinesBtn" title="Manage lines" css="btn-custom text-left" onClick="save,action-project-attrs-customer-invoice-line-manage-lines"  hideIf="$popup() || $readonly()" colSpan="3" if="__config__.app.getApp('business-project').getShowSaleInvoiceLineRelatedToProject()" />
				<field name="$customerInvoiceLineSet" hidden="true" type="many-to-many" widget="TagSelect" title="Customer Invoice lines"
					colSpan="12" target="com.axelor.apps.account.db.InvoiceLine" canEdit="false" canNew="false" 
					grid-view="invoice-line-project-grid" form-view="invoice-line-form"/>
				<button-group name="customerInvoiceLinesBtnGroup" colSpan="4">
					<button name="addSelectedCustomerInvoiceLinesBtn" hidden="true" title="Add selected lines" onClick="action-invoice-line-method-set-customer-invoice-line-project"/>
       				<button name="unlinkSelectedCustomerInvoiceLinesBtn" hidden="true"  title="Unlink selected lines"  onClick="action-validate-unset-project,action-invoice-line-method-unset-customer-invoice-line-project"/>
				</button-group>
				<button name="cancelManageCustomerInvoiceLinesBtn" colSpan="4" hidden="true"  title="Cancel" onClick="action-project-attrs-customer-invoice-line-cancel-manage-lines" />
				<panel-dashlet name="customerInvoiceLinePanel" action="action-project-view-show-sale-invoice-lines" colSpan="12" if="__config__.app.getApp('business-project').getShowSaleInvoiceLineRelatedToProject()" canSearch="true"/>
				<panel-dashlet name="supplierInvoicePanel"  action="action-project-dashlet-supplier-invoices" colSpan="12" if="__config__.app.getApp('business-project').getShowPurchaseInvoiceLineRelatedToProject()" canSearch="true"/>
				<button name="selectNewSupplierInvoiceLinesBtn" title="Select new lines" css="btn-custom text-left" onClick="save,action-project-attrs-supplier-invoice-line-select-lines"  hideIf="$popup() || $readonly()" colSpan="3" if="__config__.app.getApp('business-project').getShowPurchaseInvoiceLineRelatedToProject()"/>
				<button name="manageSupplierInvoiceLinesBtn" title="Manage lines" css="btn-custom text-left" onClick="save,action-project-attrs-supplier-invoice-line-manage-lines" hideIf="$popup() || $readonly()" colSpan="3" if="__config__.app.getApp('business-project').getShowPurchaseInvoiceLineRelatedToProject()" />
				<field name="$supplierInvoiceLineSet" hidden="true" type="many-to-many" widget="TagSelect" title="Supplier Invoice lines"
					colSpan="12" target="com.axelor.apps.account.db.InvoiceLine" canEdit="false" canNew="false" 
					grid-view="invoice-line-project-grid" form-view="invoice-line-form"/>
				<button-group name="supplierInvoiceLinesBtnGroup" colSpan="4">
					<button name="addSelectedSupplierInvoiceLinesBtn" hidden="true" title="Add selected lines" onClick="action-invoice-line-method-set-supplier-invoice-line-project"/>
       				<button name="unlinkSelectedSupplierInvoiceLinesBtn" hidden="true"  title="Unlink selected lines"  onClick="action-validate-unset-project,action-invoice-line-method-unset-supplier-invoice-line-project"/>
				</button-group>
				<button name="cancelManageSupplierInvoiceLinesBtn" colSpan="4" hidden="true" title="Cancel" onClick="action-project-attrs-supplier-invoice-line-cancel-manage-lines" />
				<panel-dashlet name="supplierInvoiceLinePanel" action="action-project-view-show-purchase-invoice-lines" colSpan="12" if="__config__.app.getApp('business-project').getShowPurchaseInvoiceLineRelatedToProject()" canSearch="true"/>
				<panel-dashlet name="advancePaymentInvoicesDashletPanel" action="action-project-dashlet-advance-payment-invoices" colSpan="12" 
					if="__config__.app.getApp('business-project').getShowPurchaseInvoiceLineRelatedToProject() || __config__.app.getApp('business-project').getShowSaleInvoiceLineRelatedToProject()" canSearch="true"/>
			</panel>
			<panel title="Analytic" name="analyticPanel" showIf="isBusinessProject"
			     if="__config__.app.isApp('business-project')" if-module="axelor-business-project">
				<panel-dashlet name="analyticDashletPanel" action="action-project-dashlet-analytic-move-lines" colSpan="12"/>
    		</panel>
			<panel title="Wiki"  name="wikiPanel" >
				<panel-related name="wikiListPanel" field="wikiList" colSpan="12" form-view="wiki-form" grid-view="wiki-grid-incl-project"/>
			</panel>
			<panel title="Roadmap" name="roadmapPanel" if-module="axelor-business-support" if="__config__.app.isApp('business-support')">
				<panel-related name="roadmapListPanel" field="roadmapList" colSpan="12" form-view="project-version-form">
					<field name="title"/>
					<field name="statusSelect"/>
					<field name="testingServerDate"/>
					<field name="productionServerDate"/>
				</panel-related>
			</panel>
			<panel name="announcementPanel" title="Announcement" if-module="axelor-business-support" if="__config__.app.isApp('business-support')">
				<panel-related name="announcementListPanel" field="announcementList" colSpan="12" form-view="project-announcement-form">
					<field name="title"/>
					<field name="date"/>
					<field name="content"/>
				</panel-related>
			</panel>
			<panel title="Configurations" name="configurationsPanel" >
				<field if="__config__.app.isApp('employee')" if-module="axelor-human-resource"
					name="productSet" colSpan="12" widget="TagSelect" canEdit="false"
					domain="self.isActivity = true" form-view="product-activity-form"
					grid-view="product-activity-grid" />
				<field name="teamTaskCategorySet" colSpan="12" widget="TagSelect" />
				<field name="projectFolderSet" colSpan="12" widget="TagSelect" />
				<field name="excludeTimesheetEditor" />
				<field name="childProjectList" hidden="true" />
				<field name="sequence" hidden="true" />
				<field name="excludePlanning" if-module="axelor-business-project"
					showIf="isProject" />
				<field name="imputable" colSpan="4" widget="boolean-switch"
					if="__config__.app.isApp('employee')" if-module="axelor-human-resource" />
			</panel>
			<panel title="Contracts" name="contractPanel" if="__config__.app.isApp('business-project')" if-module="axelor-business-project">
				<button name="createNewCustomerContract" title="Create new customer contract" colSpan="6" onClick="save,action-project-view-create-new-customer-contract"/>
				<button name="createNewSupplierContract" title="Create new supplier contract" colSpan="6" onClick="save,action-project-view-create-new-supplier-contract"/>
				<panel-dashlet name="customerContractPanel" title="Customer contracts" action="action-project-dashlet-customer-contracts" colSpan="12" canSearch="true"/>
				<panel-dashlet name="supplierContractPanel" title="Supplier contracts" action="action-project-dashlet-supplier-contracts" colSpan="12" canSearch="true"/>
				<panel-dashlet name="contractInvoicePanel" title="Invoices" action="action-project-dashlet-contract-invoices" colSpan="12"/>
			</panel>
		</panel-tabs>
		<panel name="attrsPanel">
			<field name="attrs" colSpan="12" hidden="true" />
		</panel>
		<panel name="actionsPanel"  colSpan="2" sidebar="true">
			<button name="startBtn" title="Start" hidden="true" showIf="statusSelect == 1"
				colSpan="12" icon="fa-play" onClick="action-project-record-status-in-progress,save" />
			<button name="finishBtn" title="Finish" hidden="true" showIf="statusSelect == 2"
				colSpan="12" icon="fa-check" onClick="action-project-record-status-finished,save" />
			<button name="cancelBtn" title="Cancel" hidden="true"
				showIf="statusSelect != 4" colSpan="12" css="btn-danger"
				icon="fa-times-circle" onClick="action-project-record-status-canceled,save" />
			<button name="newStatusBtn" title="Reset to New" hidden="true"
				showIf="statusSelect == 4" colSpan="12" css="btn-danger"
				icon="fa-file" onClick="action-project-record-status-new,save" />
		</panel>
		<panel name="characteristicsPanel" title="Characteristics" colSpan="12"
			sidebar="true" canCollapse="true">
			<panel name="configPanel" colSpan="12">
				<field if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
					name="isProject" colSpan="6" widget="boolean-switch" />
				<field if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
					name="isBusinessProject" colSpan="6" widget="boolean-switch" />
				<field name="isShowPhasesElements" hideIf="projectTypeSelect == 2" colSpan="12" widget="boolean-switch" />
				<field if="__config__.app.isApp('business-project')" if-module="axelor-business-project"
          name="$toInvoiceCounter" showTitle="false" hidden="true" colSpan="6" />
			</panel>
			<panel if-module="axelor-business-project" name="project"
				showIf="isProject" colSpan="12">
				<field name="projectTypeSelect" onChange="action-project-record-empty-parent-project"
					requiredIf="isProject" />
				<field name="parentProject" showIf="projectTypeSelect == 2" canEdit="false"
					form-view="project-form" grid-view="project-grid"
					onSelect="action-project-attrs-set-parent-project-domain"
					requiredIf="projectTypeSelect == 2" />
			</panel>
		</panel>
		<panel name="followUpPanel" colSpan="12" title="Follow-up" sidebar="true" canCollapse="true">
			<field name="assignedTo" title="Person In Charge" canNew="false"
				canView="false" canEdit="false" onChange="action-attrs-project-add-member"
				form-view="user-form" grid-view="user-grid" />
		</panel>
		<panel name="datePanel" title="Dates" colSpan="12" sidebar="true"
			canCollapse="true">
			<field name="fromDate" colSpan="6" />
			<field name="toDate" colSpan="6" />
			<field name="dueDate" showIf="isProject" colSpan="6" />
            <field name="estimatedTimeDays" colSpan="6" />
		</panel>
		<panel-mail name="mailPanel">
			<mail-messages limit="4" />
			<mail-followers />
		</panel-mail>
	</form>


	 <form name="project-select-wizard-form" title="Select Projects"   model="com.axelor.apps.base.db.Wizard">
		<panel name="mainPanel">
			<field name="projectSet"  title="Projects"  type="many-to-many" colSpan="12" target="com.axelor.apps.project.db.Project" canNew="false"/>
			<button name="ganttBtn" title="Open gantt" onClick="action-wizard-validate-project-select,action-open-project-gantt,close" colSpan="3" />
		</panel>
	</form>
	
	<form name="user-select-wizard-form" title="Select Users"  model="com.axelor.apps.base.db.Wizard">
		<panel name="mainPanel">
			<field name="userSet" title="Users" type="many-to-many" colSpan="12" target="com.axelor.auth.db.User" canNew="false"/>
			<button name="ganttBtn" title="Open gantt" onClick="action-wizard-validate-user-select,action-open-user-gantt,close" colSpan="3"  />
		</panel>
	</form>
	
	<kanban columnBy="statusSelect" sequenceBy="orderByState" limit="10"
	 name="project-kanban" title="Projects" model="com.axelor.apps.project.db.Project">
		<field name="fullName"/>
		<field name="description"/>
		<field name="progress"/>
		<field name="dueDate"/>
		<field name="statusSelect"/>
		<field name="sequence"/>
		<hilite color="danger" if="dueDate.isAfter(__datetime__) &amp;&amp; statusSelect &lt; 3"/>
		<hilite color="success" if="(dueDate.isBefore(__datetime__) || dueDate.equals(__datetime__)) &amp;&amp; statusSelect &lt; 3"/>
		<hilite color="warning" if="(dueDate.isBefore(__datetime__) || dueDate.equals(__datetime__)) &amp;&amp; statusSelect &lt; 3"/>
		<template>
		&lt;h4&gt;{{fullName}}&lt;/h4&gt;
		&lt;div class="card-body"&gt;{{description}}&lt;/div&gt;
		&lt;div class="card-footer"&gt;
		  &lt;i class='fa fa-clock-o'&gt;&lt;/i&gt; &lt;span&gt;{{dueDate|date:'dd/MM/yyyy'}}&lt;/span&gt;
		&lt;/div&gt;
		</template>
	</kanban>
	
	<kanban columnBy="statusSelect" sequenceBy="statusSelect" limit="10"
	 name="task-kanban" title="Tasks" model="com.axelor.apps.project.db.Project">
		<field name="fullName"/>
		<field name="description"/>
		<field name="progress"/>
		<field name="dueDate"/>
		<field name="statusSelect"/>
		<field name="sequence"/>
		<hilite color="danger" if="dueDate.isAfter(__datetime__) &amp;&amp; statusSelect &lt; 3"/>
		<hilite color="success" if="(dueDate.isBefore(__datetime__) || dueDate.equals(__datetime__)) &amp;&amp; statusSelect &lt; 3"/>
		<hilite color="warning" if="(dueDate.isBefore(__datetime__) || dueDate.equals(__datetime__)) &amp;&amp; statusSelect &lt; 3"/>
		<template>
		&lt;h4&gt;{{fullName}}&lt;/h4&gt;
		&lt;div class="card-body"&gt;{{description}}&lt;/div&gt;
		&lt;div class="card-footer"&gt;
		  &lt;i class='fa fa-clock-o'&gt;&lt;/i&gt; &lt;span&gt;{{dueDate|date:'dd/MM/yyyy'}}&lt;/span&gt;
		&lt;/div&gt;
		</template>
	</kanban>
	
	<calendar name="project-calendar" 
			  model="com.axelor.apps.project.db.Project" 
			  title="Project Calendar"
			  eventStart="fromDate"
			  eventStop="toDate"
			  eventLength="1"
			  colorBy="statusSelect"
			  mode="month"
			  >
			  <field name="fullName"/>
	</calendar>
	
	<action-view name="action-view-show-project-task-tree" title="Project Task Tree" model="com.axelor.team.db.TeamTask">	
		<view type="tree" name="project-task-tree"/>
    	<view type="form" name="team-task-form"/>
    	<domain>self.project.id = :_id AND self.parentTask = null</domain>
     	<context name="_id" expr="eval: id"/>
	</action-view>
	


	<tree name="project-task-tree" title="Tasks">
    	
    	<column name="name" type="string"/>
			<column name="taskDate" type="date"/>
    	<column name="assignedTo" type="reference"/>
    	<column name="progress" type="integer"/>
		<column name="openTask" type="button"/>

		<node model="com.axelor.team.db.TeamTask" domain="self.project.id = :_id" onClick="action-team-task-view-task" orderBy="taskDate">
			<field name="name" as="name"/>
			<field name="taskDate" as="taskDate"/>
			<field name="assignedTo" as="assignedTo"/>
			<field name="progressSelect" as="progress"/>
			<button name="openTaskBtn" title="Open task" onClick="action-team-task-open-task"/>
		</node>

		<node model="com.axelor.team.db.TeamTask" parent="parentTask" draggable="true" onClick="action-team-task-view-task" orderBy="taskDate">
			<field name="name" as="name"/>
			<field name="taskDate" as="taskDate"/>
			<field name="assignedTo" as="assignedTo"/>
			<field name="progressSelect" as="progress"/>
			<button name="openTaskBtn" title="Open task" onClick="action-team-task-open-task"/>
		</node>
    
	</tree>
	
	<tree name="project-phase-tree" title="Phases">
    	
    	<column name="name" type="string"/>
    	<column name="assignedTo" type="reference"/>
    	<column name="progress" type="integer"/>
		<column name="openTask" type="button"/>

		<node model="com.axelor.apps.project.db.Project" domain="self.parentProject.id = :id" onClick="action-project-view-phase">
			<field name="name" as="name"/>
			<field name="assignedTo" as="assignedTo"/>
			<field name="progress" as="progress"/>
			<button name="openTaskBtn" title="Open phase" onClick="action-project-view-phase"/>
		</node>
		
		<node model="com.axelor.team.db.TeamTask" parent="project" draggable="true" onClick="action-team-task-view-task">
			<field name="name" as="name"/>
			<field name="assignedTo" as="assignedTo"/>
			<field name="progressSelect" as="progress"/>
			<button name="openTaskBtn" title="Open task" onClick="action-team-task-open-task"/>
		</node>
		
	</tree>
	
	<action-group name="action-project-group-on-new-project">
		<action name="action-project-defaults"/>
		<action name="action-project-attrs-scale-and-precision"/>
		<action name="action-attrs-project-set-project-type" if="__config__.app.isApp('business-project')" />
		<action name="action-project-record-init-type"/>
	</action-group>
	
	<action-group name="action-project-on-load-group">
		<action name="action-project-attrs-scale-and-precision" />
		<action name="action-attrs-project-set-project-type"  if="__config__.app.isApp('business-project')" />
		<action name="action-project-method-count-to-invoice" if="__config__.app.isApp('business-project')"/>
		<action name="action-project-attrs-project-planning-time-cancel-remove" />
	</action-group>
	
	<action-attrs name="action-task-attrs-assigned-to-domain">
	    <attribute name="domain" for="assignedTo" expr="eval:&quot;self.id in (${(project?.membersUserSet?.collect{it->it.id}+[0,0]).join(',')}) &quot;"
				   if="(typeSelect == 'task')&amp;&amp;(project?.membersUserSet)&amp;&amp;(!project.membersUserSet.isEmpty())" />
	</action-attrs>
	
	<action-attrs name="action-project-defaults" model="com.axelor.apps.project.db.Project">
		<attribute name="value" for="fromDate" expr="eval: __datetime__"/>
		<attribute name="value" for="company" expr="eval:__user__.activeCompany"/>
		<attribute name="value" for="assignedTo" expr="eval: __user__"/>
		<attribute name="value:add" for="membersUserSet" expr="eval: __user__"/>
		<attribute name="value" for="isProject" expr="eval:_fromProject"/>
		<attribute name="value" for="isBusinessProject" expr="eval:_fromBusinessProject"/>
		<attribute name="value" for="parentProject" expr="eval:__repo__(Project).find(_parentProjectId)" if="_parentProjectId != null" />
	</action-attrs>

	<action-attrs name="action-attrs-project-add-member" model="com.axelor.apps.project.db.Project">
		<attribute name="value:add" for="membersUserSet" expr="eval: assignedTo"/>
	</action-attrs>
	
	<action-attrs name="action-attrs-project-set-project-type" model="com.axelor.apps.project.db.Project">
		<attribute name="readonly" for="isProject" expr="eval:_fromProject"/>
		<attribute name="readonly" for="isBusinessProject" expr="eval:_fromBusinessProject"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-set-parent-project-domain" model="com.axelor.apps.project.db.Project">
		<attribute name="domain" for="parentProject" expr="eval:&quot;self.isProject = true AND self.projectTypeSelect = 1 AND self.id != :id&quot;" if="id != null"/>
		<attribute name="domain" for="parentProject" expr="eval:&quot;self.isProject = true AND self.projectTypeSelect = 1&quot;" if="id == null"/>
	</action-attrs>

	<action-record name="action-project-record-init-type" model="com.axelor.apps.project.db.Project">
		<field name="projectTypeSelect" expr="eval: _xProjectTypeSelect"/>
	</action-record>

	<action-record name="action-project-record-empty-parent-project" model="com.axelor.apps.project.db.Project">
		<field name="parentProject" expr="eval: null"/>
	</action-record>
	
	<action-view name="action-project-task-view" title="Tasks" model="com.axelor.team.db.TeamTask">
    	<view type="form" name="team-task-form"/>
        <view-param name="popup" value="reload"/>
        <view-param name="show-toolbar" value="false"/>
  		<view-param name="show-confirm" value="false" />
	  	<view-param name="popup-save" value="false"/>
    	<context name="_showRecord" expr="eval: id"/>
    </action-view>
    	
	<action-view name="action-project-view-show-project" title="Related Projects" model="com.axelor.apps.project.db.Project">
		<view type="grid" name="project-grid" />
		<view type="form" name="project-form" />
		<domain>self.typeSelect = 'project' AND self.project.id = :id</domain>
	</action-view>
	
	<action-view name="action-project-view-show-task" title="Tasks" model="com.axelor.apps.project.db.Project">
		<view type="grid" name="team-task-grid" />
		<view type="form" name="team-task-form" />
		<domain>self.typeSelect = 'task' AND self.project.id = :id</domain>
	</action-view>
	
	<action-view name="action-project-view-show-related-tasks" title="Related 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.id = :_id OR self.project.parentProject.id = :_id)</domain>
	</action-view>
	
	<action-view name="action-project-view-create-team" model="com.axelor.team.db.Team" title="Team">
	  <view name="team-grid" type="grid"/>
	  <view name="team-form" type="form"/>
	  <view-param name="popup" value="reload"/>
	  <view-param name="show-toolbar" value="false"/>
	  <view-param name="show-confirm" value="true"/>
	  <view-param name="popup-save" value="true"/>
	  <view-param name="forceEdit" value="true"/>
	  <context name="_showRecord" expr="eval: id"/>
	</action-view>
	
	<action-view name="action-project-open-gantt" title="Gantt" model="com.axelor.team.db.TeamTask">
		<view type="gantt" name="task-gantt" />
		<view type="grid" name="team-task-grid" />
		<view type="form" name="team-task-form" />
		<domain>self.project.id = :_id OR self.project.parentProject.id = :_id</domain>
		<context name="_project" expr="eval:__this__"/>
	</action-view>
	
	<action-view name="action-project-book-resource" title="Book resource" model="com.axelor.apps.project.db.ResourceBooking">
		<view type="form" name="resource-booking-form" />
		<view type="grid" name="resource-booking-grid" />
		<view type="calendar" name="resource-booking-calendar" />
		<context name="_project" expr="eval:__self__"/>
	</action-view>

	<action-view name="action-project-add-task" model="com.axelor.team.db.TeamTask" title="Task">
		<view name="team-task-form" type="form"/>
		<view name="team-task-grid" type="grid"/>
		<view-param name="popup" value="reload"/>
		<view-param name="popup-save" value="true"/>
		<view-param name="show-confirm" value="true"/>
		<view-param name="show-toolbar" value="false"/>
		<context name="_project" expr="eval:__this__"/>
		<context name="_typeSelect" expr="eval: com.axelor.team.db.repo.TeamTaskRepository.TYPE_TASK"/>
	</action-view>

	<action-view name="action-project-add-ticket" model="com.axelor.team.db.TeamTask" title="Ticket">
		<view name="team-task-form" type="form"/>
		<view name="team-task-grid" type="grid"/>
		<view-param name="popup" value="reload"/>
		<view-param name="popup-save" value="true"/>
		<view-param name="show-confirm" value="true"/>
		<view-param name="show-toolbar" value="false"/>
		<view-param name="forceTitle" value="true"/>
		<context name="_project" expr="eval:__this__"/>
		<context name="_typeSelect" expr="eval: com.axelor.team.db.repo.TeamTaskRepository.TYPE_TICKET"/>
	</action-view>

	<action-view name="action-project-open-popup-select-users" title="Select Users" model="com.axelor.apps.base.db.Wizard">
	<view type="form" name="user-select-wizard-form"/>
	 <view-param name="show-toolbar" value="false"/>
	  <view-param name="show-confirm" value="false"/>
	  <view-param name="popup-save" value="false"/>
	</action-view>
	
	<action-view name="action-project-open-popup-select-projects" title="Select Projects" model="com.axelor.apps.base.db.Wizard">
	<view type="form" name="project-select-wizard-form"/>
	 <view-param name="show-toolbar" value="false"/>
	  <view-param name="show-confirm" value="false"/>
	  <view-param name="popup-save" value="false"/>
	</action-view>
	 
	 <action-view name="action-open-project-gantt" title="Project Gantt" model="com.axelor.team.db.TeamTask">
		<view type="gantt" name="project-task-gantt" />
		<view type="grid" name="team-task-grid" />
		<view type="form" name="team-task-form" />
		<domain>self.project.id IN (:_projectIds) OR self.project.parentProject.id IN (:_projectIds)</domain>
		<context name="_projectIds" expr="eval: projectSet.collect{it.id}"/>
	</action-view>
	
	 <action-view name="action-open-user-gantt" title="User Gantt" model="com.axelor.team.db.TeamTask">
		<view type="gantt" name="user-task-gantt" />
		<view type="grid" name="team-task-grid" />
		<view type="form" name="team-task-form" />
		<domain>self.assignedTo.id IN (:_userIds) </domain>
		 <context name="_userIds" expr="eval: userSet.collect{it.id}"/>
	 	</action-view>

	<action-view name="action-project-view-phase" title="Project phase" model="com.axelor.apps.project.db.Project">
		<view type="form" name="project-form"/>
		<view type="grid" name="project-grid"/>
		<view type="calendar" name="project-calendar"/>
		<view type="kanban" name="project-kanban"/>
		<domain>self.isProject = true and self.projectTypeSelect = :_xProjectTypeSelect and self.parentProject.id = :_parentId</domain>
		<context name="_fromProject" expr="eval:true"/>
		<context name="_xProjectTypeSelect" expr="eval: __repo__(Project).TYPE_PHASE"/>
		<context name="_parentId" expr="eval:_id" />
		<context name="_showRecord" expr="eval: id"/>
	</action-view>
	
	<action-view name="action-project-view-phase-new" title="Project phase" model="com.axelor.apps.project.db.Project">
		<view type="form" name="project-form"/>
		<view type="grid" name="project-grid"/>
		<view type="calendar" name="project-calendar"/>
		<view type="kanban" name="project-kanban"/>
		<domain>self.isProject = true and self.projectTypeSelect = :_xProjectTypeSelect and self.parentProject.id = :_parentProjectId</domain>
		<context name="_fromProject" expr="eval:true"/>
		<context name="_xProjectTypeSelect" expr="eval: __repo__(Project).TYPE_PHASE"/>
		<context name="_parentProjectId" expr="eval:id" />
	</action-view>
	
	<action-view name="action-project-view-phase-all" title="Project phases" model="com.axelor.apps.project.db.Project">
		<view type="grid" name="project-grid"/>
		<view type="form" name="project-form"/>
		<view type="calendar" name="project-calendar"/>
		<view type="kanban" name="project-kanban"/>
		<domain>self.isProject = true and self.projectTypeSelect = :_xProjectTypeSelect and self.parentProject.id = :_parentProjectId</domain>
		<context name="_fromProject" expr="eval:true"/>
		<context name="_xProjectTypeSelect" expr="eval: __repo__(Project).TYPE_PHASE"/>
		<context name="_parentProjectId" expr="eval:id" />
	</action-view>
	
	<action-view name="action-project-phase-view-show-phase-task" title="Phase tasks" model="com.axelor.team.db.TeamTask">
		<view type="grid" name="team-task-grid" />
		<view type="form" name="team-task-form" />
		<domain>self.project.parentProject.id = :_projectId</domain>
		<context name="_projectId" expr="eval:id" />
	</action-view>
	
	<action-record name="action-project-record-bind-customer-project" model="com.axelor.apps.project.db.Project">
		<field name="clientPartner" expr="eval: project?.clientPartner"/>
	</action-record>
	
	<action-record name="action-project-record-bind-customer-parent" model="com.axelor.apps.project.db.Project">
		<field name="clientPartner" expr="eval: _parent?.clientPartner"/>
	</action-record>

	<action-method name="action-method-project-compute-progress">
		<call class="com.axelor.apps.businessproject.web.ProjectController" method="computeProgress"/>
	</action-method>
	
	<action-method name="action-project-method-count-to-invoice">
	 	<call class="com.axelor.apps.businessproject.web.ProjectController" method="countToInvoice"/>
     </action-method>
     
     <action-method name="action-project-view-show-invoicing-projects">
		<call class="com.axelor.apps.businessproject.web.ProjectController" method="showInvoicingProjects"/>
	</action-method>
		
  	<action-attrs name="action-project-attrs-scale-and-precision">
		<attribute name="scale" for="price" expr="eval: __config__.app.getNbDecimalDigitForUnitPrice()"/>
	</action-attrs>
	
	<action-attrs name="action-attrs-domain-on-contact-partner">
		<attribute for="contactPartner" if="clientPartner != null &amp;&amp; !clientPartner.contactPartnerSet.empty" name="domain" expr="eval: &quot;self.id IN (${clientPartner.contactPartnerSet?.collect{it.id}.join(',')})&quot;"/>
 		<attribute for="contactPartner" if="clientPartner != null &amp;&amp; clientPartner.contactPartnerSet.empty" name="domain" expr="eval: &quot;self.id IN (0)&quot;"/>
 		<attribute for="contactPartner" if="clientPartner == null" name="domain" expr="eval: &quot;self.isContact = true AND :company member of self.companySet&quot;"/>
	</action-attrs>
	
	<action-method name="action-project-method-import-members">
		<call class="com.axelor.apps.project.web.ProjectController" method="importMembers"/>
	</action-method>
	
	<action-record name="action-project-record-status-in-progress" model="com.axelor.apps.project.db.Project">
		<field name="statusSelect" expr="eval: __repo__(Project).STATE_IN_PROGRESS"/>
	</action-record>

	<action-record name="action-project-record-status-finished" model="com.axelor.apps.project.db.Project">
		<field name="statusSelect" expr="eval: __repo__(Project).STATE_FINISHED"/>
	</action-record>

	<action-record name="action-project-record-status-canceled" model="com.axelor.apps.project.db.Project">
		<field name="statusSelect" expr="eval: __repo__(Project).STATE_CANCELED"/>
	</action-record>
	
	<action-record name="action-project-record-status-new" model="com.axelor.apps.project.db.Project">
		<field name="statusSelect" expr="eval: __repo__(Project).STATE_NEW"/>
	</action-record>
	
	 <action-validate name="action-wizard-validate-user-select">
    	<error message="Please select user"  if="eval: userSet == null || userSet  == 0"/>
    </action-validate>
    
     <action-validate name="action-wizard-validate-project-select">
    	<error message="Please select project"  if="eval: projectSet == null || projectSet  == 0"/>
    </action-validate>

    <action-view name="action-project-view-project-planning-wizard" title="Project planning" model="com.axelor.apps.base.db.Wizard">
		<view type="form" name="project-planning-user-select-wizard-form"/>
		<view-param name="show-confirm" value="false"/>
		<view-param name="show-toolbar" value="false"/>
		<view-param name="popup" value="reload"/>
		<context name="_project" expr="eval:__this__"/>
	</action-view>

	<action-attrs name="action-business-support-attrs-project-default">
		<attribute name="hidden" for="project" expr="eval:true" if="_parent &amp;&amp; (_parent?._model == 'com.axelor.apps.project.db.Project' || _parent?._model == 'com.axelor.apps.project.db.ProjectTemplate')"/>
	</action-attrs>

	<action-view name="action-project-view-create-new-customer-contract" title="Create new customer contract" model="com.axelor.apps.contract.db.Contract">
		<view type="form" name="contract-form"/>
		<context name="_xTargetType" expr="eval:1"/>
		<context name="_project" expr="eval:__self__"/>
	</action-view>

	<action-view name="action-project-view-create-new-supplier-contract" title="Create new supplier contract" model="com.axelor.apps.contract.db.Contract">
		<view type="form" name="contract-form"/>
		<context name="_xTargetType" expr="eval:2"/>
		<context name="_project" expr="eval:__self__"/>
	</action-view>

	<action-view name="action-project-dashlet-customer-contracts" title="Customer contracts" model="com.axelor.apps.contract.db.Contract">
		<view type="grid" name="contract-grid"/>
		<view type="form" name="contract-form"/>
		<domain>self.project.id = :id AND self.targetTypeSelect = 1 AND self.statusSelect != 3</domain>
	</action-view>

	<action-view name="action-project-dashlet-supplier-contracts" title="Supplier contracts" model="com.axelor.apps.contract.db.Contract">
		<view type="grid" name="contract-grid"/>
		<view type="form" name="contract-form"/>
		<domain>self.project.id = :id AND self.targetTypeSelect = 2 AND self.statusSelect != 3</domain>
	</action-view>

	<action-view name="action-project-dashlet-contract-invoices" title="Invoices" model="com.axelor.apps.account.db.Invoice">
		<view type="grid" name="invoice-grid"/>
		<view type="form" name="invoice-form"/>
		<domain>self.contract.project.id = :_id</domain>
	</action-view>

    <action-view name="dashlet.task" title="Tasks" model="com.axelor.apps.project.db.Project">
        <view type="grid" name="task-grid" />
        <view type="form" name="task-form" />
    </action-view>

</object-views>
