<?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="sc-root-purchase" title="Purchases" order="-105"  if="__config__.app.isApp('purchase')"
		icon="fa-shopping-cart"  icon-background="#b6473f"/>
	
	<menuitem name="sc-root-purchase-suppliers" parent="sc-root-purchase" order="5"
		title="Suppliers" action="sc.root.purchase.suppliers" />

	<action-view name="sc.root.purchase.suppliers" title="Suppliers"
		model="com.axelor.apps.base.db.Partner" >
		<view type="cards" name="partner-cards" />
		<view type="grid" name="partner-supplier-grid" />
		<view type="form" name="partner-supplier-form" />
	  	<view-param name="limit" value="39"/>
		<view-param name="search-filters" value="partner-filters"/>
		<domain>self.isContact = false AND self.isSupplier = true</domain>
		<context name="user_id" expr="eval:__user__" />
		<context name="_isSupplier" expr="true"/>
		<context name="_domain" expr="self.isContact = false AND self.isSupplier = true"/>
		<context name="json-enhance" expr="eval:true" />
	</action-view>
	
	<menuitem name="sc-root-purchase-contacts" parent="sc-root-purchase" order="10"
		title="Contacts" action="sc.root.purchase.contacts" />

	<action-view name="sc.root.purchase.contacts" title="Contacts"
		model="com.axelor.apps.base.db.Partner" >
		<view type="cards" name="partner-contact-cards" />
		<view type="grid" name="partner-contact-grid" />
		<view type="form" name="partner-contact-form" />
	  	<view-param name="limit" value="39"/>
		<view-param name="search-filters" value="partner-filters"/>
		<domain>self.isContact = true AND self.mainPartner.isSupplier = true</domain>
		<context name="_domain" expr="self.isContact = true AND self.mainPartner.isSupplier = true"/>
	</action-view>
	
	<menuitem name="sc-root-purchase-products" parent="sc-root-purchase" order="15"
		title="Products &amp; services" action="sc.root.purchase.products" />

	<action-view name="sc.root.purchase.products" title="Products &amp; services"
		model="com.axelor.apps.base.db.Product" >
		<view type="cards" name="product-cards" />
		<view type="grid" name="product-grid" />
		<view type="form" name="product-form" />
		<view-param name="search-filters" value="products-filters"/>
		<domain>self.isModel = false AND self.purchasable = true</domain>
		<context name="_activeCompany" expr="eval:__user__.activeCompany"/>
		<context name="_fromPurchase" expr="eval:true" />
	</action-view>

	<!-- Purchase request menus -->
	<menuitem name="sc-root-purchase-request" parent="sc-root-purchase" if="__config__.app.isApp('purchase-request')"
		title="Internal purchase requests" order="16" icon="fa-bullhorn" icon-background="#b6473f"
		action="sc.root.purchase.request.all" />

	<action-view name="sc.root.purchase.request.all" model="com.axelor.apps.purchase.db.PurchaseRequest"
		title="Internal purchase requests">
		<view type="grid" name="purchase-request-grid"/>
		<view type="form" name="purchase-request-form"/>
	</action-view>

	<!-- Purchase request menus end  -->

	<menuitem name="sc-root-purchase-quotations" title="Purchase quotations" order="20" 
		 action="sc.root.purchase.quotations" parent="sc-root-purchase"/>
		
	<action-view name="sc.root.purchase.quotations" title="Purchase quotations"
		model="com.axelor.apps.purchase.db.PurchaseOrder" >
		<view type="cards" name="purchase-quotations-order-cards" />
		<view type="grid" name="purchase-order-quotation-grid" />
		<view type="form" name="purchase-order-form" />
		<view-param name="search-filters" value="purchase-order-filters"/>
		<domain>self.statusSelect &lt; 3</domain>
		<context name="_internalUser" expr="eval: __user__.id"/>
		<context name="_status" expr="eval: [1,2]"/>
	</action-view>
	
	<menuitem name="sc-root-purchase-orders" title="Purchase orders" order="25" 
		 action="sc.root.purchase.orders" parent="sc-root-purchase"/>

	<action-view name="sc.root.purchase.orders" title="Purchase orders"
		model="com.axelor.apps.purchase.db.PurchaseOrder" >
		<view type="cards" name="purchase-order-cards" />
		<view type="grid" name="purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<view-param name="search-filters" value="purchase-order-filters"/>
		<domain>self.statusSelect IN (3)</domain>
		<context name="_internalUser" expr="eval: __user__.id"/>
		<context name="_status" expr="eval: 3"/>
	</action-view>

	<menuitem name="purchase-root-abc-analysis" title="ABC analysis" order="27"
		action="purchase.root.abc.analysis" parent="sc-root-purchase"/>

	<action-view name="purchase.root.abc.analysis" title="ABC analysis"
		model="com.axelor.apps.base.db.ABCAnalysis">
		<view type="grid" name="abc-analysis-grid"/>
		<view type="form" name="abc-analysis-form"/>
		<domain>self.typeSelect = :_type</domain>
		<context name="_type" expr="com.axelor.apps.purchase.service.ABCAnalysisServicePurchaseImpl"/>
	</action-view>
	
	<menuitem name="sc-root-purchase-historical" title="Historical" order="30" parent="sc-root-purchase" 
		action="purchase.historical.orders"/>

	<action-view name="purchase.historical.orders" title="Historical"
		model="com.axelor.apps.purchase.db.PurchaseOrder" >
		<view type="cards" name="purchase-order-cards" />
		<view type="grid" name="purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<view-param name="search-filters" value="purchase-order-filters"/>
		<context name="_internalUser" expr="eval: __user__.id"/>
	</action-view>
	
	<menuitem name="sc-root-purchase-report" parent="sc-root-purchase" title="Reportings" order="200" icon="fa-bar-chart"/>

	<menuitem name="purchase-maps-partner-suppliers" parent="sc-root-purchase-report" 
		title="Suppliers Map" action="action-show-suppliers-on-map-page" order="10"/>		
		
	
	<!-- demandeur menus -->
	
	<!-- <menuitem name="sc-purchase-request" title="Purchase requests" order="-105"  if="__config__.app.isApp('purchase')"
		icon="fa-shopping-cart" groups="demandeur" icon-background="#b6473f"/>
		
	<menuitem name="sc-root-purchase-request-my-request-new" parent="sc-purchase-request"
		title="New Request" action="sc.root.purchase.request.my.request.new" order="2" groups="demandeur" />
		
	<action-view name="sc.root.purchase.request.my.request.new" model="com.axelor.apps.purchase.db.PurchaseRequest"
		title="New Request ">
		<view type="form" name="purchase-request-form"/>
		<view type="grid" name="purchase-request-grid"/>
		<domain>self.createdBy = :__user__</domain>
	</action-view>
	
	<menuitem name="sc-root-purchase-request-my-current-cart" parent="sc-purchase-request"
		title="My current cart" action="sc.root.purchase.request.my.current.cart" order="3"  groups="demandeur" />
		
	<action-view name="sc.root.purchase.request.my.current.cart" model="com.axelor.apps.purchase.db.PurchaseRequest"
		title="My current cart">
		<view type="grid" name="my-current-cart-purchase-request-grid"/>
		<view type="form" name="purchase-request-form"/>
		<domain>self.createdBy = :__user__ and self.statusSelect = 1</domain>
	</action-view>
	
	<menuitem name="sc-root-purchase-request-my-sent" parent="sc-purchase-request" groups="demandeur"
		title="My sent requests" action="sc.root.purchase.request.my.sent" order="4" />
		
	<action-view name="sc.root.purchase.request.my.sent" model="com.axelor.apps.purchase.db.PurchaseRequest"
		title="My sent requests">
		<view type="grid" name="sent-purchase-request-grid"/>
		<view type="form" name="purchase-request-form"/>
		<domain>self.createdBy = :__user__ and self.statusSelect = 2</domain>
	</action-view>
	
	<menuitem name="sc-root-purchase-request-my-accepted" parent="sc-purchase-request" groups="demandeur"
		title="My accepted requests" action="sc.root.purchase.request.my.accepted" order="5" />
		
	<action-view name="sc.root.purchase.request.my.accepted" model="com.axelor.apps.purchase.db.PurchaseRequest"
		title="My accepted requests">
		<view type="grid" name="purchase-request-grid"/>
		<view type="form" name="purchase-request-form"/>
		<domain>self.createdBy = :__user__ and self.statusSelect = 3</domain>
	</action-view>
	
	<menuitem name="sc-root-purchase-request-my-refused" parent="sc-purchase-request" groups="demandeur"
		title="My refused requests" action="sc.root.purchase.request.my.refused" order="6" />
		
	<action-view name="sc.root.purchase.request.my.refused" model="com.axelor.apps.purchase.db.PurchaseRequest"
		title="My refused requestes">
		<view type="grid" name="purchase-request-grid"/>
		<view type="form" name="purchase-request-form"/>
		<domain>self.createdBy = :__user__ and self.statusSelect = 7</domain>
	</action-view>
	
	<menuitem name="sc-root-purchase-request-my" parent="sc-purchase-request"
		title="All my requests" action="sc.root.purchase.request.my" order="7" groups="demandeur" />
		
	<action-view name="sc.root.purchase.request.my" model="com.axelor.apps.purchase.db.PurchaseRequest"
		title="All my requests">
		<view type="grid" name="purchase-request-grid"/>
		<view type="form" name="purchase-request-form"/>
		<domain>self.createdBy = :__user__</domain>
	</action-view>  -->
	
	<!--demandeur menus end  -->
			
	<menuitem name="sc-root-purchase-conf" parent="sc-root-purchase"
		title="Configuration" order="300" icon="fa-cog"/>

	<menuitem name="sc-root-purchase-conf-partner-price-list" parent="sc-root-purchase-conf"
		title="Partner price lists" action="sc.root.purchase.conf.partner.price.list" />

	<action-view name="sc.root.purchase.conf.partner.price.list" title="Partner price lists"
		model="com.axelor.apps.base.db.PartnerPriceList" >
		<view type="grid" name="partner-price-list-grid" />
		<view type="form" name="purchase-partner-price-list-form" />
		<domain>self.typeSelect = 2</domain>
	</action-view>

	<menuitem name="sc-root-purchase-conf-price-list" parent="sc-root-purchase-conf"
		title="Price lists" action="sc.root.purchase.conf.price.list" />

	<action-view name="sc.root.purchase.conf.price.list" title="Price lists"
		model="com.axelor.apps.base.db.PriceList" >
		<view type="grid" name="price-list-grid" />
		<view type="form" name="purchase-price-list-form" />
		<domain>self.typeSelect = 2</domain>
	</action-view>
	
	<menuitem name="sc-root-purchase-conf-purchase-request-creator" parent="sc-root-purchase-conf" if="__config__.app.isApp('purchase-request')"
		title="Purchase request creator" action="sc.root.purchase.conf.purchase.request.creator" />

	<action-view name="sc.root.purchase.conf.purchase.request.creator" title="Purchase request creator"
		model="com.axelor.apps.purchase.db.PurchaseRequestCreator" >
		<view type="grid" name="purchase-request-creator-grid" />
		<view type="form" name="purchase-request-creator-form" />
	</action-view>


