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

On sale.order object for example, on the defaults dictionnary, We can see : 

default = {

'state': draft

}

I want to do it but dynamicaly, for that, I should use a method defined before columns dictionnary. So, let's say my method is called _get_default_state. The main reason why I decided to create this function, is that i have two views for the same object, and I want that for every view, a different default state is loaded when trying to create a record. So, the two views will no longer share the same default state.

So, the function will be like that : 

IF actual_view_id == ref1 : 

  return draft_quotation

ELIF actual_view_id == ref2:

 return draft

The problem is I don't know how to get the actual view reference, and pass it to the method.

Is there any other way to perform this kind of need ?

 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 15
4084
3
มี.ค. 15
11014
1
มี.ค. 15
9114
0
มี.ค. 15
3579
Default values for Users แก้ไขแล้ว
1
ก.พ. 24
13741