<?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">
	
	<action-group name="action-sale-group-generate-sale-order">
		<action name="action-sale-validate-create-client" if="partner == null"/>
		<action name="save"/>
		<action name="action-sale-method-create-client" if="partner == null"/>
		<action name="action-sale-method-generate-sale-order"/>
	</action-group>
	
	<action-validate name="action-sale-validate-create-client">
		<alert message="No client selected, a new one will be created from the lead, do you agree?" if="lead"/>
		<error message="Please select a customer to be able to convert opportunity into quotation." if="!lead"/>
	</action-validate>
	
	<action-method name="action-sale-method-create-client">
		<call class="com.axelor.apps.crm.web.OpportunityController" method="createClient"/>
	</action-method>
	
	<action-method name="action-sale-method-generate-sale-order">
		<call class="com.axelor.apps.sale.web.OpportunitySaleOrderController" method="generateSaleOrder"/>
	</action-method>
	
	<action-method name="action-opportunity-method-cancel-saleorders">
    	<call class="com.axelor.apps.sale.web.OpportunitySaleOrderController" method="cancelSaleOrders"/>
    </action-method>
	
</object-views>	