Support mobile document uploads
This adds support for mobile document uploads by exposing a file input in the postings section. This allows for easy upload of documents for a specific transaction and account.
I considered adding a file input to the Context dialog, but that proved to be a dead-end since the entry hash changes on file upload. In order to support that, there would either need to be a way to re-calculate the hash after file upload and then reload the context dialog without disturbing unsaved changes, or a way to send the file upload and changes to the transactions in a single atomic PUT request. Those are both possible, but probably not worth the effort.
This alternative implementation has a bit better UX in my opinion, as it allows to easily associate a document with an account simply by clicking the file upload button next to the posting entry.
closes https://github.com/beancount/fava/issues/979
The development doc is either incomplete or out-of-date, so i'll need some assistance getting the build to pass here.
Is fava still maintained? Just wondering if it is best to fork to keep this project alive.
Is fava still maintained?
It is, as might also be evident from the recent commits and release. It's an open-source project, don't expect to daily responses...
Is fava still maintained?
It is, as might also be evident from the recent commits and release. It's an open-source project, don't expect to daily responses...
Thanks for confirming. I have some experience maintaining open source projects, so I don’t expect daily responses, but was concerned after more than 3 weeks without a response.
The development doc is either incomplete or out-of-date, so i'll need some assistance getting the build to pass here.
What exactly doesn't work for you? Use make lint and make test to run the the linters / tests respectively
The development doc is either incomplete or out-of-date, so i'll need some assistance getting the build to pass here.
What exactly doesn't work for you? Use
make lintandmake testto run the the linters / tests respectively
i'm seeing an error on make lint:
pre-commit run -a
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Initializing environment for local:[email protected],[email protected],[email protected].
[INFO] Initializing environment for local:[email protected],[email protected],[email protected],[email protected].
[INFO] Initializing environment for local.
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for local.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12', '-mnodeenv', '--prebuilt', '--clean-src', '/Users/ray3/.cache/pre-commit/repoyzy_d7wu/node_env-default')
return code: 1
stdout: (none)
stderr:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1344, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1336, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1382, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1331, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1091, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1035, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1477, in connect
self.sock = self._context.wrap_socket(self.sock,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 455, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1041, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1319, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/nodeenv.py", line 1548, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/nodeenv.py", line 1119, in main
args.node = get_last_stable_node_version()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/nodeenv.py", line 1052, in get_last_stable_node_version
return _get_versions_json()[0]['version'].lstrip('v')
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/nodeenv.py", line 1028, in _get_versions_json
response = urlopen('%s/index.json' % src_base_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/nodeenv.py", line 652, in urlopen
return urllib2.urlopen(req)
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 215, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 515, in open
response = self._open(req, data)
^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 532, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 492, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1392, in https_open
return self.do_open(http.client.HTTPSConnection, req,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/urllib/request.py", line 1347, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>
Check the log at /Users/ray3/.cache/pre-commit/pre-commit.log
make: *** [lint] Error 3
The above issue was fixed by following the suggestion in the pre-commit issue tracker at https://github.com/pre-commit/pre-commit/issues/1017#issuecomment-488214828.
Build should be passing now.
I think the transactionality problem regarding the document upload from the context overlay could be addressed as follows: instead of uploading the file with the hash, upload it without and add the metadata inline to the edited slice in the context overlay