<?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="product-family-grid" title="Product accounting families" model="com.axelor.apps.base.db.ProductFamily" orderBy="name">
        <field name="name"/>
        <field name="code" x-bind="{{code|unaccent|uppercase}}"/>
    </grid>
    
    <form name="product-family-form" title="Accounting family" model="com.axelor.apps.base.db.ProductFamily" width="large">
	    <toolbar>
			<button name="viewProductsBtn" title="View Products" onClick="action-view-product-by-family"/>
		</toolbar>
		<panel name="mainPanel" >
	        <field name="name"/>
	        <field name="code" x-bind="{{code|unaccent|uppercase}}" />
	        <panel-related name="accountManagementListPanel" field="accountManagementList" grid-view="account-management-product-grid" form-view="account-management-form"
	        domain="self.typeSelect = 1" colSpan="12"/>
	        <panel name="salesTurnoverPanel" title="Sales Turnover" hideIf="fromMenu == null" if-module="axelor-supplychain" colSpan="12" if="__config__.app.isApp('supplychain')">    
				<panel-dashlet name="salesTurnOverPanel" height="350" action="dashlet.family.sales.turnover.per.month" colSpan="12"/>
	  		</panel>
        </panel>
    </form>
    
    <action-view name="action-view-product-by-family" title="Products (${ name })" model="com.axelor.apps.base.db.Product">
		<view type="grid" name="product-grid"/>
		<view type="form" name="product-form"/>
		<domain>self.productFamily.id = :_productFamilyId</domain>
		<context name="_productFamilyId" expr="eval: __this__.id"/>
	</action-view>
	
</object-views>