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

When doing a new receipt, I create new Lot/serial numbers. I would like to copy the Origin field from stock.move model to the wizard that opens, when you press Create and Edit (new Lot number), so that each of Lot/Serial numbers would have an associated Source Document.

Basically I want to pass info from stock.move(origin) -> stock.move.line (Lot/serial) -> stock.production.lot (x_newField)

What would be the best approach for this?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I am trying to create a new class in this way now:

classx_move(models.Model):
_inherit = ["stock.move", "stock.production.lot", "stock.move.line"]
    
    @api.onchange('lot_name', 'lot_id')
    def onchange_copyToLot(self):


I would like to

1. On change of lot_name in stock.move.line get the lot_name

2. Get the Origin field from stock.move

3. Copy Origin to a custom field x_origin in stock.production.lot (for the specific lot_name I got it Step 1)

Let me know if this would be the best way to achieve what I want to do?

Also is this how I would for example get the lot_name in this class?

self.env['stock.move.line'].lot_name
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ย. 21
5973
1
ก.ค. 24
2428
Transfer Between Warehouse แก้ไขแล้ว
6
พ.ค. 24
21936
1
ธ.ค. 22
6263
3
มี.ค. 16
6895