From f89ec497ba4eb513accc87bb5bbd8f03ce0460bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 21 Oct 2023 13:08:50 +0200 Subject: [PATCH] Deduce from credit amount only sales from the user's company Since #4080 the record rules are no more enforced on getter of Function fields. Closes #12586 (grafted from 27f9dfa253e48fd885ea54d5b983186d7e829583) --HG-- branch : 6.0 --- modules/sale_credit_limit/party.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/sale_credit_limit/party.py b/modules/sale_credit_limit/party.py index ea1a823053..0b5b8f0d79 100644 --- a/modules/sale_credit_limit/party.py +++ b/modules/sale_credit_limit/party.py @@ -25,6 +25,7 @@ class Party(metaclass=PoolMeta): currency = user.company.currency sales = Sale.search([ + ('company', '=', user.company.id), ('party', 'in', [p.id for p in parties]), ('state', 'in', ['confirmed', 'processing']), ])