meta_entity: Not required for Equity accounts.
This commit is contained in:
parent
3aee1efdc1
commit
3a4c8526b2
2 changed files with 2 additions and 1 deletions
|
@ -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:
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue