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

I have a custom module that marks pickings to done. On pickings with more multiple lines, I'm getting extra stock moves that have "Extra Move" in the description. If I have two lines on a picking, I'll get the correct stock move for each line, plus one "Extra Move" for each line. If I have three line on a picking, I'll get the correct stock move for each line, plus TWO "Extra Move"s for each line.
I don't understand what an "Extra Move" is or what it's use case is. I also don't know if this is a bug in my module, or elsewhere.
My code is as follows;

Sorry about he formatting, but the forums screws with every attempt to paste and format the code.

# Get the stock picking that the row refers totock_picking = (self.env["stock.picking"].search([("name", "=", stock_picking_ref)]))# Insert a new request record and retrive a reference to it request_id = self.env["integration.request"].create({'request_type':self.id,'reference':stock_picking.name,'name':stock_picking.name,'stock_pick':stock_picking.id,'state':'In Progress'})# Ensure we don't mess with pickings already doneif stock_picking.state == 'assigned':
    # Update stock picking with carrier and tracking information    stock_picking.write({'carrier_tracking_ref': tracking_no,'shipped_date': date,'shipped_weight': weight,'shipped_cost': carriage_cost})    for pack in stock_picking.pack_operation_ids:
        if pack.product_qty > 0:
            # Set transfered quantities to transfer all            pack.write({'qty_done': pack.product_qty})            self.env["integration.request_item"].create({'request':request_id.id, 'product':pack.product_id.id, 'quantity':pack.product_qty})    else:
        pack.unlink()    stock_picking.do_transfer()

อวตาร
ละทิ้ง
ผู้เขียน

Please ignore this post. The problem was in my custom module with the do_transfer() being called for each picking item rather than each picking.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 21
6998
Stock picking removes sale orders link แก้ไขแล้ว
2
ก.พ. 24
3939
1
เม.ย. 23
2610
1
มิ.ย. 22
3332
0
พ.ย. 17
3594