<commit_before><?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.0.xsd">
    
    <grid name="product-grid" title="Products" model="com.axelor.apps.base.db.Product" orderBy="code,name" x-row-height="80">
   		<toolbar>
        	<button name="catalog" title="Catalog" onClick="action-print-product-catalog" icon="fa-book"/>
			<button name="checkDuplicate" title="Check Duplicate" onClick="action-general-check-duplicate-records"/>
	    </toolbar>
	    <field name="code" x-bind="{{code|unaccent|uppercase}}" width="100"/>
	    <field name="name" width="300"/>
	    <field name="productCategory" form-view="product-category-form" grid-view="product-category-grid"/>
	    <field name="productFamily" form-view="product-family-form" grid-view="product-family-grid"/>
	    <field name="productTypeSelect" width="100"/>
	   	<field name="salePrice" x-scale="2" />
	    <field name="unit" width="70" form-view="unit-form" grid-view="unit-grid"/>
	    <field name="internalDescription" widget="html" width="400" />
	    <button name="sendByEmail" title="Send Email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
	</grid>
    
    <grid name="product-product-variant-grid" title="Products" model="com.axelor.apps.base.db.Product" orderBy="code,name">
	    <field name="code" x-bind="{{code|unaccent|uppercase}}" width="120"/>
	    <field name="name"/>
	    <field name="productVariant" width="200"/>
	    <field name="costPrice" width="120" x-scale="2"/>
	    <field name="salePrice" width="120" x-scale="2"/>
    </grid>

	<form name="product-form" title="Product" model="com.axelor.apps.base.db.Product" 
	onNew="action-group-base-product-onnew"
	onLoad="action-group-product-onload" width="large">
 		<toolbar>
    		<button name="showProductSheet" title="Product sheet" icon="fa-print" onClick="save,action-product-method-show-product-sheet"/>
    		<button name="sendByEmail" title="Send Email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
  		</toolbar>
  		<panel name="main" >
   			<panel colSpan="7">
    			<field name="fullName" showTitle="false" css="label-bold bold large" colSpan="12">
        			<editor x-show-titles="false">
          				<field name="code" x-bind="{{code|unaccent|uppercase}}" showTitle="false" colSpan="3" css="label-bold bold large" placeholder="Code" />
          				<field name="name" showTitle="false" colSpan="9" css="label-bold bold large" placeholder="Name"/>
        			</editor>
      			</field>
    		</panel>
    		<panel colSpan="5">
                <field name="isModel" hidden="true"/>
       			<button name="$totalVariants" title="Total variants" showIf="isModel" colSpan="4" icon="fa-tags" onClick="action-product-view-total-variants" widget="info-button"/>
      			<panel showTitle="false" showIf="productTypeSelect == 'storable'" colSpan="8" if-module="axelor-stock" if="__config__.app.isApp('stock')">
       	 			<button name="$realQty" title="Real qty" colSpan="6" icon="fa-building-o" onClick="action-stock-move-line-product-default-realized" widget="info-button"/>
       	 			<button name="$futureQty" title="Future qty" colSpan="6" icon="fa-line-chart" onClick="action-stock-move-line-product-default-planned" widget="info-button"/>
    	  		</panel>
      		</panel>
    		<panel colSpan="2">
      			<field name="picture" showTitle="false" colSpan="12" widget="Image">
					<viewer>
					<![CDATA[
			    		<img ng-show="record.picture" ng-src="{{$image('picture', 'content')}}" />
          				<img ng-show="!record.picture" src="img/product-default.png" />
					]]>
					</viewer>
				</field>
				<field name="barCode" showTitle="false" colSpan="12" widget="Image" if="__config__.app.getApp('base').getActivateBarCodeGeneration()" readonly="true" x-height="50"/>
				<field name="sequence" showIf="sequence.length &gt; 0" colSpan="12"/>
			</panel>
    		<panel colSpan="10">
      
      			<panel name="productTypology" title="Product typology" colSpan="6" colWidths="30%,70%">
			        <field name="productTypeSelect" colSpan="12" onChange="action-group-base-product-producttype-onchange" selection-in="['service','storable']" if="!__config__.app.isApp('subscription')"/>
			        <field name="productTypeSelect" colSpan="12" onChange="action-group-base-product-producttype-onchange" if="__config__.app.isApp('subscription')"/>
			        <field name="productSubTypeSelect" colSpan="12"  showIf="productTypeSelect == 'storable'" if="__config__.app.isApp('production')"/>
           			<field name="isShippingCostsProduct" colSpan="4"/>
			        <field name="isActivity" showIf="productTypeSelect == 'service' &amp;&amp; !isShippingCostsProduct" if-module="axelor-human-resource" if="__config__.app.isApp('employee')" />
			        <field name="periodicitySelect" showIf="productTypeSelect == 'subscriptable'" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')" />
			        <field name="saleSupplySelect" colSpan="12" onChange="action-product-validate-sale-supply-select" hideIf="isShippingCostsProduct"/>
			        <field name="standardDelay" colSpan="12" showIf="saleSupplySelect == 2 || saleSupplySelect == 3" hidden="true" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')"/>
      			</panel>
		      	<panel name="categorization" title="Categorization" colSpan="6" colWidths="30%,70%">
		        	<field name="productFamily" canEdit="false"  colSpan="12" form-view="product-family-form" grid-view="product-family-grid"/>
		        	<field name="productCategory" canEdit="false" colSpan="12" domain="self.productFamily = :productFamily" form-view="product-category-form" grid-view="product-category-grid"/>
		      	</panel>
      			<panel colSpan="12">
			        <field name="inAti" colSpan="6"/>
			        <field name="isPack" if="__config__.app.isApp('sale') &amp;&amp; __config__.app.getApp('sale').getProductPackMgt()" hideIf="isShippingCostsProduct"/>
			        <field name="expense" hidden="true"/>
      			</panel>
    		</panel>
  		</panel>
  		<panel-tabs title="Product specific attributes">
    		<panel name="sale" title="Sale" showTitle="false">
				<panel title="Sales" colSpan="6">
					<field name="sellable" colSpan="12"/>
					<field name="autoUpdateSalePrice" hideIf="!sellable" colSpan="12"/>
					<field name="salePrice" readonlyIf="autoUpdateSalePrice" hideIf="!sellable" colSpan="12"/>
					<field name="saleCurrency" canEdit="false" hideIf="!sellable" colSpan="12" form-view="currency-form" grid-view="currency-grid"/>
					<panel name="units" title="Units" colSpan="6">
						<field name="unit" canEdit="false" colSpan="12" form-view="unit-form" grid-view="unit-grid"/>
						<field name="salesUnit" canEdit="false" hideIf="!sellable" colSpan="12" form-view="unit-form" grid-view="unit-grid" if="__config__.app.getApp('sale').getManageSalesUnits()"/>
						<field name="purchasesUnit" canEdit="false" hideIf="!purchasable" colSpan="12" form-view="unit-form" grid-view="unit-grid" if="__config__.app.getApp('purchase').getManagePurchasesUnits()"/>
					</panel>
					<panel colSpan="12" title="Configurator" if-module="axelor-sale">
						<button name="showConfigurator" title="Show Configurator" onClick="action-product-method-show-product-configurator"/>
					</panel>
				</panel>
	      		<panel colSpan="6">
			      	<panel name="productDates" title="Product dates" colSpan="12">
			        	<field name="startDate" colSpan="12"/>
			        	<field name="endDate" colSpan="12" onChange="action-group-base-product-enddate-onchange"/>
			      	</panel>
			        <field name="isPrototype" showIf="productTypeSelect =='storable'"/>
		        	<field name="versionSelect" colSpan="12"/>
				</panel>
	      		<panel name="description" title="Description" colSpan="6">
	        		<field name="description" showTitle="false" colSpan="12" widget="html"/>
	      		</panel>
	      		<panel name="internalDescription" title="Internal description" colSpan="6">
	        		<field name="internalDescription" showTitle="false" colSpan="12" widget="html"/>
	      		</panel>
	    	</panel>
	    	<panel name="purchaseCosts" title="Purchase/Costs" showTitle="false">
		      	<panel name="purchase" title="Purchases" colSpan="6">
			        <field name="purchasable" colSpan="12"/>
			        <field name="purchasePrice" showIf="purchasable" colSpan="6"/>
			        <field name="purchaseCurrency" canEdit="false" showIf="purchasable" colSpan="6" form-view="currency-form" grid-view="currency-grid"/>
			        <field name="defaultSupplierPartner" canEdit="false" showIf="purchasable" colSpan="6" domain="self.isContact = false AND self.isSupplier = true" form-view="partner-form" grid-view="partner-grid"/>
			        <field name="supplierDeliveryTime" showIf="purchasable" colSpan="6"/>
		      	</panel>
	      		<panel name="costs" title="Costs" colSpan="6">
			        <field name="costPrice" colSpan="6" onChange="action-product-record-compute-sale-price"/>
			        <field name="costTypeSelect" colSpan="6" onChange="action-product-group-cost-type-select-onchange"/>
			        <field name="managPriceCoef" colSpan="12" onChange="action-product-record-compute-sale-price"/>
					<field name="shippingCoef" showIf="!defShipCoefByPartner"/>
					<field name="defShipCoefByPartner" onChange="action-product-method-supplier-catalog-coeff"/>
	      		</panel>
	      		<panel-related field="supplierCatalogList" form-view="supplier-catalog-form" grid-view="supplier-catalog-grid" title="Suppliers catalog" showIf="purchasable" colSpan="12" 
	      		if-module="axelor-purchase" if="__config__.app.isApp('purchase')"/>
	    	</panel>
            <panel name="accounting" title="Accounting" if="__config__.app.isApp('account')">
                <field name="isAnalyticCapture" colSpan="6" if-module="axelor-account" if="__config__.app.isApp('account')"/>
                <panel-related field="accountManagementList" form-view="account-management-product-form" grid-view="account-management-product-grid" domain="self.typeSelect = 1" title="Accounting" showTitle="false" colSpan="12"/>
            </panel>
	    		<panel name="stock" title="Stock" showTitle="false" showIf="productTypeSelect == 'storable'" if-module="axelor-stock" if="__config__.app.isApp('stock')" >
	     			<panel name="procurementSettings" title="Procurement settings" colSpan="12" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')" >
				        <field name="procurementMethodSelect" colSpan="6" requiredIf="productTypeSelect == 'storable'"/>
				        <field name="excludeFromMrp" showIf="productTypeSelect == 'storable'" colSpan="6"/>
				        <field name="mrpFamily" showIf="productTypeSelect == 'storable' &amp;&amp; !excludeFromMrp" colSpan="6" canNew="true"/>
                        <field name="inventoryTypeSelect" colSpan="6"/>
	      			</panel>
	      			<panel colSpan="12" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')">
						<field name="controlOnReceipt"/>
				        <button name="showAllStockMoveLine" title="Show all stock move" colSpan="6" onClick="action-product-view-stock-move-line"/>
						<field name="avgPrice"/>
				        <spacer/>
				        <panel-dashlet colSpan="12" action="action-product-view-stock" showIf="id" />
				        <panel-dashlet colSpan="12" action="action-stock-report-for-product" showIf="id" />
				        <panel-dashlet colSpan="12" action="action-stock-history-report-for-product" showIf="id" />
	      			</panel>
	    		</panel>
	    		<panel name="productionInformations" title="Production information" showTitle="false" showIf="productTypeSelect == 'storable'" onTabSelect="action-product-attrs-readonly-create-production-order" if-module="axelor-production" if="__config__.app.isApp('production')" >
	      			<panel-include view="product-production-form"/>
	      			<panel-dashlet colSpan="12" action="action-product-view-production-process" showIf="id" />
	    		</panel>
	    		<panel name="trackingNumber" title="Tracking number" showTitle="false" showIf="productTypeSelect != 'service'" if-module="axelor-stock" if="__config__.app.isApp('stock')">
	      			<panel colSpan="12">
				        <field name="hasWarranty"/>
				        <field name="warrantyNbrOfMonths" showIf="hasWarranty"/>
				        <field name="isPerishable"/>
				        <field name="perishableNbrOfMonths" showIf="isPerishable"/>
				        <field name="checkExpirationDateAtStockMoveRealization" showIf="hasWarranty || isPerishable"/>
	      			</panel>
	      			<panel colSpan="12">
	        			<field name="trackingNumberConfiguration" canNew="true" form-view="tracking-number-configuration-form" grid-view="tracking-number-configuration-grid"/>
	      			</panel>
	    		</panel>
	    		<panel name="variants" title="Variants" showTitle="false" if="__config__.app.getApp('base').getManageProductVariants()">
	      			<panel name="parentVariant" showIf="!parentProduct" colSpan="12">
	        			<field name="productVariantConfig" colSpan="12" canSelect="false" canNew="true">
				        	<editor x-show-titles="false">
					            <field name="productVariantAttr1" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue1Set" showIf="productVariantAttr1" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr2" showIf="productVariantAttr1" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue2Set" showIf="productVariantAttr2" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr3" showIf="productVariantAttr2" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue3Set" showIf="productVariantAttr3" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr4" showIf="productVariantAttr3" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue4Set" showIf="productVariantAttr4" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
				          	</editor>
	        			</field>
	        			<button name="generateProductVariant" title="Generate product variants" onClick="save,action-product-method-generate-product-variant"/>
						<field name="manageVariantPrice"/>
	        			<panel-dashlet colSpan="12" action="action-product-view-product-variant" showIf="id" />
	      			</panel>
	      			<panel name="childVariant" showIf="parentProduct" colSpan="12">
	        			<field name="productVariant" showTitle="false" canSelect="false">
			          		<editor x-show-titles="false">
					            <field name="productVariantAttr1" showTitle="false" readonly="true" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue1" showTitle="false" showIf="productVariantAttr1" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr2" showTitle="false" readonly="true" showIf="productVariantAttr1" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue2" showTitle="false" showIf="productVariantAttr2" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr3" showTitle="false" readonly="true" showIf="productVariantAttr2" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue3" showTitle="false" showIf="productVariantAttr3" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr4" showTitle="false" readonly="true" showIf="productVariantAttr3" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue4" showTitle="false" showIf="productVariantAttr4" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
				          </editor>
	        			</field>
	        			<field name="parentProduct" canEdit="false" form-view="product-form" grid-view="product-grid"/>
	        			<panel-dashlet colSpan="12" action="action-product-view-other-product-variant" showIf="parentProduct" />
	      			</panel>
	      			<button name="updateProductsPrices" title="Update products prices" onClick="save,action-product-method-update-products-prices"/>
	    		</panel>
	    	<panel name="links" title="Links" if-module="axelor-stock" if="__config__.app.isApp('stock')" hideIf="isShippingCostsProduct">
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line-incoming-planned" showIf="id" />
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line-consumption-planned" showIf="id" />
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line" showIf="id" />
<!--  				<panel-dashlet action="action-product-view-supplier-requests-historical" colSpan="12" if-module="axelor-supplier-management"/> -->
<!--  				<panel-dashlet action="action-product-view-purchase-order-line-in-progress" colSpan="12" if-module="axelor-purchase"/> -->
<!--  				<panel-dashlet action="action-product-view-purchase-order-line-historical" colSpan="12" if-module="axelor-purchase"/> -->
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line-consumption-historical" showIf="id" />
	    	</panel>
	    	<panel name="packaging" title="Packaging" hideIf="isShippingCostsProduct">
	  			<panel name="weight" title="Weight" colSpan="6">
	  				<field name="weightUnit" canEdit="false" domain="self.unitTypeSelect = 1"/>
	  				<field name="grossWeight"/>
	  				<field name="netWeight"/>
	  			</panel>
			      <panel name="articleDimension" title="Article dimension" colSpan="6">
			        <field name="lengthUnit" canEdit="false" domain="self.unitTypeSelect = 2" />
			        <field name="length" readonlyIf="diameter > 0" onChange="action-product-record-calculate-volume-length"/>
			        <field name="width" readonlyIf="diameter > 0" onChange="action-product-record-calculate-volume-length"/>
			        <field name="height" onChange="action-product-record-calculate-volume-length, action-product-record-calculate-volume-diameter"/>
			        <field name="diameter" readonlyIf="length > 0 || width > 0" onChange="action-product-record-calculate-volume-diameter"/>
			        <field name="articleVolume" readonly="true"/>
			      </panel>
				  <field name="customsCodeNomenclature" canEdit="false" if-module="axelor-stock" if="__config__.app.isApp('stock')"/>
  			</panel>
  			<panel-related field="packLines" showIf="isPack" if="__config__.app.isApp('sale') &amp;&amp; __config__.app.getApp('sale').getProductPackMgt()" />
  		</panel-tabs>
  		<panel>
  			<field name="attrs" colSpan="12" />
  		</panel>
  		
  		<panel-mail>
    		<mail-messages />
    	</panel-mail>
	</form>    
	
	<cards name="product-cards" title="Product" model="com.axelor.apps.base.db.Product" width="25%" css="rect-image" orderBy="code,name">
	    <toolbar>
        	<button name="catalog" title="Catalog" onClick="action-print-product-catalog" icon="fa-book"/>
			<button name="checkDuplicate" title="Check Duplicate" onClick="action-general-check-duplicate-records"/>
	    </toolbar>
		<field name="picture" />
		<field name="fullName" />
		<field name="salePrice" x-scale="2" />
		<field name="saleCurrency.symbol" />
		<field name="productFamily" />
		<field name="productCategory" />
		<field name="internalDescription"/>
		<template><![CDATA[
		    <div class="span12"><strong>{{fullName}}</strong></div>
			<div>
			  <div class="span4 card-image">
			    <img ng-show="picture" ng-src="{{$image('picture', 'content')}}" />
			    <img ng-show="!picture" src="img/product-default.png" />
			  </div>
			  <div class="span8">
			    <span>{{$fmt('salePrice')}} {{saleCurrency.symbol}}<br/>
			    {{productFamily.name}}<br/>
			    {{productCategory.name}}</span>
			  </div>
			</div>
			<div class="span12" ng-bind-html="internalDescription"></div>
		]]>
		</template>
	</cards>
	
    <action-view name="action-product-view-create-production-order" title="Create production order (${ name })" model="com.axelor.apps.base.db.Wizard">
    	<view type="form" name="production-order-wizard-form"/>
    	<view-param name="popup" value="reload"/>
    	<view-param name="forceEdit" value="true"/> 
	    <view-param name="width" value="800" />
	    <view-param name="show-confirm" value="false" />
	    <view-param name="show-toolbar" value="false" />
   	  	<view-param name="popup-save" value="false"/>
    	<context name="_productId" expr="eval: id"/>
    </action-view>
    
    <action-group name="action-group-base-product-onnew">
   	 	<action name="action-product-attrs-scale-and-precision"/>
   	 	<action name="action-product-attrs-scale-and-precision-production"/>
		<action name="action-product-attrs-scale-and-precision-stock"/>
    	<action name="action-product-record-default-new"/>
    	<action name="action-product-record-sale-supply-select"/>
    	<action name="action-product-record-in-ati"/>
    	<action name="action-product-attrs-in-ati"/>
    	<action name="action-product-record-default-production"/>
    	<action name="action-product-attrs-readonly-unit"/>
    	<action name="action-product-attrs-readonly-sellable" if="__context__?._fromSale"/>
    	<action name="action-product-attrs-readonly-purchasable" if="__context__?._fromPurchase"/>
		<action name="action-product-attrs-set-cost-type-select"/>
    </action-group>
    
    <action-group name="action-group-base-product-producttype-onchange">
    	<action name="action-product-record-sale-supply-select"/>
    	<action name="action-product-validate-sale-supply-select"/>
    	<action name="action-product-attrs-title-sale-price"/>
    	<action name="action-product-record-product-sub-type-select"/>
    </action-group>
    
    <action-record name="action-product-record-product-sub-type-select" model="com.axelor.apps.base.db.Product">
    	<field name="productSubTypeSelect" expr="eval: null" if="productTypeSelect != 'storable'"/>
    </action-record>
    
    <action-group name="action-group-base-product-enddate-onchange">
    	<action name="action-product-validate-end-date"/>
    	<action name="action-product-method-reset-end-date"/>
    </action-group>
    
    <action-group name="action-group-product-onload">
    	<action name="action-product-attrs-readonly-unit"/>
        <action name="action-product-attrs-scale-and-precision"/>
        <action name="action-product-attrs-scale-and-precision-production"/>
		<action name="action-product-attrs-scale-and-precision-stock"/>
        <action name="action-product-attrs-title-sale-price"/>
        <action name="action-product-attrs-title-unit"/>
		<action name="action-product-attrs-in-ati"/>
        <action name="action-product-set-stock"/>
        <action name="action-product-set-total-variants"/>
        <action name="action-product-attrs-readonly-sellable" if="__context__?._fromSale"/>
        <action name="action-product-attrs-readonly-purchasable" if="__context__?._fromPurchase"/>
		<action name="action-product-method-supplier-catalog-coeff"/>
		<action name="action-product-attrs-cost-price-variant"/>
		<action name="save"/>
    </action-group>

	<action-group name="action-product-group-cost-type-select-onchange">
		<action name="action-product-attrs-update-cost-price"/>
		<action name="action-product-record-compute-sale-price"/>
	</action-group>

    <action-attrs name="action-product-attrs-readonly-unit" if-module="axelor-stock">
    	<attribute name="readonly" for="unit" expr="eval: __repo__(StockLocationLine).all().filter('self.product.id = ?1 AND (self.currentQty != 0 OR self.futureQty != 0)', id).fetch().size &gt; 0" if="id != null &amp;&amp; __config__.app.isApp('stock')"/>
    </action-attrs>
    
    <action-record name="action-product-record-in-ati" model="com.axelor.apps.base.db.Product">
    	<field name="inAti" expr="eval:__config__.app.getApp('base').getProductInAtiSelect() == 2 || __config__.app.getApp('base').getProductInAtiSelect() == 4"/>
    </action-record>
    
    <action-attrs name="action-product-attrs-in-ati">
    	<attribute name="hidden" for="inAti" expr=" eval: __config__.app.getApp('base').getProductInAtiSelect() == 1 || __config__.app.getApp('base').getProductInAtiSelect() == 2"/>
		<attribute if=" __config__.app.getApp('base').getProductInAtiSelect() == 1 || __config__.app.getApp('base').getProductInAtiSelect() == 2"
				   name="value" for="inAti" expr="eval: __config__.app.getApp('base').getProductInAtiSelect() == 2" />
    </action-attrs>

    <action-attrs name="action-product-attrs-scale-and-precision">
		<attribute name="scale" for="salePrice" expr="eval: __config__.app.getNbDecimalDigitForUnitPrice()"/>
		<attribute name="scale" for="purchasePrice" expr="eval: __config__.app.getNbDecimalDigitForUnitPrice()"/>
		<attribute name="scale" for="costPrice" expr="eval: __config__.app.getNbDecimalDigitForUnitPrice()"/>
	</action-attrs>

	<action-attrs name="action-product-attrs-set-cost-type-select">
		<attribute for="costTypeSelect" name="selection-in" expr="[1,2]"/>
        <attribute for="costTypeSelect" name="selection-in" expr="[1,2,3]" if="__config__.app.isApp('supplychain')"/>
		<attribute for="costTypeSelect" name="selection-in" expr="[1,2,3,4]" if="__config__.app.isApp('production')"/>
	</action-attrs>

	<action-attrs name="action-product-attrs-update-cost-price">
		<attribute for="costPrice" name="readonly" expr="eval: costTypeSelect != 1"/>
		<attribute for="costPrice" name="value" expr="eval: shippingCoef ? purchasePrice.multiply(shippingCoef) : purchasePrice" if="costTypeSelect == 2"/>
		<attribute for="costPrice" name="value" expr="eval: avgPrice" if="costTypeSelect == 3"/>
		<attribute for="costPrice" name="value" expr="eval: lastProductionPrice" if="costTypeSelect == 4"/>
	</action-attrs>

	<action-attrs name="action-product-attrs-cost-price-variant">
		<attribute for="costPrice" name="readonly" expr="eval: true"
				   if="parentProduct?.manageVariantPrice"/>
        <attribute for="costTypeSelect" name="hidden" expr="eval: true"
				   if="parentProduct?.manageVariantPrice"/>
	</action-attrs>

    <action-record name="action-product-record-default-new" model="com.axelor.apps.base.db.Product">
    	<field name="expense" expr="false"/>
    	<field name="productTypeSelect" expr="eval: _productTypeSelect"/>
    	<field name="procurementMethodSelect" expr="buy"/>
    	<field name="startDate" expr="eval:__config__.app.getTodayDate()" if="startDate == null"/>
    	<field name="salePrice" expr="0"/>
    	<field name="purchasePrice" expr="0"/>
    	<field name="saleCurrency" expr="eval: _activeCompany?.currency"/>
    	<field name="purchaseCurrency" expr="eval: _activeCompany?.currency"/>
    	<field name="managPriceCoef" expr="1"/>
    	<field name="isModel" expr="eval: _isModel"/>
    	<field name="isShippingCostsProduct" expr="eval: _isShippingCostsProduct"/>
    </action-record>
    
    <action-record name="action-product-record-sale-supply-select" model="com.axelor.apps.base.db.Product">
    	<field name="saleSupplySelect" expr="1" if="productTypeSelect == 'storable'"/>
    	<field name="saleSupplySelect" expr="3" if="productTypeSelect == 'service'"/>
    </action-record>
    
    <action-record name="action-product-record-compute-sale-price" model="com.axelor.apps.base.db.Product">
    	<field name="salePrice" expr="eval: managPriceCoef*costPrice"
			   if="costPrice != null &amp;&amp; managPriceCoef != null &amp;&amp; autoUpdateSalePrice"/>
    </action-record>
    
    <action-record name="action-product-set-total-variants" model="com.axelor.apps.base.db.Product">
    	<field name="$totalVariants" expr="eval:__repo__(Product).all().filter('self.parentProduct.id = ?',id).fetch().size"/>    
    </action-record>
	
	<action-record name="action-product-record-calculate-volume-diameter" model="com.axelor.apps.base.db.Product">
		<field name="articleVolume" if="diameter > 0.00" expr="eval: (((diameter/2)*(diameter/2))*Math.PI)*height"/>
	</action-record>
	
	<action-record name="action-product-record-calculate-volume-length" model="com.axelor.apps.base.db.Product">
		<field name="articleVolume" if="length > 0" expr="eval: length * width * height"/>
	</action-record>
    
    <action-validate name="action-product-validate-sale-supply-select">
   		<alert message="A product of type service can't be procured from stock." if="saleSupplySelect == 1 &amp;&amp; productTypeSelect == 'service'"/>
	</action-validate> 
	
	<action-method name="action-print-product-catalog" >
		<call class="com.axelor.apps.base.web.ProductController" method="printProductCatelog"/>
	</action-method>
	
	<action-method name="action-product-method-show-product-sheet" >
		<call class="com.axelor.apps.base.web.ProductController" method="printProductSheet"/>
	</action-method>
	
	<action-method name="action-product-method-generate-product-variant" >
		<call class="com.axelor.apps.base.web.ProductController" method="generateProductVariants"/>
	</action-method>
	
	<action-method name="action-product-method-update-products-prices" >
		<call class="com.axelor.apps.base.web.ProductController" method="updateProductsPrices"/>
	</action-method>
	
    <action-validate name="action-product-validate-end-date">
    	<alert message="The product pulled-off date must be greater than the launch date." if="endDate &lt; startDate"/>
    </action-validate>
    
    <action-record name="action-product-method-reset-end-date" model="com.axelor.apps.base.db.Product">
    	<field name="endDate" expr="eval:__config__.app.getTodayDate()" if="endDate &lt; startDate"/>
    </action-record>
    
    <action-view name="action-product-view-product-variant" title="Products variants"
		model="com.axelor.apps.base.db.Product">
		<view type="grid" name="product-product-variant-grid"/>
		<view type="form" name="product-form"/>
		<domain>self.parentProduct.id = :id</domain>
	</action-view>	
	
	<action-view name="action-product-view-other-product-variant" title="Other variants"
		model="com.axelor.apps.base.db.Product">
		<view type="grid" name="product-product-variant-grid"/>
		<view type="form" name="product-form"/>
		<domain>self.parentProduct.id = :parentId</domain>
		<context name="parentId" expr="eval: parentProduct?.id"/>
	</action-view>	
	
	<action-view name="action-product-view-total-variants" title="${fullName} variants"
		model="com.axelor.apps.base.db.Product">
		<view type="grid" name="product-product-variant-grid"/>
		<view type="form" name="product-form"/>
		<domain>self.parentProduct.id = :_id</domain>
	</action-view>	
	
	<action-view name="action-product-view-production-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"/>
		<domain>self.product.id = :id </domain>
	</action-view>	
	
	<action-attrs name="action-product-attrs-bill-of-material-domain">
		<attribute name="domain" for="defaultBillOfMaterial" expr="eval: &quot;(self.product.id = ${parentProduct?.id} OR self.product.id = ${id}) AND self.defineSubBillOfMaterial = false&quot;"/>
	</action-attrs>
	
	<action-attrs name="action-product-attrs-readonly-create-production-order">
		<attribute name="readonly" for="createProductionOrder" expr="eval: __repo__(BillOfMaterial).all().filter('(self.product.id = ?1 OR self.product.id = ?2) AND self.defineSubBillOfMaterial = false', parentProduct?.id, id).fetch().isEmpty()"/>
	</action-attrs>
	
	<action-attrs name="action-product-attrs-title-sale-price">
		<attribute name="title" for="salePrice" expr="eval: com.axelor.i18n.I18n.get('Sale Price (for periodicity selected)')" if="productTypeSelect == 'subscriptable'"/>
		<attribute name="title" for="salePrice" expr="eval: com.axelor.i18n.I18n.get('Sale price')" if="productTypeSelect != 'subscriptable'"/>
	</action-attrs>

    <action-attrs name="action-product-attrs-title-unit" if-module="axelor-stock">
        <attribute name="title" for="unit" expr="eval: com.axelor.i18n.I18n.get('Unit')"/>
        <attribute name="title" for="unit" expr="eval: com.axelor.i18n.I18n.get('Stock Unit')" if="__config__.app.getApp('sale').getManageSalesUnits()"/>
        <attribute name="title" for="unit" expr="eval: com.axelor.i18n.I18n.get('Stock Unit')" if="__config__.app.getApp('purchase').getManagePurchasesUnits()"/>
    </action-attrs>
	
    <search-filters name="products-filters" model="com.axelor.apps.base.db.Product" title="Products filters">
		<filter title="Current Products">
			<domain>self.endDate IS NULL or CURRENT_DATE &lt; self.endDate</domain>
		</filter>
		<filter title="Storable Products">
			<domain>(self.endDate IS NULL or CURRENT_DATE &lt; self.endDate) and self.productTypeSelect = 'storable'</domain>
		</filter>
		<filter title="Service Products">
			<domain>(self.endDate IS NULL or CURRENT_DATE &lt; self.endDate) and self.productTypeSelect = 'service'</domain>
		</filter>
		<filter title="Products With Variant">
			<domain>self.productVariantConfig != null</domain>
		</filter>
		<filter title="Define sub bill of material">
			<domain>self.subTypeProductSelect = 3</domain>
		</filter>
		<filter title="Obsolete Products">
			<domain>CURRENT_DATE &gt; self.endDate</domain>
		</filter>
	</search-filters>
	
	
	<action-view name="action-product-view-show-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.product.id = :productId AND self.defineSubBillOfMaterial = 'false'</domain>
		<context name="productId" expr="eval: id"/>
	</action-view>
	
