Skip to Content
Menu
This question has been flagged
3 Replies
4033 Rodiniai

Hi everyone !

I want to create an action server which will transform all Quotations records to Sales order instead of Confirm each quotations to sales order.

Can ayone help me ? Thanks 

Portretas
Atmesti
Autorius

Thanks a lot ! it's worked. But i have another problem.
I want to make domain on this field to show only the records related to him.


Gimage0

Gestion congés is many2one field. so i want to show in this field records concerned only the employe

Thanks in advance !

i use odoo online, and odoo studio

Best Answer

Hi,

<record id="action_confirm_order" model="ir.actions.server">
 
    <field name="name">Confirm Orders</field>
      <field name="model_id" ref="sale.model_sale_order"/>
      <field name="state">code</field>
      <field name="binding_view_types">list</field>
      <field name="code">
for record in records:
  record.action_confirm()
      </field>


</record>

or you can create server action by going to Settings--> Technical--> Server Actions


Hope it will help you :)

Portretas
Atmesti
Best Answer

Thank you this also helped me a lot.

Now I can import my sales and bulk confirm quotations to sales orders and then bulk complete delivery orders etc. Thanks!

Portretas
Atmesti
Best Answer

Yes, I can assist you with that. Do the following steps you may take to construct an action server that will convert all Quotation data into Sales orders:

  1. Specify the action: Begin by identifying the action you wish to do. You wish to convert all Quotation records into Sales orders in this situation. Give your action a name and a description to make it easier to recognize afterwards.
  2. Define the trigger: The trigger that will activate the action server must be defined next. In this scenario, you want the action to be triggered whenever a Quotation record is created or changed. This trigger may be defined using an onchange or oncreate function.
  3. Create the following code: It is now time to develop the code to convert the Quotation data into Sales orders. As a starting point, here's some sample code:
    @api.model
    def create(self, vals):
    res = super(SaleOrder, self).create(vals)
    if res.state == 'draft' and res.is_quotation:
    res.action_confirm()
    return res
  4. Test the code: Before deploying your action server, you should test the code to ensure it works as planned. Create a new Quotation record and update it to test if it is immediately converted into a Sales Order.
  5. Deploy the action server: Finally, you may put your action server into production. Check it again to ensure that everything is operating properly.

That's all! Following these steps, you should be able to establish an action server that will change all Quotation records into Sales orders automatically. Please let me know if you have any queries or require any other support.

Portretas
Atmesti
Autorius

Thanks for your assistance but @Sahar Dagher replied to me before.
Can i have your whatsApp number for anothers problem ? am a newer in Odoo
+225 05 45 14 53 91.
Thanks a lot !

Related Posts Replies Rodiniai Veikla
1
gruod. 23
1279
1
lapkr. 20
2391
2
birž. 19
4299
4
kov. 15
6358
4
birž. 25
1301