meta_project: Not required on Equity accounts.

This commit is contained in:
Brett Smith 2020-04-01 11:10:14 -04:00
parent 3a4c8526b2
commit 90a58ef112
2 changed files with 2 additions and 1 deletions

View file

@ -79,7 +79,7 @@ class MetaProject(core._NormalizePostingMetadataHook):
)
def _run_on_post(self, txn: Transaction, post: data.Posting) -> bool:
return post.account.is_under('Assets', 'Liabilities') is None
return post.account.is_under('Assets', 'Equity', 'Liabilities') is None
def _default_value(self, txn: Transaction, post: data.Posting) -> MetaValueEnum:
if post.account.is_under(

View file

@ -88,6 +88,7 @@ def test_invalid_values_on_transactions(hook, src_value):
@pytest.mark.parametrize('account,required', [
('Accrued:AccountsReceivable', True),
('Assets:Cash', False),
('Equity:Opening-Balances', False),
('Expenses:General', True),
('Income:Donations', True),
('Liabilities:CreditCard', False),