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

in stock.move form , when create stock.move i want field date to set default base on date in stock.picking.

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

Let say the date field in stock.move is date_move and date field in stock.picking is date_picking . The field move_lines is a one2many from picking to stock move. So where ever the move_lines fields is using in the view add an attribute - context - to the view. For example

<field name="move_lines"  context="{'default_date_move':parent.date_picking}"/>

This will automatically select the date specified in the date_picking field to date_move when adding new stock moves.The problem is after adding the stock moves if anyone changes the date in date_picking it will not effect on the moves that are already added.

อวตาร
ละทิ้ง