<!-- TOP MENU -->

	<menuitem name="top-menu-purchase" title="Purchases" order="3" top="true" left="false" if="__config__.app.isApp('purchase')"/>
	
	<menuitem name="top-menu-purchase-quotations" title="Sale quotations" top="true"
		 action="top.menu.purchase.quotations" parent="top-menu-purchase"/>
		
	<action-view name="top.menu.purchase.quotations" title="Sale quotations"
		model="com.axelor.apps.purchase.db.PurchaseOrder" >
		<view type="cards" name="purchase-order-cards" />
		<view type="grid" name="purchase-order-quotation-grid" />
		<view type="form" name="purchase-order-form" />
		<view-param name="search-filters" value="purchase-order-filters"/>
		<domain>self.statusSelect &lt; 3</domain>
		<context name="_internalUser" expr="eval: __user__.id"/>
	</action-view>
	
	<menuitem name="top-menu-purchase-purchase-orders" title="Purchase orders" top="true"
		 action="top.menu.purchase.purchase.orders" parent="top-menu-purchase"/>

	<action-view name="top.menu.purchase.purchase.orders" title="Purchase orders"
		model="com.axelor.apps.purchase.db.PurchaseOrder" >
		<view type="cards" name="purchase-order-cards" />
		<view type="grid" name="purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<view-param name="search-filters" value="purchase-order-filters"/>
		<domain>self.statusSelect &gt; 2</domain>
		<context name="_internalUser" expr="eval: __user__.id"/>
	</action-view>

