Changeset - 90a58ef11258
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-04-01 15:10:14
brettcsmith@brettcsmith.org
meta_project: Not required on Equity accounts.
2 files changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/plugin/meta_project.py
Show inline comments
...
 
@@ -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(
tests/test_meta_project.py
Show inline comments
...
 
@@ -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),
0 comments (0 inline, 0 general)