<?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">
	
	<form name="app-production-config-form" title="App production" model="com.axelor.apps.base.db.AppProduction" canDelete="false" canNew="false" width="large">
		<panel name="productionConfigurationPanel" colSpan="12">
			<panel name="saleOrderPanel" title="Sale order">
				<field name="prodOrderMgtOnSO" readonlyIf="productionOrderGenerationAuto" widget="boolean-switch"/>
				<field name="productionOrderGenerationAuto" showIf="prodOrderMgtOnSO" widget="boolean-switch"/>
				<field name="oneProdOrderPerSO" showIf="prodOrderMgtOnSO" widget="boolean-switch"/>
				<field name="autoPlanManufOrderFromSO" showIf="prodOrderMgtOnSO" widget="boolean-switch"/>
			</panel>
			<panel name="configuratorPanel" title="Configurator">
				<field name="enableConfigurator" widget="boolean-switch"/>
			</panel>
			<panel name="billOfMaterialPanel" title="Bill of material">
				<field name="manageBillOfMaterialVersion" widget="boolean-switch"/>
			    <field name="manageResidualProductOnBom" widget="boolean-switch"/>
			    <field name="nbDecimalDigitForBomQty"/>
			</panel>
			<panel name="manufacturingProcessPanel" title="Manufacturing process">
   				<field name="workCenterProduct" domain="self.productTypeSelect = 'service'" form-view="product-form" grid-view="product-grid" canEdit="false" colSpan="12"/>
			</panel>
			<panel name="prodProcessPanel" title="Production process">
 				<field name="manageProdProcessVersion" widget="boolean-switch"/>
				<field name="manageBusinessProduction" onChange="action-app-production-manage-business-production-record-onchange" title="Manage business production" if-module="axelor-business-production" widget="boolean-switch" />
				<field name="enableTimesheetOnManufOrder" widget="boolean-switch" if-module="axelor-business-production" showIf="manageBusinessProduction" />
			</panel>
			<panel name="barcodeTypeConfigPanel">
				<field name="barcodeTypeConfig" title="Barcode Type"/>
			</panel>
			<panel name="costSheetPanel" title="Cost sheet">
				<field name="cycleUnit" form-view="unit-form" grid-view="unit-grid"/>
				<field name="manageCostSheetGroup" widget="boolean-switch"/>
			    <field name="productCostSheetGroup" showIf="manageCostSheetGroup" form-view="cost-sheet-group-form" grid-view="cost-sheet-group-grid" domain="self.costTypeSelect = 1"/>
  				<field name="workCenterCostSheetGroup" showIf="manageCostSheetGroup" form-view="cost-sheet-group-form" grid-view="cost-sheet-group-grid" domain="self.costTypeSelect = 2"/>
				<field name="subtractProdResidualOnCostSheet" showIf="manageResidualProductOnBom" widget="boolean-switch"/>
			</panel>
			<panel name="printingPanel" title="Printings">
				<field name="printPlannedDateOnManufOrder"/>
			</panel>
			<panel name="stockLocationPanel" title="Stock Location">
				<field name="manageWorkshop" widget="boolean-switch"/>
                <field name="mOFilterOnStockDetailStatusSelect" widget="MultiSelect" colSpan="4" selection="production.manuf.order.status.select"/>
			</panel>
		</panel>
		<panel name="actionsPanel">
			<button name="generateProductionConfigurationsBtn" colSpan="4" title="Generate production configurations" onClick="save,com.axelor.apps.production.web.AppProductionController:generateProductionConfigurations"/>
			<panel-dashlet name="confProductionConfigDashletPanel" action="admin.root.conf.production.config" colSpan="12"/>
		</panel>
		
		<panel-mail name="mailPanel">
			<mail-messages limit="4"/>
			<mail-followers/>
		</panel-mail>
		
	</form>
	
	<action-view name="admin.root.conf.production.config" title="Production configurations"
		model="com.axelor.apps.production.db.ProductionConfig" >
		<view type="grid" name="production-config-grid"/>
		<view type="form" name="production-config-form"/>
	</action-view>

	<action-record name="action-app-production-record-manage-business-production-onchange" model="com.axelor.apps.base.db.AppProduction">
		<field name="enableTimesheetOnManufOrder" expr="eval: false"/>
	</action-record>
</object-views>