From ea5a81e67a8ee2562b8f5ddfd6ba9b990405b2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 18 Oct 2017 14:59:57 +0200 Subject: [PATCH] Limit agent field on sale and invoice to the type 'agent' issue6845 review40751003 --- invoice.py | 1 + sale.py | 1 + 2 files changed, 2 insertions(+) diff --git a/invoice.py b/invoice.py index c5577cd5dc..aec9f31124 100644 --- a/invoice.py +++ b/invoice.py @@ -17,6 +17,7 @@ class Invoice: __name__ = 'account.invoice' agent = fields.Many2One('commission.agent', 'Commission Agent', domain=[ + ('type_', '=', 'agent'), ('company', '=', Eval('company', -1)), ], states={ diff --git a/sale.py b/sale.py index 162c464428..b3a5609308 100644 --- a/sale.py +++ b/sale.py @@ -15,6 +15,7 @@ class Sale: __name__ = 'sale.sale' agent = fields.Many2One('commission.agent', 'Commission Agent', domain=[ + ('type_', '=', 'agent'), ('company', '=', Eval('company', -1)), ], states={