<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.1.xsd">
    
    <grid name="stock-rules-grid" title="Stock rules" model="com.axelor.apps.stock.db.StockRules" orderBy="stockLocation.name,product.code,useCaseSelect">
        <toolbar>
        <button name="checkDuplicateBtn" title="Check Duplicate" onClick="action-base-method-show-duplicate"/>
        </toolbar>
        <field name="stockLocation" form-view="stock-location-form" grid-view="stock-location-grid"/>
        <field name="product.code" width="120" title="Product code" form-view="product-form" grid-view="product-grid"/>
        <field name="product.name" title="Product name" form-view="product-form" grid-view="product-grid"/>
        <field name="minQty" aggregate="min"/>
        <field name="idealQty" aggregate="min"/>
        <field name="maxQty" aggregate="min"/>
        <field name="reOrderQty" aggregate="sum"/>
		<field name="useCaseSelect"/>
        <field name="typeSelect"/>
        <field name="orderAlertSelect"/>
    </grid>

    <form name="stock-rules-form" title="Stock rules" model="com.axelor.apps.stock.db.StockRules"
	onNew="action-stock-rules-record-new" width="large">
    	<panel name="mainPanel" >
	        <field name="stockLocation" form-view="stock-location-form" grid-view="stock-location-grid" canEdit="false" onChange="action-stock-rules-record-set-stock-rule-message-template"/>
			<field name="useCaseSelect" colSpan="3" onChange="action-stock-rules-record-useCaseSelect-change"/>
			<field name="typeSelect" colSpan="3" showIf="useCaseSelect == 2" requiredIf="useCaseSelect == 2"/>
	        <field name="product" canEdit="false" domain="self.productTypeSelect = 'storable' and self.stockManaged = true " onChange="action-stock-rules-record-product-change" form-view="product-form" grid-view="product-grid"/>
			<field name="orderAlertSelect" selection-in="[1 * (useCaseSelect != 1), 2 * (product.procurementMethodSelect != 'produce'), 3 * (product.procurementMethodSelect != 'buy')]" colSpan="3"/>
			<field name="stockRuleMessageTemplate" colSpan="3"/>
			<field name="product.procurementMethodSelect" hidden="true"/>
	        <field name="minQty" onChange="action-stock-rules-minqty-change"
	        	validIf="$number(minQty) >= 0" colSpan="2"/>
	        <panel colSpan="4" name="idealQtyPanel">
	        	<field name="useIdealQty" />
				<field name="idealQty" showIf="useIdealQty" onChange="action-stock-rules-idealqty-change"
					validIf="!useIdealQty &amp;&amp; $number(idealQty) == 0 || $number(idealQty) >= $number(minQty) &amp;&amp; (!useMaxQty || $number(idealQty) &lt;= $number(maxQty))" />
			</panel>
			<panel colSpan="6" name="maxQtyPanel">
				<field name="useMaxQty" />
				<field name="maxQty" showIf="useMaxQty" onChange="action-stock-rules-maxqty-change"
					validIf="!useMaxQty &amp;&amp; $number(maxQty) == 0 || $number(maxQty) >= $number(minQty)" />
			</panel>
			<field name="reOrderQty" colSpan="2" validIf="$number(reOrderQty) >= 0" />
        </panel>
		<panel name="reorderingManagedByPanel" title="Reordering managed by"  showIf="orderAlertSelect == 1">
			<field name="user" canNew="false" canEdit="false" canView="false" form-view="user-form" grid-view="user-grid"/>
	        <field name="team" canEdit="false" form-view="team-form" grid-view="team-grid"/>
		</panel>
		
		<panel-mail name="mailPanel">
	    	<mail-messages limit="4"/>
	    	<mail-followers/>
	  	</panel-mail><commit_msg>Feature #19544 STOCK RULE : message template<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.1.xsd">
    
    <grid name="stock-rules-grid" title="Stock rules" model="com.axelor.apps.stock.db.StockRules" orderBy="stockLocation.name,product.code,useCaseSelect">
        <toolbar>
        <button name="checkDuplicateBtn" title="Check Duplicate" onClick="action-base-method-show-duplicate"/>
        </toolbar>
        <field name="stockLocation" form-view="stock-location-form" grid-view="stock-location-grid"/>
        <field name="product.code" width="120" title="Product code" form-view="product-form" grid-view="product-grid"/>
        <field name="product.name" title="Product name" form-view="product-form" grid-view="product-grid"/>
        <field name="minQty" aggregate="min"/>
        <field name="idealQty" aggregate="min"/>
        <field name="maxQty" aggregate="min"/>
        <field name="reOrderQty" aggregate="sum"/>
		<field name="useCaseSelect"/>
        <field name="typeSelect"/>
        <field name="orderAlertSelect"/>
    </grid>

    <form name="stock-rules-form" title="Stock rules" model="com.axelor.apps.stock.db.StockRules"
	onNew="action-stock-rules-record-new" width="large">
    	<panel name="mainPanel" >
	        <field name="stockLocation" form-view="stock-location-form" grid-view="stock-location-grid" canEdit="false" onChange="action-stock-rules-record-set-stock-rule-message-template"/>
			<field name="useCaseSelect" colSpan="3" onChange="action-stock-rules-record-useCaseSelect-change"/>
			<field name="typeSelect" colSpan="3" showIf="useCaseSelect == 2" requiredIf="useCaseSelect == 2"/>
	        <field name="product" canEdit="false" domain="self.productTypeSelect = 'storable' and self.stockManaged = true " onChange="action-stock-rules-record-product-change" form-view="product-form" grid-view="product-grid"/>
			<field name="orderAlertSelect" selection-in="[1 * (useCaseSelect != 1), 2 * (product.procurementMethodSelect != 'produce'), 3 * (product.procurementMethodSelect != 'buy')]" colSpan="3"/>
			<field name="stockRuleMessageTemplate" colSpan="3" showIf="useCaseSelect == 2 &amp;&amp; orderAlertSelect == 1"/>
			<field name="product.procurementMethodSelect" hidden="true"/>
	        <field name="minQty" onChange="action-stock-rules-minqty-change"
	        	validIf="$number(minQty) >= 0" colSpan="2"/>
	        <panel colSpan="4" name="idealQtyPanel">
	        	<field name="useIdealQty" />
				<field name="idealQty" showIf="useIdealQty" onChange="action-stock-rules-idealqty-change"
					validIf="!useIdealQty &amp;&amp; $number(idealQty) == 0 || $number(idealQty) >= $number(minQty) &amp;&amp; (!useMaxQty || $number(idealQty) &lt;= $number(maxQty))" />
			</panel>
			<panel colSpan="6" name="maxQtyPanel">
				<field name="useMaxQty" />
				<field name="maxQty" showIf="useMaxQty" onChange="action-stock-rules-maxqty-change"
					validIf="!useMaxQty &amp;&amp; $number(maxQty) == 0 || $number(maxQty) >= $number(minQty)" />
			</panel>
			<field name="reOrderQty" colSpan="2" validIf="$number(reOrderQty) >= 0" />
        </panel>
		<panel name="reorderingManagedByPanel" title="Reordering managed by"  showIf="orderAlertSelect == 1">
			<field name="user" canNew="false" canEdit="false" canView="false" form-view="user-form" grid-view="user-grid"/>
	        <field name="team" canEdit="false" form-view="team-form" grid-view="team-grid"/>
		</panel>
		
		<panel-mail name="mailPanel">
	    	<mail-messages limit="4"/>
	    	<mail-followers/>
	  	</panel-mail>
{'fraction_non_alphanumeric': 0.18471252015045675, 'fraction_numerical': 0.009806555615260613, 'mean_word_length': 4.606174698795181, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 2, '>': 101, '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': '1883674', 'n_tokens_mistral': 2623, 'n_tokens_neox': 2436, 'n_words': 385}