</object-views>
<commit_msg>RM#9700: fix descriptions colspan in product<commit_after><?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.0.xsd">
    
    <grid name="product-grid" title="Products" model="com.axelor.apps.base.db.Product" orderBy="code,name" x-row-height="80">
   		<toolbar>
        	<button name="catalog" title="Catalog" onClick="action-print-product-catalog" icon="fa-book"/>
			<button name="checkDuplicate" title="Check Duplicate" onClick="action-general-check-duplicate-records"/>
	    </toolbar>
	    <field name="code" x-bind="{{code|unaccent|uppercase}}" width="100"/>
	    <field name="name" width="300"/>
	    <field name="productCategory" form-view="product-category-form" grid-view="product-category-grid"/>
	    <field name="productFamily" form-view="product-family-form" grid-view="product-family-grid"/>
	    <field name="productTypeSelect" width="100"/>
	   	<field name="salePrice" x-scale="2" />
	    <field name="unit" width="70" form-view="unit-form" grid-view="unit-grid"/>
	    <field name="internalDescription" widget="html" width="400" />
	    <button name="sendByEmail" title="Send Email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
	</grid>
    
    <grid name="product-product-variant-grid" title="Products" model="com.axelor.apps.base.db.Product" orderBy="code,name">
	    <field name="code" x-bind="{{code|unaccent|uppercase}}" width="120"/>
	    <field name="name"/>
	    <field name="productVariant" width="200"/>
	    <field name="costPrice" width="120" x-scale="2"/>
	    <field name="salePrice" width="120" x-scale="2"/>
    </grid>

	<form name="product-form" title="Product" model="com.axelor.apps.base.db.Product" 
	onNew="action-group-base-product-onnew"
	onLoad="action-group-product-onload" width="large">
 		<toolbar>
    		<button name="showProductSheet" title="Product sheet" icon="fa-print" onClick="save,action-product-method-show-product-sheet"/>
    		<button name="sendByEmail" title="Send Email" icon="fa-envelope" onClick="action-send-by-email-with-template"/>
  		</toolbar>
  		<panel name="main" >
   			<panel colSpan="7">
    			<field name="fullName" showTitle="false" css="label-bold bold large" colSpan="12">
        			<editor x-show-titles="false">
          				<field name="code" x-bind="{{code|unaccent|uppercase}}" showTitle="false" colSpan="3" css="label-bold bold large" placeholder="Code" />
          				<field name="name" showTitle="false" colSpan="9" css="label-bold bold large" placeholder="Name"/>
        			</editor>
      			</field>
    		</panel>
    		<panel colSpan="5">
                <field name="isModel" hidden="true"/>
       			<button name="$totalVariants" title="Total variants" showIf="isModel" colSpan="4" icon="fa-tags" onClick="action-product-view-total-variants" widget="info-button"/>
      			<panel showTitle="false" showIf="productTypeSelect == 'storable'" colSpan="8" if-module="axelor-stock" if="__config__.app.isApp('stock')">
       	 			<button name="$realQty" title="Real qty" colSpan="6" icon="fa-building-o" onClick="action-stock-move-line-product-default-realized" widget="info-button"/>
       	 			<button name="$futureQty" title="Future qty" colSpan="6" icon="fa-line-chart" onClick="action-stock-move-line-product-default-planned" widget="info-button"/>
    	  		</panel>
      		</panel>
    		<panel colSpan="2">
      			<field name="picture" showTitle="false" colSpan="12" widget="Image">
					<viewer>
					<![CDATA[
			    		<img ng-show="record.picture" ng-src="{{$image('picture', 'content')}}" />
          				<img ng-show="!record.picture" src="img/product-default.png" />
					]]>
					</viewer>
				</field>
				<field name="barCode" showTitle="false" colSpan="12" widget="Image" if="__config__.app.getApp('base').getActivateBarCodeGeneration()" readonly="true" x-height="50"/>
				<field name="sequence" showIf="sequence.length &gt; 0" colSpan="12"/>
			</panel>
    		<panel colSpan="10">
      
      			<panel name="productTypology" title="Product typology" colSpan="6" colWidths="30%,70%">
			        <field name="productTypeSelect" colSpan="12" onChange="action-group-base-product-producttype-onchange" selection-in="['service','storable']" if="!__config__.app.isApp('subscription')"/>
			        <field name="productTypeSelect" colSpan="12" onChange="action-group-base-product-producttype-onchange" if="__config__.app.isApp('subscription')"/>
			        <field name="productSubTypeSelect" colSpan="12"  showIf="productTypeSelect == 'storable'" if="__config__.app.isApp('production')"/>
           			<field name="isShippingCostsProduct" colSpan="4"/>
			        <field name="isActivity" showIf="productTypeSelect == 'service' &amp;&amp; !isShippingCostsProduct" if-module="axelor-human-resource" if="__config__.app.isApp('employee')" />
			        <field name="periodicitySelect" showIf="productTypeSelect == 'subscriptable'" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')" />
			        <field name="saleSupplySelect" colSpan="12" onChange="action-product-validate-sale-supply-select" hideIf="isShippingCostsProduct"/>
			        <field name="standardDelay" colSpan="12" showIf="saleSupplySelect == 2 || saleSupplySelect == 3" hidden="true" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')"/>
      			</panel>
		      	<panel name="categorization" title="Categorization" colSpan="6" colWidths="30%,70%">
		        	<field name="productFamily" canEdit="false"  colSpan="12" form-view="product-family-form" grid-view="product-family-grid"/>
		        	<field name="productCategory" canEdit="false" colSpan="12" domain="self.productFamily = :productFamily" form-view="product-category-form" grid-view="product-category-grid"/>
		      	</panel>
      			<panel colSpan="12">
			        <field name="inAti" colSpan="6"/>
			        <field name="isPack" if="__config__.app.isApp('sale') &amp;&amp; __config__.app.getApp('sale').getProductPackMgt()" hideIf="isShippingCostsProduct"/>
			        <field name="expense" hidden="true"/>
      			</panel>
    		</panel>
  		</panel>
  		<panel-tabs title="Product specific attributes">
    		<panel name="sale" title="Sale" showTitle="false">
				<panel title="Sales" colSpan="6">
					<field name="sellable" colSpan="12"/>
					<field name="autoUpdateSalePrice" hideIf="!sellable" colSpan="12"/>
					<field name="salePrice" readonlyIf="autoUpdateSalePrice" hideIf="!sellable" colSpan="12"/>
					<field name="saleCurrency" canEdit="false" hideIf="!sellable" colSpan="12" form-view="currency-form" grid-view="currency-grid"/>
					<panel name="units" title="Units" colSpan="6">
						<field name="unit" canEdit="false" colSpan="12" form-view="unit-form" grid-view="unit-grid"/>
						<field name="salesUnit" canEdit="false" hideIf="!sellable" colSpan="12" form-view="unit-form" grid-view="unit-grid" if="__config__.app.getApp('sale').getManageSalesUnits()"/>
						<field name="purchasesUnit" canEdit="false" hideIf="!purchasable" colSpan="12" form-view="unit-form" grid-view="unit-grid" if="__config__.app.getApp('purchase').getManagePurchasesUnits()"/>
					</panel>
					<panel colSpan="12" title="Configurator" if-module="axelor-sale">
						<button name="showConfigurator" title="Show Configurator" onClick="action-product-method-show-product-configurator"/>
					</panel>
				</panel>
	      		<panel colSpan="6">
			      	<panel name="productDates" title="Product dates" colSpan="12">
			        	<field name="startDate" colSpan="12"/>
			        	<field name="endDate" colSpan="12" onChange="action-group-base-product-enddate-onchange"/>
			      	</panel>
			        <field name="isPrototype" showIf="productTypeSelect =='storable'"/>
		        	<field name="versionSelect" colSpan="12"/>
				</panel>
	      		<panel name="description" title="Description" colSpan="12">
	        		<field name="description" showTitle="false" colSpan="12" widget="html"/>
	      		</panel>
	      		<panel name="internalDescription" title="Internal description" colSpan="12">
	        		<field name="internalDescription" showTitle="false" colSpan="12" widget="html"/>
	      		</panel>
	    	</panel>
	    	<panel name="purchaseCosts" title="Purchase/Costs" showTitle="false">
		      	<panel name="purchase" title="Purchases" colSpan="6">
			        <field name="purchasable" colSpan="12"/>
			        <field name="purchasePrice" showIf="purchasable" colSpan="6"/>
			        <field name="purchaseCurrency" canEdit="false" showIf="purchasable" colSpan="6" form-view="currency-form" grid-view="currency-grid"/>
			        <field name="defaultSupplierPartner" canEdit="false" showIf="purchasable" colSpan="6" domain="self.isContact = false AND self.isSupplier = true" form-view="partner-form" grid-view="partner-grid"/>
			        <field name="supplierDeliveryTime" showIf="purchasable" colSpan="6"/>
		      	</panel>
	      		<panel name="costs" title="Costs" colSpan="6">
			        <field name="costPrice" colSpan="6" onChange="action-product-record-compute-sale-price"/>
			        <field name="costTypeSelect" colSpan="6" onChange="action-product-group-cost-type-select-onchange"/>
			        <field name="managPriceCoef" colSpan="12" onChange="action-product-record-compute-sale-price"/>
					<field name="shippingCoef" showIf="!defShipCoefByPartner"/>
					<field name="defShipCoefByPartner" onChange="action-product-method-supplier-catalog-coeff"/>
	      		</panel>
	      		<panel-related field="supplierCatalogList" form-view="supplier-catalog-form" grid-view="supplier-catalog-grid" title="Suppliers catalog" showIf="purchasable" colSpan="12" 
	      		if-module="axelor-purchase" if="__config__.app.isApp('purchase')"/>
	    	</panel>
            <panel name="accounting" title="Accounting" if="__config__.app.isApp('account')">
                <field name="isAnalyticCapture" colSpan="6" if-module="axelor-account" if="__config__.app.isApp('account')"/>
                <panel-related field="accountManagementList" form-view="account-management-product-form" grid-view="account-management-product-grid" domain="self.typeSelect = 1" title="Accounting" showTitle="false" colSpan="12"/>
            </panel>
	    		<panel name="stock" title="Stock" showTitle="false" showIf="productTypeSelect == 'storable'" if-module="axelor-stock" if="__config__.app.isApp('stock')" >
	     			<panel name="procurementSettings" title="Procurement settings" colSpan="12" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')" >
				        <field name="procurementMethodSelect" colSpan="6" requiredIf="productTypeSelect == 'storable'"/>
				        <field name="excludeFromMrp" showIf="productTypeSelect == 'storable'" colSpan="6"/>
				        <field name="mrpFamily" showIf="productTypeSelect == 'storable' &amp;&amp; !excludeFromMrp" colSpan="6" canNew="true"/>
                        <field name="inventoryTypeSelect" colSpan="6"/>
	      			</panel>
	      			<panel colSpan="12" if-module="axelor-supplychain" if="__config__.app.isApp('supplychain')">
						<field name="controlOnReceipt"/>
				        <button name="showAllStockMoveLine" title="Show all stock move" colSpan="6" onClick="action-product-view-stock-move-line"/>
						<field name="avgPrice"/>
				        <spacer/>
				        <panel-dashlet colSpan="12" action="action-product-view-stock" showIf="id" />
				        <panel-dashlet colSpan="12" action="action-stock-report-for-product" showIf="id" />
				        <panel-dashlet colSpan="12" action="action-stock-history-report-for-product" showIf="id" />
	      			</panel>
	    		</panel>
	    		<panel name="productionInformations" title="Production information" showTitle="false" showIf="productTypeSelect == 'storable'" onTabSelect="action-product-attrs-readonly-create-production-order" if-module="axelor-production" if="__config__.app.isApp('production')" >
	      			<panel-include view="product-production-form"/>
	      			<panel-dashlet colSpan="12" action="action-product-view-production-process" showIf="id" />
	    		</panel>
	    		<panel name="trackingNumber" title="Tracking number" showTitle="false" showIf="productTypeSelect != 'service'" if-module="axelor-stock" if="__config__.app.isApp('stock')">
	      			<panel colSpan="12">
				        <field name="hasWarranty"/>
				        <field name="warrantyNbrOfMonths" showIf="hasWarranty"/>
				        <field name="isPerishable"/>
				        <field name="perishableNbrOfMonths" showIf="isPerishable"/>
				        <field name="checkExpirationDateAtStockMoveRealization" showIf="hasWarranty || isPerishable"/>
	      			</panel>
	      			<panel colSpan="12">
	        			<field name="trackingNumberConfiguration" canNew="true" form-view="tracking-number-configuration-form" grid-view="tracking-number-configuration-grid"/>
	      			</panel>
	    		</panel>
	    		<panel name="variants" title="Variants" showTitle="false" if="__config__.app.getApp('base').getManageProductVariants()">
	      			<panel name="parentVariant" showIf="!parentProduct" colSpan="12">
	        			<field name="productVariantConfig" colSpan="12" canSelect="false" canNew="true">
				        	<editor x-show-titles="false">
					            <field name="productVariantAttr1" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue1Set" showIf="productVariantAttr1" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr2" showIf="productVariantAttr1" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue2Set" showIf="productVariantAttr2" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr3" showIf="productVariantAttr2" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue3Set" showIf="productVariantAttr3" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr4" showIf="productVariantAttr3" canNew="true" onChange="action-product-variant-config-attrs-domain" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue4Set" showIf="productVariantAttr4" colSpan="6" widget="TagSelect" canNew="false" onSelect="action-product-nested-product-variant-config-attrs-domain" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
				          	</editor>
	        			</field>
	        			<button name="generateProductVariant" title="Generate product variants" onClick="save,action-product-method-generate-product-variant"/>
						<field name="manageVariantPrice"/>
	        			<panel-dashlet colSpan="12" action="action-product-view-product-variant" showIf="id" />
	      			</panel>
	      			<panel name="childVariant" showIf="parentProduct" colSpan="12">
	        			<field name="productVariant" showTitle="false" canSelect="false">
			          		<editor x-show-titles="false">
					            <field name="productVariantAttr1" showTitle="false" readonly="true" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue1" showTitle="false" showIf="productVariantAttr1" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr2" showTitle="false" readonly="true" showIf="productVariantAttr1" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue2" showTitle="false" showIf="productVariantAttr2" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr3" showTitle="false" readonly="true" showIf="productVariantAttr2" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue3" showTitle="false" showIf="productVariantAttr3" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
					            <field name="productVariantAttr4" showTitle="false" readonly="true" showIf="productVariantAttr3" form-view="product-variant-attr-form" grid-view="product-variant-attr-grid"/>
					            <field name="productVariantValue4" showTitle="false" showIf="productVariantAttr4" widget="SuggestBox" form-view="product-variant-value-form" grid-view="product-variant-value-grid"/>
				          </editor>
	        			</field>
	        			<field name="parentProduct" canEdit="false" form-view="product-form" grid-view="product-grid"/>
	        			<panel-dashlet colSpan="12" action="action-product-view-other-product-variant" showIf="parentProduct" />
	      			</panel>
	      			<button name="updateProductsPrices" title="Update products prices" onClick="save,action-product-method-update-products-prices"/>
	    		</panel>
	    	<panel name="links" title="Links" if-module="axelor-stock" if="__config__.app.isApp('stock')" hideIf="isShippingCostsProduct">
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line-incoming-planned" showIf="id" />
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line-consumption-planned" showIf="id" />
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line" showIf="id" />
<!--  				<panel-dashlet action="action-product-view-supplier-requests-historical" colSpan="12" if-module="axelor-supplier-management"/> -->
<!--  				<panel-dashlet action="action-product-view-purchase-order-line-in-progress" colSpan="12" if-module="axelor-purchase"/> -->
<!--  				<panel-dashlet action="action-product-view-purchase-order-line-historical" colSpan="12" if-module="axelor-purchase"/> -->
				<panel-dashlet colSpan="12" action="action-product-view-stock-move-line-consumption-historical" showIf="id" />
	    	</panel>
	    	<panel name="packaging" title="Packaging" hideIf="isShippingCostsProduct">
	  			<panel name="weight" title="Weight" colSpan="6">
	  				<field name="weightUnit" canEdit="false" domain="self.unitTypeSelect = 1"/>
	  				<field name="grossWeight"/>
	  				<field name="netWeight"/>
	  			</panel>
			      <panel name="articleDimension" title="Article dimension" colSpan="6">
			        <field name="lengthUnit" canEdit="false" domain="self.unitTypeSelect = 2" />
			        <field name="length" readonlyIf="diameter > 0" onChange="action-product-record-calculate-volume-length"/>
			        <field name="width" readonlyIf="diameter > 0" onChange="action-product-record-calculate-volume-length"/>
			        <field name="height" onChange="action-product-record-calculate-volume-length, action-product-record-calculate-volume-diameter"/>
			        <field name="diameter" readonlyIf="length > 0 || width > 0" onChange="action-product-record-calculate-volume-diameter"/>
			        <field name="articleVolume" readonly="true"/>
			      </panel>
				  <field name="customsCodeNomenclature" canEdit="false" if-module="axelor-stock" if="__config__.app.isApp('stock')"/>
  			</panel>
  			<panel-related field="packLines" showIf="isPack" if="__config__.app.isApp('sale') &amp;&amp; __config__.app.getApp('sale').getProductPackMgt()" />
  		</panel-tabs>
  		<panel>
  			<field name="attrs" colSpan="12" />
  		</panel>
  		
  		<panel-mail>
    		<mail-messages />
    	</panel-mail>
	</form>    
	
	<cards name="product-cards" title="Product" model="com.axelor.apps.base.db.Product" width="25%" css="rect-image" orderBy="code,name">
	    <toolbar>
        	<button name="catalog" title="Catalog" onClick="action-print-product-catalog" icon="fa-book"/>
			<button name="checkDuplicate" title="Check Duplicate" onClick="action-general-check-duplicate-records"/>
	    </toolbar>
		<field name="picture" />
		<field name="fullName" />
		<field name="salePrice" x-scale="2" />
		<field name="saleCurrency.symbol" />
		<field name="productFamily" />
		<field name="productCategory" />
		<field name="internalDescription"/>
		<template><![CDATA[
		    <div class="span12"><strong>{{fullName}}</strong></div>
			<div>
			  <div class="span4 card-image">
			    <img ng-show="picture" ng-src="{{$image('picture', 'content')}}" />
			    <img ng-show="!picture" src="img/product-default.png" />
			  </div>
			  <div class="span8">
			    <span>{{$fmt('salePrice')}} {{saleCurrency.symbol}}<br/>
			    {{productFamily.name}}<br/>
			    {{productCategory.name}}</span>
			  </div>
			</div>
			<div class="span12" ng-bind-html="internalDescription"></div>
		]]>
		</template>
	</cards>
	
    <action-view name="action-product-view-create-production-order" title="Create production order (${ name })" model="com.axelor.apps.base.db.Wizard">
    	<view type="form" name="production-order-wizard-form"/>
    	<view-param name="popup" value="reload"/>
    	<view-param name="forceEdit" value="true"/> 
	    <view-param name="width" value="800" />
	    <view-param name="show-confirm" value="false" />
	    <view-param name="show-toolbar" value="false" />
   	  	<view-param name="popup-save" value="false"/>
    	<context name="_productId" expr="eval: id"/>
    </action-view>
    
    <action-group name="action-group-base-product-onnew">
   	 	<action name="action-product-attrs-scale-and-precision"/>
   	 	<action name="action-product-attrs-scale-and-precision-production"/>
		<action name="action-product-attrs-scale-and-precision-stock"/>
    	<action name="action-product-record-default-new"/>
    	<action name="action-product-record-sale-supply-select"/>
    	<action name="action-product-record-in-ati"/>
    	<action name="action-product-attrs-in-ati"/>
    	<action name="action-product-record-default-production"/>
    	<action name="action-product-attrs-readonly-unit"/>
    	<action name="action-product-attrs-readonly-sellable" if="__context__?._fromSale"/>
    	<action name="action-product-attrs-readonly-purchasable" if="__context__?._fromPurchase"/>
		<action name="action-product-attrs-set-cost-type-select"/>
    </action-group>
    
    <action-group name="action-group-base-product-producttype-onchange">
    	<action name="action-product-record-sale-supply-select"/>
    	<action name="action-product-validate-sale-supply-select"/>
    	<action name="action-product-attrs-title-sale-price"/>
    	<action name="action-product-record-product-sub-type-select"/>
    </action-group>
    
    <action-record name="action-product-record-product-sub-type-select" model="com.axelor.apps.base.db.Product">
    	<field name="productSubTypeSelect" expr="eval: null" if="productTypeSelect != 'storable'"/>
    </action-record>
    
    <action-group name="action-group-base-product-enddate-onchange">
    	<action name="action-product-validate-end-date"/>
    	<action name="action-product-method-reset-end-date"/>
    </action-group>
    
    <action-group name="action-group-product-onload">
    	<action name="action-product-attrs-readonly-unit"/>
        <action name="action-product-attrs-scale-and-precision"/>
        <action name="action-product-attrs-scale-and-precision-production"/>
		<action name="action-product-attrs-scale-and-precision-stock"/>
        <action name="action-product-attrs-title-sale-price"/>
        <action name="action-product-attrs-title-unit"/>
		<action name="action-product-attrs-in-ati"/>
        <action name="action-product-set-stock"/>
        <action name="action-product-set-total-variants"/>
        <action name="action-product-attrs-readonly-sellable" if="__context__?._fromSale"/>
        <action name="action-product-attrs-readonly-purchasable" if="__context__?._fromPurchase"/>
		<action name="action-product-method-supplier-catalog-coeff"/>
		<action name="action-product-attrs-cost-price-variant"/>
		<action name="save"/>
    </action-group>

	<action-group name="action-product-group-cost-type-select-onchange">
		<action name="action-product-attrs-update-cost-price"/>
		<action name="action-product-record-compute-sale-price"/>
	</action-group>

    <action-attrs name="action-product-attrs-readonly-unit" if-module="axelor-stock">
    	<attribute name="readonly" for="unit" expr="eval: __repo__(StockLocationLine).all().filter('self.product.id = ?1 AND (self.currentQty != 0 OR self.futureQty != 0)', id).fetch().size &gt; 0" if="id != null &amp;&amp; __config__.app.isApp('stock')"/>
    </action-attrs>
    
    <action-record name="action-product-record-in-ati" model="com.axelor.apps.base.db.Product">
    	<field name="inAti" expr="eval:__config__.app.getApp('base').getProductInAtiSelect() == 2 || __config__.app.getApp('base').getProductInAtiSelect() == 4"/>
    </action-record>
    
    <action-attrs name="action-product-attrs-in-ati">
    	<attribute name="hidden" for="inAti" expr=" eval: __config__.app.getApp('base').getProductInAtiSelect() == 1 || __config__.app.getApp('base').getProductInAtiSelect() == 2"/>
		<attribute if=" __config__.app.getApp('base').getProductInAtiSelect() == 1 || __config__.app.getApp('base').getProductInAtiSelect() == 2"
				   name="value" for="inAti" expr="eval: __config__.app.getApp('base').getProductInAtiSelect() == 2" />
    </action-attrs>

    <action-attrs name="action-product-attrs-scale-and-precision">
		<attribute name="scale" for="salePrice" expr="eval: __config__.app.getNbDecimalDigitForUnitPrice()"/>
		<attribute name="scale" for="purchasePrice" expr="eval: __config__.app.getNbDecimalDigitForUnitPrice()"/>
		<attribute name="scale" for="costPrice" expr="eval: __config__.app.getNbDecimalDigitForUnitPrice()"/>
	</action-attrs>

	<action-attrs name="action-product-attrs-set-cost-type-select">
		<attribute for="costTypeSelect" name="selection-in" expr="[1,2]"/>
        <attribute for="costTypeSelect" name="selection-in" expr="[1,2,3]" if="__config__.app.isApp('supplychain')"/>
		<attribute for="costTypeSelect" name="selection-in" expr="[1,2,3,4]" if="__config__.app.isApp('production')"/>
	</action-attrs>

	<action-attrs name="action-product-attrs-update-cost-price">
		<attribute for="costPrice" name="readonly" expr="eval: costTypeSelect != 1"/>
		<attribute for="costPrice" name="value" expr="eval: shippingCoef ? purchasePrice.multiply(shippingCoef) : purchasePrice" if="costTypeSelect == 2"/>
		<attribute for="costPrice" name="value" expr="eval: avgPrice" if="costTypeSelect == 3"/>
		<attribute for="costPrice" name="value" expr="eval: lastProductionPrice" if="costTypeSelect == 4"/>
	</action-attrs>

	<action-attrs name="action-product-attrs-cost-price-variant">
		<attribute for="costPrice" name="readonly" expr="eval: true"
				   if="parentProduct?.manageVariantPrice"/>
        <attribute for="costTypeSelect" name="hidden" expr="eval: true"
				   if="parentProduct?.manageVariantPrice"/>
	</action-attrs>

    <action-record name="action-product-record-default-new" model="com.axelor.apps.base.db.Product">
    	<field name="expense" expr="false"/>
    	<field name="productTypeSelect" expr="eval: _productTypeSelect"/>
    	<field name="procurementMethodSelect" expr="buy"/>
    	<field name="startDate" expr="eval:__config__.app.getTodayDate()" if="startDate == null"/>
    	<field name="salePrice" expr="0"/>
    	<field name="purchasePrice" expr="0"/>
    	<field name="saleCurrency" expr="eval: _activeCompany?.currency"/>
    	<field name="purchaseCurrency" expr="eval: _activeCompany?.currency"/>
    	<field name="managPriceCoef" expr="1"/>
    	<field name="isModel" expr="eval: _isModel"/>
    	<field name="isShippingCostsProduct" expr="eval: _isShippingCostsProduct"/>
    </action-record>
    
    <action-record name="action-product-record-sale-supply-select" model="com.axelor.apps.base.db.Product">
    	<field name="saleSupplySelect" expr="1" if="productTypeSelect == 'storable'"/>
    	<field name="saleSupplySelect" expr="3" if="productTypeSelect == 'service'"/>
    </action-record>
    
    <action-record name="action-product-record-compute-sale-price" model="com.axelor.apps.base.db.Product">
    	<field name="salePrice" expr="eval: managPriceCoef*costPrice"
			   if="costPrice != null &amp;&amp; managPriceCoef != null &amp;&amp; autoUpdateSalePrice"/>
    </action-record>
    
    <action-record name="action-product-set-total-variants" model="com.axelor.apps.base.db.Product">
    	<field name="$totalVariants" expr="eval:__repo__(Product).all().filter('self.parentProduct.id = ?',id).fetch().size"/>    
    </action-record>
	
	<action-record name="action-product-record-calculate-volume-diameter" model="com.axelor.apps.base.db.Product">
		<field name="articleVolume" if="diameter > 0.00" expr="eval: (((diameter/2)*(diameter/2))*Math.PI)*height"/>
	</action-record>
	
	<action-record name="action-product-record-calculate-volume-length" model="com.axelor.apps.base.db.Product">
		<field name="articleVolume" if="length > 0" expr="eval: length * width * height"/>
	</action-record>
    
    <action-validate name="action-product-validate-sale-supply-select">
   		<alert message="A product of type service can't be procured from stock." if="saleSupplySelect == 1 &amp;&amp; productTypeSelect == 'service'"/>
	</action-validate> 
	
	<action-method name="action-print-product-catalog" >
		<call class="com.axelor.apps.base.web.ProductController" method="printProductCatelog"/>
	</action-method>
	
	<action-method name="action-product-method-show-product-sheet" >
		<call class="com.axelor.apps.base.web.ProductController" method="printProductSheet"/>
	</action-method>
	
	<action-method name="action-product-method-generate-product-variant" >
		<call class="com.axelor.apps.base.web.ProductController" method="generateProductVariants"/>
	</action-method>
	
	<action-method name="action-product-method-update-products-prices" >
		<call class="com.axelor.apps.base.web.ProductController" method="updateProductsPrices"/>
	</action-method>
	
    <action-validate name="action-product-validate-end-date">
    	<alert message="The product pulled-off date must be greater than the launch date." if="endDate &lt; startDate"/>
    </action-validate>
    
    <action-record name="action-product-method-reset-end-date" model="com.axelor.apps.base.db.Product">
    	<field name="endDate" expr="eval:__config__.app.getTodayDate()" if="endDate &lt; startDate"/>
    </action-record>
    
    <action-view name="action-product-view-product-variant" title="Products variants"
		model="com.axelor.apps.base.db.Product">
		<view type="grid" name="product-product-variant-grid"/>
		<view type="form" name="product-form"/>
		<domain>self.parentProduct.id = :id</domain>
	</action-view>	
	
	<action-view name="action-product-view-other-product-variant" title="Other variants"
		model="com.axelor.apps.base.db.Product">
		<view type="grid" name="product-product-variant-grid"/>
		<view type="form" name="product-form"/>
		<domain>self.parentProduct.id = :parentId</domain>
		<context name="parentId" expr="eval: parentProduct?.id"/>
	</action-view>	
	
	<action-view name="action-product-view-total-variants" title="${fullName} variants"
		model="com.axelor.apps.base.db.Product">
		<view type="grid" name="product-product-variant-grid"/>
		<view type="form" name="product-form"/>
		<domain>self.parentProduct.id = :_id</domain>
	</action-view>	
	
	<action-view name="action-product-view-production-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"/>
		<domain>self.product.id = :id </domain>
	</action-view>	
	
	<action-attrs name="action-product-attrs-bill-of-material-domain">
		<attribute name="domain" for="defaultBillOfMaterial" expr="eval: &quot;(self.product.id = ${parentProduct?.id} OR self.product.id = ${id}) AND self.defineSubBillOfMaterial = false&quot;"/>
	</action-attrs>
	
	<action-attrs name="action-product-attrs-readonly-create-production-order">
		<attribute name="readonly" for="createProductionOrder" expr="eval: __repo__(BillOfMaterial).all().filter('(self.product.id = ?1 OR self.product.id = ?2) AND self.defineSubBillOfMaterial = false', parentProduct?.id, id).fetch().isEmpty()"/>
	</action-attrs>
	
	<action-attrs name="action-product-attrs-title-sale-price">
		<attribute name="title" for="salePrice" expr="eval: com.axelor.i18n.I18n.get('Sale Price (for periodicity selected)')" if="productTypeSelect == 'subscriptable'"/>
		<attribute name="title" for="salePrice" expr="eval: com.axelor.i18n.I18n.get('Sale price')" if="productTypeSelect != 'subscriptable'"/>
	</action-attrs>

    <action-attrs name="action-product-attrs-title-unit" if-module="axelor-stock">
        <attribute name="title" for="unit" expr="eval: com.axelor.i18n.I18n.get('Unit')"/>
        <attribute name="title" for="unit" expr="eval: com.axelor.i18n.I18n.get('Stock Unit')" if="__config__.app.getApp('sale').getManageSalesUnits()"/>
        <attribute name="title" for="unit" expr="eval: com.axelor.i18n.I18n.get('Stock Unit')" if="__config__.app.getApp('purchase').getManagePurchasesUnits()"/>
    </action-attrs>
	
    <search-filters name="products-filters" model="com.axelor.apps.base.db.Product" title="Products filters">
		<filter title="Current Products">
			<domain>self.endDate IS NULL or CURRENT_DATE &lt; self.endDate</domain>
		</filter>
		<filter title="Storable Products">
			<domain>(self.endDate IS NULL or CURRENT_DATE &lt; self.endDate) and self.productTypeSelect = 'storable'</domain>
		</filter>
		<filter title="Service Products">
			<domain>(self.endDate IS NULL or CURRENT_DATE &lt; self.endDate) and self.productTypeSelect = 'service'</domain>
		</filter>
		<filter title="Products With Variant">
			<domain>self.productVariantConfig != null</domain>
		</filter>
		<filter title="Define sub bill of material">
			<domain>self.subTypeProductSelect = 3</domain>
		</filter>
		<filter title="Obsolete Products">
			<domain>CURRENT_DATE &gt; self.endDate</domain>
		</filter>
	</search-filters>
	
	
	<action-view name="action-product-view-show-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.product.id = :productId AND self.defineSubBillOfMaterial = 'false'</domain>
		<context name="productId" expr="eval: id"/>
	</action-view>
	
</object-views>

{'fraction_non_alphanumeric': 0.17586436641481082, 'fraction_numerical': 0.008703911089689976, 'mean_word_length': 4.358857490124582, 'pattern_counts': {'":': 0, '<': 967, '<?xml version=': 2, '>': 979, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7051918', 'n_tokens_mistral': 24101, 'n_tokens_neox': 22063, 'n_words': 3313}