<?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="business-project-grid" title="Projects" model="com.axelor.apps.project.db.Project">
		<field name="fullName"/>
		<field name="company" form-view="company-form" grid-view="company-grid" if="__config__.app.getApp('base').getEnableMultiCompany()"/>
		<field name="clientPartner" form-view="partner-form" grid-view="partner-grid" />
		<field name="fromDate" />
		<field name="toDate" />
	</grid>
	
    <action-method name="action-project-method-generate-quotation">
        <call class="com.axelor.apps.businessproject.web.ProjectController" method="generateQuotation"/>
    </action-method>
    
    <action-method name="action-project-method-generate-purchase-quotation">
        <call class="com.axelor.apps.businessproject.web.ProjectController" method="generatePurchaseQuotation"/>
    </action-method>

	<action-method name="action-project-method-print-project">
		<call class="com.axelor.apps.businessproject.web.ProjectController" method="printProject"/>
	</action-method>
	
	<action-method name="action-project-method-print-planif-and-cost">
		<call class="com.axelor.apps.businessproject.web.ProjectController" method="printPlannifAndCost"/>
	</action-method>
	
	<action-validate name="action-validate-unset-project">
		<alert message="Are you sure wants to unlink project from selected lines?."/>
	</action-validate>
	
	<action-attrs id="business-project-action-project-project-default" name="action-project-project-default" model="com.axelor.apps.project.db.Project">
		<attribute name="value" for="typeSelect" expr="eval:'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__"/>
	</action-attrs>
	
	<action-record id="business-project-action-project-default" name="action-project-default" model="com.axelor.apps.project.db.Project">
		<field name="typeSelect" expr="eval:'task'" />
		<field name="company" expr="eval:__user__.activeCompany"/>
		<field name="fromDate" expr="eval: __date__"/>
		<field name="assignedTo" expr="eval: __user__"/>
	</action-record>
	
	<action-attrs name="action-project-attrs-set-invoicing-sequence">
		<attribute name="value" for="invoicingSequenceSelect" expr="eval: null"/>
	</action-attrs>
	
	<action-method name="action-project-method-get-partner-data">
		<call class="com.axelor.apps.businessproject.web.ProjectController" method="getPartnerData"/>
	</action-method>
	
	<action-view name="action-dashlet-project-show-all-invoicing-task" title="Task Invoicing" model="com.axelor.team.db.TeamTask">
		<view type="grid" name="business-project-team-task-grid"/>
		<view type="form" name="team-task-form"/>
		<view-param name="show-toolbar" value="true" />
		<view-param name="popup" value="reload"/>
		<domain>self.project.id in (:_projectIds)</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<!-- Sales -->
	
	<action-view name="action-project-dashlet-sale-quotation" title="Quotation" model="com.axelor.apps.sale.db.SaleOrder">
		<view type="grid" name="sale-order-quotation-grid"/>
		<view type="form" name="sale-order-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.saleOrderLineList.project.id in (:_projectIds) AND self.statusSelect &lt; 3</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-dashlet-sale-order" title="Sale order" model="com.axelor.apps.sale.db.SaleOrder">
		<view type="grid" name="sale-order-grid"/>
		<view type="form" name="sale-order-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.saleOrderLineList.project.id in (:_projectIds) AND self.statusSelect in (3,4)</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-view-show-sale-order-lines" title="Sale Order Lines" model="com.axelor.apps.sale.db.SaleOrderLine">
        <view type="grid" name="sale-order-line-project-grid"/>
        <view type="form" name="sale-order-line-project-form"/>
        <domain>self.project.id in (:_projectIds)</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
    </action-view>
    
    <action-view name="action-project-view-show-confirmed-sale-order-lines" title="Sale Order Lines" model="com.axelor.apps.sale.db.SaleOrderLine">
        <view type="grid" name="sale-order-line-project-grid"/>
        <view type="form" name="sale-order-line-project-form"/>
        <view-param name="popup" value="true"/>
        <domain>self.saleOrder.statusSelect in (3,4) AND self.project.id in (:_projectIds)</domain>
    	<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
    </action-view>
    
	<action-view name="action-project-dashlet-customer-deliveries" title="Customer deliveries" model="com.axelor.apps.stock.db.StockMove">
		<view type="grid" name="stock-move-out-grid"/>
		<view type="form" name="stock-move-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.stockMoveLineList.saleOrderLine.project.id in (:_projectIds)</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-attrs name="action-project-attrs-sales-order-line-select-lines">
		<attribute name="readonly" for="selectNewSOLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageSOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedSOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageSOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$salesOrderLineSet" expr="eval:false"/>
		<attribute name="value" for="$salesOrderLineSet" expr="eval:false"/>
		<attribute name="title" for="$salesOrderLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to add')"/>
		<attribute name="domain" for="$salesOrderLineSet" expr="eval:&quot;self.saleOrder.clientPartner = :clientPartner AND self.saleOrder.statusSelect in (3,4) AND self.project is null&quot;"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-sales-order-line-manage-lines">
		<attribute name="readonly" for="selectNewSOLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageSOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="unlinkSelectedSOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageSOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$salesOrderLineSet" expr="eval:false"/>
		<attribute name="value" for="$salesOrderLineSet" expr="eval:null"/>
		<attribute name="title" for="$salesOrderLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to unlink')"/>
		<attribute name="domain" for="$salesOrderLineSet" expr="eval:&quot;self.saleOrder.statusSelect in (3,4) AND self.project.id = :id&quot;" if="!isShowPhasesElements"/>
		<attribute name="domain" for="$salesOrderLineSet" expr="eval:&quot;self.saleOrder.statusSelect in (3,4) AND (self.project.id = :id OR self.project.parentProject.id = :id)&quot;" if="isShowPhasesElements"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-sales-order-line-cancel-manage-lines">
		<attribute name="readonly" for="selectNewSOLinesBtn" expr="eval:false"/>
		<attribute name="readonly" for="manageSOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="unlinkSelectedSOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedSOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="cancelManageSOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="$salesOrderLineSet" expr="eval:true"/>
	</action-attrs>
	
	<!-- Purchase -->
	
	<action-view name="action-project-project-purchase-quotation" title="PO.Quotation" model="com.axelor.apps.purchase.db.PurchaseOrder">
		<view type="grid" name="purchase-order-quotation-grid"/>
		<view type="form" name="purchase-order-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.purchaseOrderLineList.project.id in (:_projectIds) AND self.statusSelect &lt; 3</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-dashlet-purchase-order" title="Purchase order" model="com.axelor.apps.purchase.db.PurchaseOrder">
		<view type="grid" name="purchase-order-grid"/>
		<view type="form" name="purchase-order-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.purchaseOrderLineList.project.id in (:_projectIds) AND self.statusSelect in (3,4)</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-dashlet-supplier-arrivals" title="Supplier arrivals" model="com.axelor.apps.stock.db.StockMove">
		<view type="grid" name="stock-move-in-grid"/>
		<view type="form" name="stock-move-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.stockMoveLineList.purchaseOrderLine.project.id in (:_projectIds)</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-view-show-purchase-order-lines" title="Purchase Order Lines" model="com.axelor.apps.purchase.db.PurchaseOrderLine">
        <view type="grid" name="purchase-order-line-project-grid"/>
        <view type="form" name="purchase-order-line-project-form"/>
        <domain>self.project.id in (:_projectIds)</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
    </action-view>
    
   <action-view name="action-project-dashlet-analytic-move-lines" model="com.axelor.apps.account.db.AnalyticMoveLine" title="Analytic move lines">
  		<view name="analytic-move-line-grid" type="grid"/>
  		<view name="analytic-move-line-form" type="form"/>
 		<domain>self.project.id = :id</domain>
		<context name="id" expr="eval:id"/>
	</action-view>
	 
    <action-view name="action-project-view-show-confirmed-purchase-order-lines" title="Purchase Order Lines" model="com.axelor.apps.purchase.db.PurchaseOrderLine">
        <view type="grid" name="purchase-order-line-project-grid"/>
        <view type="form" name="purchase-order-line-project-form"/>
        <view-param name="popup" value="true"/>
        <domain>self.purchaseOrder.statusSelect in (3,4)  AND self.project.id in (:_projectIds)</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
    </action-view>
    
    
    <action-attrs name="action-project-attrs-purchase-order-line-select-lines">
		<attribute name="readonly" for="selectNewPOLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="managePOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedPOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManagePOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$purchaseOrderLineSet" expr="eval:false"/>
		<attribute name="value" for="$purchaseOrderLineSet" expr="eval:null"/>
		<attribute name="title" for="$purchaseOrderLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to add')"/>
		<attribute name="domain" for="$purchaseOrderLineSet" expr="eval:&quot;self.purchaseOrder.statusSelect in (3,4)  AND self.project is null&quot;"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-purchase-order-line-manage-lines">
		<attribute name="readonly" for="selectNewPOLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="managePOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="unlinkSelectedPOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManagePOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$purchaseOrderLineSet" expr="eval:false"/>
		<attribute name="value" for="$purchaseOrderLineSet" expr="eval:null"/>
		<attribute name="title" for="$purchaseOrderLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to unlink')"/>
		<attribute name="domain" for="$purchaseOrderLineSet" expr="eval:&quot;self.purchaseOrder.statusSelect in (3,4) AND self.project.id = :id&quot;" if="!isShowPhasesElements"/>
		<attribute name="domain" for="$purchaseOrderLineSet" expr="eval:&quot;self.purchaseOrder.statusSelect in (3,4) AND (self.project.id = :id OR self.project.parentProject.id = :id)&quot;" if="isShowPhasesElements"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-purchase-order-line-cancel-manage-lines">
		<attribute name="readonly" for="selectNewPOLinesBtn" expr="eval:false"/>
		<attribute name="readonly" for="managePOLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="addSelectedPOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="unlinkSelectedPOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="cancelManagePOLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="$purchaseOrderLineSet" expr="eval:true"/>
	</action-attrs>
    
    <!-- Expense -->
	
	<action-view name="action-project-dashlet-expense-waiting" title="Waiting expenses" model="com.axelor.apps.hr.db.Expense">
		<view type="grid" name="expense-grid"/>
		<view type="form" name="expense-form"/>
		<view-param name="popup" value="true"/>
		<domain>(self.kilometricExpenseLineList.project.id in (:_projectIds) or self.generalExpenseLineList.project.id in (:_projectIds)) AND self.statusSelect &lt; 3</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-dashlet-expense-validated" title="Validated expenses" model="com.axelor.apps.hr.db.Expense">
		<view type="grid" name="expense-grid"/>
		<view type="form" name="expense-form"/>
		<view-param name="popup" value="true"/>
		<domain>(self.kilometricExpenseLineList.project.id in (:_projectIds) or self.generalExpenseLineList.project.id in (:_projectIds)) AND self.statusSelect in (3,4)</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-view-show-expense-lines" title="Expense lines" model="com.axelor.apps.hr.db.ExpenseLine">
        <view type="grid" name="expense-line-project-grid"/>
        <view type="form" name="expense-line-project-form"/>
        <domain>self.project.id in (:_projectIds)</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
    </action-view>
    
	<action-view name="action-project-view-show-validated-expense-lines" title="Expense lines" model="com.axelor.apps.hr.db.ExpenseLine">
        <view type="grid" name="expense-line-project-grid"/>
        <view type="form" name="expense-line-project-form"/>
        <view-param name="popup" value="true"/>
        <domain>self.expense.statusSelect in (3,4) AND self.project.id in (:_projectIds)</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
    </action-view>
    
    <action-attrs name="action-project-attrs-expense-line-select-lines">
		<attribute name="readonly" for="selectNewExpenseLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageExpenseLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedExpenseLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageExpenseLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$expenseLineSet" expr="eval:false"/>
		<attribute name="value" for="$expenseLineSet" expr="eval:null"/>
		<attribute name="title" for="$expenseLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to add')"/>
		<attribute name="domain" for="$expenseLineSet" expr="eval:&quot;self.expense.statusSelect in (3,4)  AND self.project is null&quot;"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-expense-line-manage-lines">
		<attribute name="readonly" for="selectNewExpenseLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageExpenseLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="unlinkSelectedExpenseLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageExpenseLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$expenseLineSet" expr="eval:false"/>
		<attribute name="value" for="$expenseLineSet" expr="eval:false"/>
		<attribute name="title" for="$expenseLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to unlink')"/>
		<attribute name="domain" for="$expenseLineSet" expr="eval:&quot;self.expense.statusSelect in (3,4) AND self.project.id = :id&quot;" if="!isShowPhasesElements"/>
		<attribute name="domain" for="$expenseLineSet" expr="eval:&quot;self.expense.statusSelect in (3,4) AND (self.project.id = :id OR self.project.parentProject.id = :id)&quot;" if="isShowPhasesElements"/>
	</action-attrs>
    
    <action-attrs name="action-project-attrs-expense-line-cancel-manage-lines">
    	<attribute name="readonly" for="selectNewExpenseLinesBtn" expr="eval:false"/>
		<attribute name="readonly" for="manageExpenseLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="unlinkSelectedExpenseLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedExpenseLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="cancelManageExpenseLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="$expenseLineSet" expr="eval:true"/>
    </action-attrs>
    
    <!-- Invoice -->
    
    <action-view name="action-dashlet-project-show-all-invoicing-project" title="Invoicing projects" model="com.axelor.apps.businessproject.db.InvoicingProject">
		<view type="grid" name="invoicing-project-grid"/>
		<view type="form" name="invoicing-project-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.project.id in (:_projectIds)</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
    
	<action-view name="action-project-dashlet-customer-invoices" title="Customer invoices" model="com.axelor.apps.account.db.Invoice">
		<view type="grid" name="invoice-grid"/>
		<view type="form" name="invoice-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.invoiceLineList.project.id in (:_projectIds) AND self.operationTypeSelect = 3 AND self.operationSubTypeSelect != 2</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-view-show-sale-invoice-lines" title="Customer invoice lines" model="com.axelor.apps.account.db.InvoiceLine">
        <view type="grid" name="invoice-line-project-grid"/>
        <view type="form" name="invoice-line-form"/>
        <view-param name="popup" value="true"/>
        <domain>self.invoice.operationTypeSelect = 3 AND self.project.id in (:_projectIds) AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
  		<context name="$isReadOnly" expr="true"/>
    </action-view>
    
	<action-view name="action-project-dashlet-supplier-invoices" title="Supplier invoices"  model="com.axelor.apps.account.db.Invoice">
		<view type="grid" name="invoice-supplier-grid"/>
		<view type="form" name="invoice-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.invoiceLineList.project.id in (:_projectIds) AND self.operationTypeSelect = 1 AND self.operationSubTypeSelect != 2</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-view name="action-project-view-show-purchase-invoice-lines" title="Supplier invoice lines" model="com.axelor.apps.account.db.InvoiceLine">
        <view type="grid" name="invoice-line-project-grid"/>
        <view type="form" name="invoice-line-form"/>
        <view-param name="popup" value="true"/>
        <domain>self.invoice.operationTypeSelect = 1 AND self.project.id in (:_projectIds) AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
  		<context name="$isReadOnly" expr="true"/>
    </action-view>
    
	<action-view name="action-project-dashlet-advance-payment-invoices" title="Advance payment invoices"  model="com.axelor.apps.account.db.Invoice">
		<view type="grid" name="invoice-grid"/>
		<view type="form" name="invoice-form"/>
		<view-param name="popup" value="true"/>
		<domain>self.invoiceLineList.project.id in (:_projectIds) AND self.operationSubTypeSelect = 2</domain>
		<context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
	</action-view>
	
	<action-attrs name="action-project-attrs-customer-invoice-line-select-lines">
		<attribute name="readonly" for="selectNewCustomerInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageCustomerInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedCustomerInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageCustomerInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$customerInvoiceLineSet" expr="eval:false"/>
		<attribute name="value" for="$customerInvoiceLineSet" expr="eval:null"/>
		<attribute name="title" for="$customerInvoiceLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to add')"/>
		<attribute name="domain" for="$customerInvoiceLineSet" expr="eval:&quot;self.invoice.operationTypeSelect = 3 AND self.invoice.partner = :clientPartner AND self.project is null AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2&quot;"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-customer-invoice-line-manage-lines">
		<attribute name="readonly" for="selectNewCustomerInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageCustomerInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="unlinkSelectedCustomerInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageCustomerInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$customerInvoiceLineSet" expr="eval:false"/>
		<attribute name="value" for="$customerInvoiceLineSet" expr="eval:null"/>
		<attribute name="title" for="$customerInvoiceLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to unlink')"/>
		<attribute name="domain" for="$customerInvoiceLineSet" expr="eval:&quot;self.invoice.operationTypeSelect = 3 AND self.project.id = :id AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2&quot;" if="!isShowPhasesElements"/>
		<attribute name="domain" for="$customerInvoiceLineSet" expr="eval:&quot;self.invoice.operationTypeSelect = 3 AND (self.project.id = :id OR self.project.parentProject.id = :id) AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2&quot;" if="isShowPhasesElements"/>
	</action-attrs>
    
    <action-attrs name="action-project-attrs-customer-invoice-line-cancel-manage-lines">
    	<attribute name="readonly" for="selectNewCustomerInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="readonly" for="manageCustomerInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="unlinkSelectedCustomerInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedCustomerInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="cancelManageCustomerInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="$customerInvoiceLineSet" expr="eval:true"/>
    </action-attrs>
    
    <action-attrs name="action-project-attrs-supplier-invoice-line-select-lines">
		<attribute name="readonly" for="selectNewSupplierInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageSupplierInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="addSelectedSupplierInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageSupplierInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$supplierInvoiceLineSet" expr="eval:false"/>
		<attribute name="value" for="$supplierInvoiceLineSet" expr="eval:null"/>
		<attribute name="title" for="$supplierInvoiceLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to add')"/>
		<attribute name="domain" for="$supplierInvoiceLineSet" expr="eval:&quot;self.invoice.operationTypeSelect = 1 AND self.project is null AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2&quot;"/>
	</action-attrs>
	
	<action-attrs name="action-project-attrs-supplier-invoice-line-manage-lines">
		<attribute name="readonly" for="selectNewSupplierInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="readonly" for="manageSupplierInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="unlinkSelectedSupplierInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="cancelManageSupplierInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="$supplierInvoiceLineSet" expr="eval:false"/>
		<attribute name="value" for="$supplierInvoiceLineSet" expr="eval:null"/>
		<attribute name="title" for="$supplierInvoiceLineSet" expr="eval:com.axelor.i18n.I18n.get('Select lines to unlink')"/>
		<attribute name="domain" for="$supplierInvoiceLineSet" expr="eval:&quot;self.invoice.operationTypeSelect = 1 AND self.project.id = :id AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2&quot;" if="!isShowPhasesElements"/>
		<attribute name="domain" for="$supplierInvoiceLineSet" expr="eval:&quot;self.invoice.operationTypeSelect = 1 AND (self.project.id = :id OR self.project.parentProject.id = :id) AND self.invoice.statusSelect = 3  AND self.invoice.operationSubTypeSelect != 2&quot;" if="isShowPhasesElements"/>
	</action-attrs>
    
    <action-attrs name="action-project-attrs-supplier-invoice-line-cancel-manage-lines">
    	<attribute name="readonly" for="selectNewSupplierInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="readonly" for="manageSupplierInvoiceLinesBtn" expr="eval:false"/>
		<attribute name="hidden" for="addSelectedSupplierInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="unlinkSelectedSupplierInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="cancelManageSupplierInvoiceLinesBtn" expr="eval:true"/>
		<attribute name="hidden" for="$supplierInvoiceLineSet" expr="eval:true"/>
    </action-attrs>
	
	
	<!-- Production -->
	
    <action-view name="action-project-view-show-production-orders" title="Production orders" model="com.axelor.apps.production.db.ProductionOrder">
        <view type="grid" name="production-order-grid"/>
        <view type="form" name="production-order-form"/>
        <domain>self.project.id in (:_projectIds)</domain>
        <context if="id == null" name="_projectIds" expr="eval:[0]" />
  		<context if="id != null &amp;&amp; !isShowPhasesElements" name="_projectIds" expr="eval:[id]"/>
  		<context if="id != null &amp;&amp; isShowPhasesElements" name="_projectIds" expr="eval:[id] + childProjectList.collect{it->it.id}"/>
    </action-view>
    
</object-views>
