콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
5147 화면

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 

아바타
취소
작성자

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

베스트 답변

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 :)

아바타
취소
베스트 답변

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!

아바타
취소
베스트 답변

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.

아바타
취소
작성자

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 !

관련 게시물 답글 화면 활동
1
12월 23
1906
1
11월 20
2827
2
6월 19
4876
4
3월 15
6998
0
9월 25
338