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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
2806
Views
Hi,
Try this domain: domain="[('parent_id', '=', partner_id)]"
Thanks
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Nov 24
|
1482 | ||
|
1
Nov 24
|
1187 | ||
|
2
Sep 24
|
1046 | ||
Update stock quantity
Solved
|
|
1
Aug 24
|
2450 | |
|
3
Aug 24
|
2682 |