跳至內容
選單
此問題已被標幟
2 回覆
5614 瀏覽次數

Hello,

i've added a few new fields in res.partner. If i create a new s.o. i need from res.partner this fields as default value in sale.order. How can i pass it? it must be changeble in sales.order.

x_so_field1 = fields.Boolean(
string="Field1",
default='self.partner_id.x_field1',
)

does not work. Thanks for your help


 

頭像
捨棄
作者 最佳答案

Works. Thanks a lot

頭像
捨棄
最佳答案

Using default is not correct in this case. Use function/decorator onchange, like this:

@api.onchange('partner_id')
def onchange_partner_id(self):

     self.x_so_field1= self.partner_id.x_field1

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
11月 21
2664
1
11月 21
2324
0
8月 17
3516
0
3月 15
3284
1
3月 15
9075