Skip to Content
Menu
This question has been flagged
2 Replies
4179 Views

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


 

Avatar
Discard
Author Best Answer

Works. Thanks a lot

Avatar
Discard
Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 21
1384
1
Nov 21
1056
0
Aug 17
2190
0
Mar 15
2408
1
Mar 15
8184