<!-- 	<menuitem name="top-purchase-reqeust-my-current-cart" order="-65" title="My current cart" action="sc.root.purchase.request.my.current.cart" parent="top-purchase"  top="true" left="false"/>		 -->
	
	
	<menuitem name="menu-purchase-dashboard-1" parent="sc-root-purchase-report"  
		title="Purchase Buyer"  action="purchase.dashboard.1" />	
		
	<action-view name="purchase.dashboard.1" title="Purchase Buyer">
		<view type="dashboard" name="purchase.dashboard.1" />	 
		<context name="_user_id" expr="eval:__user__.id"/>   
	</action-view>
	
	<menuitem name="menu-purchase-dashboard-2" parent="sc-root-purchase-report"  
		title="Purchase Manager"  action="purchase.dashboard.2" />	
		
	<action-view name="purchase.dashboard.2" title="Purchase Manager">
		<view type="dashboard" name="purchase.dashboard.2" />	    
	</action-view>
	
	<menuitem name="menu-purchase-dashboard-3" parent="sc-root-purchase-report"  
		title="Purchase orders"  action="purchase.purchase.dashboard.3" />
		
	<action-view name="purchase.purchase.dashboard.3" title="Purchase orders Details">
		<view type="dashboard" name="purchase.dashboard.3" />	    
	</action-view>
	
	
</object-views>
