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

	
	<menuitem name="manufacturing-root" title="Manufacturing" order="-84"  if="__config__.app.isApp('production')"
		icon="fa-cogs"  icon-background="#84429f"/>
		
	<menuitem name="manufacturing-root-products" parent="manufacturing-root" order="5"
		title="Products" action="manufacturing.root.products" />

	<action-view name="manufacturing.root.products" title="Products"
		model="com.axelor.apps.base.db.Product" >
		<view type="grid" name="product-grid" />
		<view type="form" name="product-form" />
		<view type="cards" name="product-cards" />
		<view-param name="search-filters" value="products-filters"/>
		<domain>self.isModel = false and self.productTypeSelect = 'storable'</domain>
		<context name="_activeCompany" expr="eval:__user__.activeCompany"/>
		<context name="_fromProduction" expr="eval:true" />
	</action-view>

	<menuitem name="manufacturing-root-bill-of-material-root" parent="manufacturing-root"
			  title="Bills of materials" order="10" />

	<menuitem name="manufacturing-root-general-bill-of-material" parent="manufacturing-root-bill-of-material-root"
			  title="General BoM" action="manufacturing.root.general.bill.of.material" order="1"/>

	<action-view name="manufacturing.root.general.bill.of.material" title="General BoM"
				 model="com.axelor.apps.production.db.BillOfMaterial" >
		<view type="grid" name="bill-of-material-grid" />
		<view type="form" name="bill-of-material-form" />
		<domain>self.defineSubBillOfMaterial = true AND self.personalized = false</domain>
	</action-view>

	<menuitem name="manufacturing-root-personalized-bill-of-material" parent="manufacturing-root-bill-of-material-root"
			  title="Personalized BoM" action="manufacturing.root.personalized.bill.of.material" order="2"/>

	<action-view name="manufacturing.root.personalized.bill.of.material" title="Personalized BoM"
				 model="com.axelor.apps.production.db.BillOfMaterial" >
		<view type="grid" name="bill-of-material-grid" />
		<view type="form" name="bill-of-material-form" />
		<domain>self.defineSubBillOfMaterial = true AND self.personalized = true</domain>
	</action-view>
	
	<menuitem name="manufacturing-root-prod-process" parent="manufacturing-root"
		title="Production processes" action="manufacturing.root.prod.process" order="5" />

	<action-view name="manufacturing.root.prod.process" title="Production processes"
		model="com.axelor.apps.production.db.ProdProcess" >
		<view type="grid" name="prod-process-grid" />
		<view type="form" name="prod-process-form" />
	</action-view>
		
	<menuitem name="manufacturing-root-production-order" parent="manufacturing-root"
		title="Productions orders" action="manufacturing.root.production.order" order="15" />

	<action-view name="manufacturing.root.production.order" title="Productions orders"
		model="com.axelor.apps.production.db.ProductionOrder" >
		<view type="grid" name="production-order-grid" />
		<view type="form" name="production-order-form" />
		<view-param name="search-filters" value="production-order-filters"/>
	</action-view>	
	
	<menuitem name="manufacturing-root-manuf-order" parent="manufacturing-root"
		title="Manufacturing orders" action="manufacturing.root.manuf.order" order="20" />

	<action-view name="manufacturing.root.manuf.order" title="Manufacturing orders"
		model="com.axelor.apps.production.db.ManufOrder" >
		<view type="grid" name="manuf-order-grid" />
		<view type="form" name="manuf-order-form" />
		<view-param name="search-filters" value="manuf-order-filters"/>
		<domain>self.isPermanent is null OR self.isPermanent = false</domain>
		<context name="_todayDateTime" expr="eval:__config__.app.getTodayDateTime()"/>
	</action-view>	
	
	<menuitem name="manufacturing-root-operation-order" parent="manufacturing-root"
		title="Operations orders" action="manufacturing.root.operation.order" order="25" />

	<action-view name="manufacturing.root.operation.order" title="Operation orders"
		model="com.axelor.apps.production.db.OperationOrder" >
		<view type="grid" name="operation-order-group-grid" />
		<view type="form" name="operation-order-form" />
		<view-param name="search-filters" value="operation-order-filters"/>
		<context name="_todayDateTime" expr="eval:__config__.app.getTodayDateTime()"/>
	</action-view>	
	
	<menuitem name="manufacturing-root-operation-order-planned-calendar" parent="manufacturing-root"
		title="Planned operations" action="manufacturing.root.operation.order.planned.calendar" order="30" />

	<action-view name="manufacturing.root.operation.order.planned.calendar" title="Planned operations"
		model="com.axelor.apps.production.db.OperationOrder" >
		<view type="calendar" name="operation-order-planned-calendar"/>
		<view type="grid" name="operation-order-grid" />
		<view type="form" name="operation-order-form" />
		<domain>self.statusSelect = 3</domain>
	</action-view>
	
	<menuitem name="manufacturing-root-operation-order-real-calendar" parent="manufacturing-root"
		title="Real operations" action="manufacturing.root.operation.order.real.calendar" order="35" />

	<action-view name="manufacturing.root.operation.order.real.calendar" title="Real operations"
		model="com.axelor.apps.production.db.OperationOrder" >
		<view type="calendar" name="operation-order-real-calendar"/>
		<view type="grid" name="operation-order-grid" />
		<view type="form" name="operation-order-form" />
		<domain>self.statusSelect = 6</domain>
	</action-view>
	
	<menuitem name="manufacturing-root-charge-by-machine-dashboard" parent="manufacturing-root"
		title="Charge by machine" action="manufacturing.root.charge.by.machine.dashboard" order="40" />

	<action-view name="manufacturing.root.charge.by.machine.dashboard" title="Charge by machine">
		<view type="dashboard" name="charge.by.machine.dashboard" />
		<context name="today" expr="eval:__config__.app.getTodayDate()"/>
	</action-view>

	<menuitem name="manufacturing-root-raw-material-requirement" parent="manufacturing-root"
		title="Raw material requirement" action="manufacturing.root.raw.material.requirement" order="42"/>

	<action-view name="manufacturing.root.raw.material.requirement" title="Raw material requirement"
		model="com.axelor.apps.production.db.RawMaterialRequirement">
		<view type="grid" name="raw-material-requirement-grid"/>
		<view type="form" name="raw-material-requirement-form"/>
	</action-view>
	
	<menuitem name="manufacturing-root-cost-calculations" parent="manufacturing-root" title="Cost calculations" action="manufacturing.root.cost.calculations" order="44"/>

	<action-view name="manufacturing.root.cost.calculations" title="Cost calculations" model="com.axelor.apps.production.db.UnitCostCalculation">
		<view type="grid" name="cost-calculations-grid"/>
		<view type="form" name="cost-calculations-form"/>
	</action-view>

	<menuitem name="manufacturing-root-report" parent="manufacturing-root" title="Reportings" order="45" icon="fa-bar-chart"/>

    <menuitem name="menu-manufacturing-dashboard-1" parent="manufacturing-root-report" title="Manufacturing" action="manufacturing.dashboard.view" />

    <action-view name="manufacturing.dashboard.view" title="Manufacturing Dashboard">
        <view type="dashboard" name="manufacturing.dashboard.sample" />
        <context name="_today" expr="eval: __date__"/>
    </action-view>

    <menuitem name="menu-manufacturing-user-dashboard" parent="manufacturing-root-report" title="User" action="manufacturing.user.dashboard.view" />

    <action-view name="manufacturing.user.dashboard.view" title="User Dashboard" model="com.axelor.auth.db.User">
        <view type="form" name="manufacturing-dashboard-user"/>
    </action-view>
		
	<menuitem name="manufacturing-conf" parent="manufacturing-root" title="Configuration" order="50" icon="fa-cog"/>

	<menuitem name="manufacturing-conf-work-center" parent="manufacturing-conf"
		title="Work centers" action="manufacturing.conf.work.center" />

	<action-view name="manufacturing.conf.work.center" title="Work centers"
		model="com.axelor.apps.production.db.WorkCenter" >
		<view type="grid" name="work-center-grid" />
		<view type="form" name="work-center-form" />
	</action-view>
	
	<menuitem name="manufacturing-conf-machine" parent="manufacturing-conf"
		title="Machines" action="manufacturing.conf.machine" />

	<action-view name="manufacturing.conf.machine" title="Machines"
		model="com.axelor.apps.production.db.Machine" >
		<view type="grid" name="machine-grid" />
		<view type="form" name="machine-form" />
	</action-view>
	
	<menuitem name="manufacturing-conf-machine-type" parent="manufacturing-conf"
		title="Machine Types" action="manufacturing.conf.machine.type" />

	<action-view name="manufacturing.conf.machine.type" title="Machine Types"
		model="com.axelor.apps.production.db.MachineType" >
		<view type="grid" name="machine-type-grid" />
		<view type="form" name="machine-type-form" />
	</action-view>
	
	<menuitem name="manufacturing-conf-cost-sheet-group" parent="manufacturing-conf"
		title="Cost sheet groups" action="manufacturing.conf.cost.sheet.group" if="__config__.app.getApp('production').getManageCostSheetGroup()"/>

	<action-view name="manufacturing.conf.cost.sheet.group" title="Cost sheet group"
		model="com.axelor.apps.production.db.CostSheetGroup" >
		<view type="grid" name="cost-sheet-group-grid" />
		<view type="form" name="cost-sheet-group-form" />
	</action-view>

	<menuitem name="manufacturing-conf-manuf-order" parent="manufacturing-conf"
		title="Permanent manufacturing orders" action="manufacturing.conf.manuf.order" />

	<action-view name="manufacturing.conf.manuf.order" title="Permanent manufacturing orders"
		model="com.axelor.apps.production.db.ManufOrder" >
		<view type="grid" name="manuf-order-grid" />
		<view type="form" name="manuf-order-form" />
		<view-param name="search-filters" value="manuf-order-filters"/>
		<domain>self.isPermanent = true</domain>
		<context name="_todayDateTime" expr="eval:__config__.app.getTodayDateTime()"/>
		<context name="_createPermanent" expr="eval: true"/>
	</action-view>
	
	<menuitem name="manufacturing-conf-configurators" parent="manufacturing-conf"
		title="Configurators" if="__config__.app.getApp('production').getEnableConfigurator()"/>

	<menuitem name="manufacturing-conf-configurators-creator" parent="manufacturing-conf-configurators" order="10"
			  title="Configurator creators" action="manufacturing.conf.configurator.creator"/>

	<action-view name="manufacturing.conf.configurator.creator" title="Configurator creators"
				 model="com.axelor.apps.sale.db.ConfiguratorCreator" >
		<view type="grid" name="configurator-creator-grid" />
		<view type="form" name="configurator-creator-form" />
	</action-view>

	<menuitem name="manufacturing-conf-configurators-configurators" parent="manufacturing-conf-configurators" order="20"
			  title="Configurators" action="manufacturing.conf.configurator.configurators"/>

	<action-view name="manufacturing.conf.configurator.configurators" title="Configurators"
				 model="com.axelor.apps.sale.db.Configurator" >
		<view type="grid" name="configurator-grid" />
		<view type="form" name="configurator-form" />
		<domain>:__user__ IN self.configuratorCreator.authorizedUserSet OR :groupId IN self.configuratorCreator.authorizedGroupSet</domain>
		<context name="groupId" expr="eval: __user__.group.id"/>
	</action-view>

	<menuitem name="manufacturing-conf-configurators-bom" parent="manufacturing-conf-configurators" order="30"
			  title="Configurator BOM" action="manufacturing.conf.configurator.bom"/>

	<action-view name="manufacturing.conf.configurator.bom" title="Configurator BOM"
				 model="com.axelor.apps.production.db.ConfiguratorBOM" >
		<view type="grid" name="configurator-bom-grid" />
		<view type="form" name="configurator-bom-form" />
	</action-view>

	<menuitem name="manufacturing-conf-configurators-prodprocess" parent="manufacturing-conf-configurators" order="40"
			  title="Configurator production process" action="manufacturing.conf.configurator.prod.process"/>

	<action-view name="manufacturing.conf.configurator.prod.process" title="Configurator production process"
				 model="com.axelor.apps.production.db.ConfiguratorProdProcess" >
		<view type="grid" name="configurator-prod-process-grid" />
		<view type="form" name="configurator-prod-process-form" />
	</action-view>

	<menuitem name="manufacturing-conf-configurators-prod-process-line" parent="manufacturing-conf-configurators" order="50"
			  title="Configurator Phase" action="manufacturing.conf.configurator.prod.process.line"/>

	<action-view name="manufacturing.conf.configurator.prod.process.line" title="Configurator Phase"
				 model="com.axelor.apps.production.db.ConfiguratorProdProcessLine" >
	<view type="grid" name="configurator-prod-process-line-grid" />
	<view type="form" name="configurator-prod-process-line-form" />
	</action-view>
	
	<menuitem title="Product approvals" name="manufacturing-conf-product-approvals" parent="manufacturing-conf" 
				action="manufacturing.conf.product.approvals"/>
				
	<action-view name="manufacturing.conf.product.approvals" title="Product approvals" model="com.axelor.apps.production.db.ProductApproval">
		<view type="grid" name="product-approval-grid"/>
		<view type="form" name="product-approval-form"/>
	</action-view>
	
	<menuitem name="manufacturing-conf-cancelreason" parent="manufacturing-conf"
		title="Cancel Reasons" action="manufacturing.conf.cancelreason" />

	<action-view name="manufacturing.conf.cancelreason"
		title="Cancel Reason" model="com.axelor.apps.base.db.CancelReason" >
		<view type="grid" name="cancel-reason-grid" />
		<view type="form" name="cancel-reason-form" />
		<domain>self.applicationType = :_xApplicationType</domain>
		<context name="_xApplicationType" expr="eval: com.axelor.apps.production.db.ManufOrder"/>
	</action-view>

	<menuitem name="manufacturing-conf-machine-planning" parent="manufacturing-conf"
		title="Machine Planning" action="manufacturing.conf.machine.planning" />

	<action-view name="manufacturing.conf.machine.planning"
		title="Machine Planning" model="com.axelor.apps.base.db.WeeklyPlanning" >
		<view type="grid" name="weekly-planning-grid" />
		<view type="form" name="weekly-planning-form" />
		<view-param name="forceTitle" value="true"/>
		<domain>self.typeSelect = :_typeSelect</domain>
		<context name="_typeSelect" expr="eval: 2"/>
	</action-view>

	<menuitem title="Workshop" name="manufacturing-conf-workshop" parent="manufacturing-conf" action="manufacturing.conf.workshop" if="__config__.app.getApp('production').manageWorkshop" />
	
	<action-view name="manufacturing.conf.workshop" title="Workshop" model="com.axelor.apps.stock.db.StockLocation">
		<view type="grid" name="stock-location-grid"/>
		<view type="form" name="stock-location-form"/>
		<domain>self.usableOnProduction = true AND self.isWorkshop = true</domain>
		<context name="_productionWorkshop" expr="eval:true"/>
	</action-view>
	
	<!-- ADMINISTRATION -->

	<menuitem name="admin-root-batch-production" parent="admin-root-batch" if="__config__.app.isApp('production')" if-module="axelor-production" 
	title="Production batches" action="admin.root.batch.production" />

	<action-view name="admin.root.batch.production" title="Production batches"
		model="com.axelor.apps.production.db.ProductionBatch" >
		<view type="grid" name="production-batch-grid" />
		<view type="form" name="production-batch-form" />
	</action-view>

	<!-- TOP MENU -->
	
	<menuitem name="top-manufacturing" title="Manufacturing" order="6" left="false" top="true"  if="__config__.app.isApp('production')"/>
	
	<menuitem name="top-manufacturing-manuf-order" parent="top-manufacturing"
		title="Manuf. orders" action="top.manufacturing.manuf.order" top="true"/>

	<action-view name="top.manufacturing.manuf.order" title="Manuf. orders"
		model="com.axelor.apps.production.db.ManufOrder" >
		<view type="grid" name="manuf-order-grid" />
		<view type="form" name="manuf-order-form" />
		<view-param name="search-filters" value="manuf-order-filters"/>
		<context name="_todayDateTime" expr="eval:__config__.app.getTodayDateTime()"/>
	</action-view>	
	
	<menuitem name="top-manufacturing-operation-order" parent="top-manufacturing"
		title="Operation orders" action="top.manufacturing.operation.order" top="true"/>

	<action-view name="top.manufacturing.operation.order" title="Operation orders"
		model="com.axelor.apps.production.db.OperationOrder" >
		<view type="grid" name="operation-order-group-grid" />
		<view type="form" name="operation-order-form" />
		<view-param name="search-filters" value="operation-order-filters"/>
		<context name="_todayDateTime" expr="eval:__config__.app.getTodayDateTime()"/>
	</action-view>	
	
	<menuitem name="top-manufacturing-bill-of-material" parent="top-manufacturing"
		title="Bill of materials" action="top.manufacturing.bill.of.material" top="true"/>

	<action-view name="top.manufacturing.bill.of.material" title="Bill of materials"
		model="com.axelor.apps.production.db.BillOfMaterial" >
		<view type="grid" name="bill-of-material-grid" />
		<view type="form" name="bill-of-material-form" />
		<domain>self.defineSubBillOfMaterial = true AND self.personalized = false</domain>
	</action-view>
</object-views>
