Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
183 มุมมอง

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ย. 24
1331
0
พ.ย. 24
1395
1
ก.พ. 24
1619
1
ต.ค. 16
4788
1
มิ.ย. 24
2336