From 589ff16401cd97f6a5bcc89c0afbdf4f3223deaa Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Wed, 29 Apr 2026 19:20:01 +0200 Subject: [PATCH] From To filter domain --- modules/purchase_trade/lot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/purchase_trade/lot.py b/modules/purchase_trade/lot.py index 61179b7..4d00b54 100755 --- a/modules/purchase_trade/lot.py +++ b/modules/purchase_trade/lot.py @@ -3343,8 +3343,12 @@ class ContractDetail(ModelView): ], 'Price type', required=True) currency_unit = fields.Selection('get_currency_unit',string="Curr/Unit") reference = fields.Char("Reference") - from_location = fields.Many2One('stock.location',"From location") - to_location = fields.Many2One('stock.location',"To location") + from_location = fields.Many2One( + 'stock.location', "From location", + domain=[('type', 'in', ['storage', 'supplier'])]) + to_location = fields.Many2One( + 'stock.location', "To location", + domain=[('type', 'in', ['storage', 'customer'])]) payment_term = fields.Many2One('account.invoice.payment_term',"Payment Term", required=True) @classmethod