From 3a4c8526b2b2f09f1fdd3e42c5b6d51cc9cc50ef Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Tue, 31 Mar 2020 15:04:15 -0400 Subject: [PATCH] meta_entity: Not required for Equity accounts. --- conservancy_beancount/plugin/meta_entity.py | 2 +- tests/test_meta_entity.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/conservancy_beancount/plugin/meta_entity.py b/conservancy_beancount/plugin/meta_entity.py index 93fb67c..4096a65 100644 --- a/conservancy_beancount/plugin/meta_entity.py +++ b/conservancy_beancount/plugin/meta_entity.py @@ -39,7 +39,7 @@ class MetaEntity(core.TransactionHook): if txn_entity_ok is False: yield errormod.InvalidMetadataError(txn, self.METADATA_KEY, txn_entity) for post in data.iter_postings(txn): - if post.account.is_under('Assets', 'Liabilities'): + if post.account.is_under('Assets', 'Equity', 'Liabilities'): continue entity = post.meta.get(self.METADATA_KEY) if entity is None: diff --git a/tests/test_meta_entity.py b/tests/test_meta_entity.py index 3a0c6c1..0b75595 100644 --- a/tests/test_meta_entity.py +++ b/tests/test_meta_entity.py @@ -84,6 +84,7 @@ def test_invalid_values_on_transactions(hook, src_value): @pytest.mark.parametrize('account,required', [ ('Accrued:AccountsReceivable', True), ('Assets:Cash', False), + ('Equity:OpeningBalances', False), ('Expenses:General', True), ('Income:Donations', True), ('Liabilities:CreditCard', False),