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

hello,

I need to get current ID or active_id for sales order form in fields_view_get fonction, when click in form. any idea ??? Thks

아바타
취소
베스트 답변

Hi,

in python use context as :

id_you_want = context.get('active_id', False) => return id or False

but the form should be saved at leat one time to create id.

to give id of the sale order form to sale order line tree one2many :

in sale order line do :

in xml : ....

<notebook>
<page string="Order Lines">
    <field name="order_line" context="{'order_id': active_id}">
        <form string="Sales Order Lines" version="7.0">
            <field name="order_id">

....

in python :

to get order id as default value, add this in python class sale order line :

_defaults = {
   'order_id': lambda self, cr, uid, context: context.get('order_id', False),}

each time you will click on create button in sale order line, order_id will have id of its parent form.

Bye

아바타
취소
베스트 답변

Hi,

You can't go with fields_view_get function for particular record_id, because fields_view_get will not be called if you navigate through one Sale order form to another.

아바타
취소
관련 게시물 답글 화면 활동
2
3월 15
6732
12
12월 23
44119
0
3월 15
4924
0
3월 15
3433
1
3월 15
4241