콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4821 화면


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
아바타
취소
관련 게시물 답글 화면 활동
1
1월 18
8565
1
5월 25
6148
1
11월 24
1803
1
3월 23
1994
1
3월 21
3571