Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
511 Tampilan

I’m using Odoo 15 and I’d like to create a Server Action that allows me to select multiple Delivery Orders (Stock Pickings) from the list view and validate them all at once, regardless of their current state.

Avatar
Buang
Jawaban Terbai

Hi,

Steps:

1. Settings->Technical->Actions->Server Action

2. Model: Transfer

Type: Execute Code

code:

for rec in records:

  if rec['state'] not in ('done', 'cancel'):

    rec.button_validate()



Hope it helps.

Avatar
Buang
Jawaban Terbai

To create a Server Action in Odoo 15 for validating multiple Delivery Orders, follow these steps:



  Navigate to Settings > Technical > Actions > Server Actions.

  Create a new Server Action with the model set to "Stock Picking".

  In the Python Code section, use:
    for picking in records:
      if picking.state not in ('done', 'cancel'):
        picking.button_validate()

  Save the action and link it to the appropriate menu or button.


If you'd like to explore this further for your use case, you're welcome to connect with us at Pragmatic Techsoft.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Nov 24
1514
0
Nov 24
1655
1
Feb 24
1737
1
Okt 16
4899
1
Jun 24
2504