<?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="prod-human-resource-grid" title="Prod. Human resources" editable="true" model="com.axelor.apps.production.db.ProdHumanResource"
        onNew="action-prod-human-resource-record-default">
        <field name="product" form-view="product-form" grid-view="product-grid" domain="self.productTypeSelect = 'service' "/>
        <field name="employee" form-view="employee-form" grid-view="employee-grid"/>
        <field name="duration" widget="duration" x-big="true" x-seconds="true" aggregate="sum"/>
	  	<field name="costSheetGroup" form-view="cost-sheet-group-form" grid-view="cost-sheet-group-grid" domain="self.costTypeSelect = 2" if="__config__.app.getApp('production').getManageCostSheetGroup()"/>
    </grid>
    
    <grid name="prod-human-resource-group-grid" title="Prod. Human resources" model="com.axelor.apps.production.db.ProdHumanResource" groupBy="operationOrder.manufOrder" edit-icon="true">
		<field name="product" form-view="product-form" grid-view="product-grid"/>
		<field name="employee" form-view="employee-form" grid-view="employee-grid"/>
		<field name="operationOrder.operationName"/>
		<field name="duration" widget="duration" aggregate="sum" x-big="true" x-seconds="true"/>
		<field name="operationOrder.manufOrder" hidden="true"/>
		<field name="costSheetGroup" domain="self.costTypeSelect = 2" form-view="cost-sheet-group-form" grid-view="cost-sheet-group-grid" if="__config__.app.getApp('production').getManageCostSheetGroup()"/>
	</grid>
    
    <form name="prod-human-resource-form" title="Prod. Human resource" model="com.axelor.apps.production.db.ProdHumanResource"
        onNew="action-prod-human-resource-record-default">
		<panel name="mainPanel">
	        <field name="product" domain="self.productTypeSelect = 'service'" canEdit="false" form-view="product-form" grid-view="product-grid"/>
	        <field name="employee" form-view="employee-form" grid-view="employee-grid" canNew="false" canEdit="false" canView="false"/>
	        <field name="duration" widget="duration" x-big="true" x-seconds="true"/>
  		  	<field name="costSheetGroup" form-view="cost-sheet-group-form" grid-view="cost-sheet-group-grid" domain="self.costTypeSelect = 2" if="__config__.app.getApp('production').getManageCostSheetGroup()"/>
        </panel>
    </form>
    
    <action-record name="action-prod-human-resource-record-default" model="com.axelor.apps.production.db.ProdHumanResource">
        <field name="costSheetGroup" expr="eval: __config__?.app.isApp('production') ? __config__?.app.getApp('production')?.workCenterCostSheetGroup : null " if="__config__.app.getApp('production').getManageCostSheetGroup()" />
    </action-record>
    
</object-views>
