Skip to Content
Menu
This question has been flagged
1 Reply
2806 Views

I would like to ovewrite `partner_shipping_id` field in `sale.order` to only display contacs from `res.partner` that match `partner_id`. Currently shows all existing contacts, so I would like to change this behavior.



This is what I tried:



```python

partner_shipping_id = fields.Many2one(

'res.partner',

string='Delivery Address',

readonly=True,

required=True,

states={

'draft': [('readonly', False)],

'sent': [('readonly', False)],

'sale': [('readonly', False)]},

domain="[('child_ids.parent_id','=', partner_id)]"

# domain=

# "['|', ('company_id', '=', False), ('company_id', '=', company_id)]",

)



```



But this only returns the same selected record in `parnter_id` field.

Avatar
Discard
Best Answer

Hi,

Try this domain:  domain="[('parent_id', '=', partner_id)]"

Thanks

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
1482
1
Nov 24
1187
2
Sep 24
1046
1
Aug 24
2450
3
Aug 24
2682