<?xml version="1.0" encoding="UTF-8"?>
<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">
	
<!--   	Purchase Buyer Dashboard -->
	
	<dashboard title="Dashboard" name="purchase.buyer.dashboard.sample"  >
		<dashlet action="dashlet.purchase.buyer.dashboard.validated.orders" height="350" canSearch="true" colSpan="12"/>
		<dashlet action="dashlet.purchase.buyer.dashboard.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.purchase.buyer.dashboard.order.to.validate" canSearch="true" height="350" />
		<dashlet action="dashlet.my.purchase.per.product.family.volume" height="350"/>
	    <dashlet action="dashlet.my.purchase.amount.per.product.family" height="350"/>
		<dashlet action="dashlet.purchase.amount.per.product.family" canSearch="true" height="350"/>
		<dashlet action="dashlet.nbr.of.po.per.month"  canSearch="true" height="350" />
		<dashlet action="dashlet.total.purchase.amount" canSearch="true" height="350"/>
		<dashlet action="dashlet.total.purchase.qty" canSearch="true" height="350"/>
	</dashboard>

	<action-view name="dashlet.purchase.buyer.dashboard.validated.orders" title="My Validated POs"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
		<view type="grid" name="my-purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<domain>self.buyerUser =:__user__ and self.company = :_active_company and self.statusSelect = 4</domain>
    	<context name="_active_company" expr="call:com.axelor.apps.base.service.user.UserService:getUserActiveCompany()"/>
	</action-view>
	
	<action-view name="dashlet.purchase.buyer.dashboard.orders" title="My Purchase orders"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
		<view type="grid" name="my-purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<domain>self.buyerUser =:__user__ and self.company = :_active_company</domain>
    	<context name="_active_company" expr="call:com.axelor.apps.base.service.user.UserService:getUserActiveCompany()"/> 
	</action-view>

	<action-view name="dashlet.purchase.buyer.dashboard.order.to.validate" title="My RFQs and POs To Validate (Requested &amp; Received)"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
		<view type="grid" name="my-purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<domain>self.buyerUser =:__user__ and self.statusSelect in (2,3) and self.company =:_active_company</domain>
    	<context name="_active_company" expr="call:com.axelor.apps.base.service.user.UserService:getUserActiveCompany()"/>
	</action-view>
	
	<action-view name="dashlet.my.purchase.per.product.family.volume" title="My purchased qty by product accounting family"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
	  <view type="chart" name="chart.my.purchase.per.product.family.volume"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>
	  <context name="activeCompany" expr="call:com.axelor.apps.base.service.user.UserService:getUserActiveCompany()"/>
	</action-view>

	<action-view name="dashlet.my.purchase.amount.per.product.family" title="My purchased amount by product accounting family"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
	  <view type="chart" name="chart.my.purchase.amount.per.product.family"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>
	  <context name="activeCompany" expr="call:com.axelor.apps.base.service.user.UserService:getUserActiveCompany()"/>
	</action-view>

	<action-view name="dashlet.purchase.amount.per.product.family" title="Purchased amount by product accounting family"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
	  <view type="chart" name="chart.purchase.amount.per.product.family"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>
	  <context name="activeCompany" expr="call:com.axelor.apps.base.service.user.UserService:getUserActiveCompany()"/>
	</action-view>

	<action-view name="dashlet.nbr.of.po.per.month" title="Nbr of PO by month" model="com.axelor.apps.purchase.db.PurchaseOrder">
	  <view type="chart" name="chart.nbr.of.po.per.month"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>

	</action-view>
	
	<action-view name="dashlet.total.purchase.amount" title="Total Purchased Amount by month" model="com.axelor.apps.purchase.db.PurchaseOrder">
	  <view type="chart" name="chart.total.purchase.amount"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>

	</action-view>	
	
	<action-view name="dashlet.total.purchase.qty" title="Total Purchased Qty by month" model="com.axelor.apps.purchase.db.PurchaseOrder">
	  <view type="chart" name="chart.total.purchase.qty"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>

	</action-view>

	
	<!-- 	Purchase Manager Dashboard -->
	
	
	<dashboard title="Dashboard" name="purchase.manager.dashboard.sample"  >
		<dashlet action="dashlet.purchase.manager.dashboard.validated.orders" height="350" canSearch="true" colSpan="12"/>
		<dashlet action="dashlet.purchase.manager.dashboard.order.to.validate" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.purchase.order.volume.by.buyer.by.family" height="350"/>
	    <dashlet action="dashlet.purchase.order.amount.by.family" height="350"/>
	    <dashlet action="dashlet.purchase.order.amount.distribution.by.family" height="350"/>
		<dashlet action="dashlet.50.latest.supplier.orders" canSearch="true" height="350"/>
	</dashboard>

	<action-view name="dashlet.purchase.manager.dashboard.validated.orders" title="Current Purchase orders"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
		<view type="grid" name="purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<domain>self.statusSelect in (4,5)</domain>
	</action-view>

	<action-view name="dashlet.purchase.manager.dashboard.order.to.validate" title="RFQ And PO To Validate"
		model="com.axelor.apps.purchase.db.PurchaseOrder">
		<view type="grid" name="purchase-order-grid" />
		<view type="form" name="purchase-order-form" />
		<domain>self.statusSelect = 3</domain>
	</action-view>
	
	<action-view name="dashlet.purchase.order.volume.by.buyer.by.family" title="POs Volume by buyer by accounting family">
	  <view type="chart" name="chart.purchase.order.volume.by.buyer.by.family"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>

	</action-view>
	
	<action-view name="dashlet.purchase.order.amount.by.family" title="Purchased amount by accounting family">
	  <view type="chart" name="chart.purchase.order.amount.by.family"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>

	</action-view>
	
	<action-view name="dashlet.purchase.order.amount.distribution.by.family" title="Purchased amount distribution by accounting family">
	  <view type="chart" name="chart.purchase.order.amount.distribution.by.family"/>
	  <context name="todayDate" expr="eval:__config__.app.getTodayDate()"/>

	</action-view>

	<action-view name="dashlet.50.latest.supplier.orders" title="50 Latest Supplier Orders">
			<view type="grid" name="purchase-order-grid" />
			<view type="form" name="purchase-order-form" />
	</action-view>
	
	
	<!-- Purchase order Dashboard -->
	<dashboard name="purchase.order.dashboard.sample" title="Dashboard">
		<dashlet action="dashlet.my.purchase.orders.to.execute" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.ongoing.purchase.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.my.ongoing.purchase.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.closed.purchase.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.my.closed.purchase.orders" canSearch="true" height="350" colSpan="12"/>
	</dashboard>
	
	<action-view title="My Orders to process" model="com.axelor.apps.purchase.db.PurchaseOrder" name="dashlet.my.purchase.orders.to.execute">
	    <view type="grid" name="my-purchase-order-grid"/>
	    <view type="form" name="purchase-order-form"/>
	    <domain>self.statusSelect=3 AND self.buyerUser =:__user__</domain>
	</action-view>
	
	<action-view title="Ongoing Purchase orders" model="com.axelor.apps.purchase.db.PurchaseOrder" name="dashlet.ongoing.purchase.orders">
	    <view type="grid" name="purchase-order-grid"/>
	    <view type="form" name="purchase-order-form"/>
	    <domain>self.statusSelect=4</domain>    
	</action-view>
	
	<action-view title="My Ongoing Purchase orders" model="com.axelor.apps.purchase.db.PurchaseOrder" name="dashlet.my.ongoing.purchase.orders">
	    <view type="grid" name="my-purchase-order-grid"/>
	    <view type="form" name="purchase-order-form"/>
	    <domain>self.statusSelect = 4 AND self.buyerUser = :__user__</domain>
	</action-view>
	
	<action-view title="Closed Purchase orders" model="com.axelor.apps.purchase.db.PurchaseOrder" name="dashlet.closed.purchase.orders">
	    <view type="grid" name="purchase-order-grid"/>
	    <view type="form" name="purchase-order-form"/>
	    <domain>self.statusSelect = 4</domain>    
	</action-view>
	
	<action-view title="My Closed Purchase orders" model="com.axelor.apps.purchase.db.PurchaseOrder" name="dashlet.my.closed.purchase.orders">
	    <view type="grid" name="my-purchase-order-grid"/>
	    <view type="form" name="purchase-order-form"/>
	    <domain>self.statusSelect = 4 AND self.buyerUser = :__user__</domain>
	</action-view>
	
	
	<!-- 	Purchases Dashboard -->
	
	<dashboard name="purchase.dashboard.1" title="Purchase Buyer">
		<dashlet action="dashlet.purchase.buyer.dashboard.validated.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.purchase.buyer.dashboard.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.purchase.buyer.dashboard.order.to.validate" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.my.purchase.per.product.family.volume" canSearch="true" height="350" />
		<dashlet action="dashlet.my.purchase.amount.per.product.family" canSearch="true" height="350" />
		<dashlet action="dashlet.purchase.amount.per.product.family" canSearch="true" height="350" />
		<dashlet action="dashlet.nbr.of.po.per.month" canSearch="true" height="350" />
		<dashlet action="dashlet.total.purchase.amount" canSearch="true" height="350" />
		<dashlet action="dashlet.total.purchase.qty" canSearch="true" height="350" />
		<dashlet action="dashlet.purchase.manager.dashboard.validated.orders" canSearch="true" height="350" colSpan="12"/>
		</dashboard>
	
	<dashboard name="purchase.dashboard.2" title="Purchase Manager">
		<dashlet action="dashlet.purchase.manager.dashboard.order.to.validate" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.purchase.order.volume.by.buyer.by.family" canSearch="true" height="350" />
		<dashlet action="dashlet.purchase.order.amount.by.family" canSearch="true" height="350" />
		<dashlet action="dashlet.purchase.order.amount.distribution.by.family" canSearch="true" height="350" />
	</dashboard>
	
	<dashboard name="purchase.dashboard.3" title="Purchase orders Details">
		<dashlet action="dashlet.my.purchase.orders.to.execute" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.ongoing.purchase.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.my.ongoing.purchase.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.closed.purchase.orders" canSearch="true" height="350" colSpan="12"/>
		<dashlet action="dashlet.my.closed.purchase.orders" canSearch="true" height="350" colSpan="12"/>
	</dashboard>
	
</object-views>