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


Hi,

I want to alter the functionality of sale order form, what I want to do is whenever a new sale order is to be create the one2many order_lines treeview should contains some default field rows as shown in linked figure, which are then inserted into the relation model on save.

https://drive.google.com/file/d/0BwpBdLTvPsQtWkJPdUN0YjVPZjQ/view?usp=sharing

 

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

I came across to handle this by inheriting default_get method of the sale order that contains the one2many order_lines field in which I return the values to this field

def default_get(self, cr, uid, fields_list, context=None):
res = super(sale_order, self).default_get(cr, uid, fields_list, context)
res['order_lines'] = (0, 0, { 'here_the_field_name_of_order_lines_comodel': 'values_goes_here' })
return res
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 18
8572
1
พ.ค. 25
6170
Sales Order From Excel Sheets แก้ไขแล้ว
1
พ.ย. 24
1813
1
มี.ค. 23
2012
1
มี.ค. 21
3580