This question has been flagged
1 Reply
1787 Views

Add the pending status so that it could authorize the sale in sale.order,just that when I click on the button to change the pending status change me of quotation to sales order and buttons disappear confirming order and print.

And my status must be before the sale is confirmed and look at sales order.

How could resolve this?

Avatar
Discard
Best Answer

Hi,

     You can control it by adding domain in action of Sale Order. Since there is already action defined for Sale Order and they are already using domain to block draft quotation from Sale Order, we have to use inheritance that to suit our need.

Here is the action defined for sale order:-

<record id="action_orders" model="ir.actions.act_window">
 <field name="name">Sales Orders</field>
 <field name="type">ir.actions.act_window</field>
 <field name="res_model">sale.order</field>
 <field name="view_type">form</field>
 <field name="view_mode">tree,form,calendar,graph</field>
 <field name="search_view_id" ref="view_sales_order_filter"/>
 <field name="context">{'search_default_my_sale_orders_filter': 1}</field>
 <field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
 <field name="help" type="html">
 <p class="oe_view_nocontent_create">
            Click to create a quotation that can be converted into a sales order.
</p><p>Odoo will help you efficiently handle the complete sales flow:
quotation, sales order, delivery, invoicing and payment.
</p>
 </field>
 </record>


 modify this line:-

<field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>

Let test be the custom state, we have to add that to domain like this-

<field name="domain">[('state', 'not in', ('draft','test', 'sent', 'cancel'))]</field>


    Now you won't see records in that sate in Sale Order.


Hope this helps.




Avatar
Discard