From 3e13df14c8f75d8ad6244cbdd04b24f2519d64a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Wed, 8 Jun 2022 19:00:08 +0200 Subject: [PATCH] [FIX]pms: check mens move folio_ids in post mens validation error --- pms/models/account_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pms/models/account_move.py b/pms/models/account_move.py index f2cedc439..b438ccdea 100644 --- a/pms/models/account_move.py +++ b/pms/models/account_move.py @@ -349,6 +349,7 @@ class AccountMove(models.Model): "The total amount of the simplified invoice is higher than the " "maximum amount allowed for simplified invoices." ) - self.folio_ids.message_post(body=mens) + if self.folio_ids: + self.folio_ids.message_post(body=mens) raise ValidationError(mens) return True