<?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="expense-line-project-grid" title="Expense lines" model="com.axelor.apps.hr.db.ExpenseLine">
        <hilite if="$get('expense.statusSelect') &lt; 3 &amp;&amp; toInvoice &amp;&amp; !invoiced" color="info"/>
        <hilite if="invoiced" color="success"/>
        <field name="project" />
        <field name="expense.expenseSeq" title="Expense" width="120"/>
        <field name="user"/>
        <field name="expenseProduct" canView="false" readonly="true"/>
        <field name="expenseDate" readonly="true"/>
        <field name="totalAmount" aggregate="sum" readonly="true"/>
        <field name="toInvoice"/>
        <field name="invoiced"/>
        <button name="updateToInvoiceBtn" title="Update to invoice" readonlyIf="invoiced" icon="fa-check-circle" onClick="action-expense-line-method-update-to-invoice" />
        <field name="expense" hidden="true"/>
        <field name="expense.statusSelect" hidden="true"/>
    </grid>
    
    <action-attrs name="action-expense-line-attrs-domain-project" id="business-project-action-expense-line-attrs-domain-project">
		<attribute name="domain" for="project" expr="eval: &quot; self.imputable = true AND (${__user__.id} MEMBER OF self.membersUserSet OR self.assignedTo.id = ${__user__.id}) &quot;"/>
	</action-attrs>
	
	<action-method name="action-expense-line-method-update-to-invoice" >
		<call class="com.axelor.apps.businessproject.web.ExpenseLineProjectController" method="updateToInvoice"/>
	</action-method>
	
	<action-method name="action-expense-line-method-set-project">
		<call class="com.axelor.apps.businessproject.web.ExpenseLineProjectController" method="setProject"/>
	</action-method>
	
	<action-method name="action-expense-line-method-unset-project">
		<call class="com.axelor.apps.businessproject.web.ExpenseLineProjectController" method="unsetProject"/>
	</action-method>

</object-views>
