monero-integrations / moneroodoo Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Affero General Public License v3.0
License: GNU Affero General Public License v3.0
Allow the shopper to provide a refund address, in the situation where they paid too much or the item is out of stock.
@serhack
Best practice is to use major odoo version as branch name in the repo.
Please create branch
14.0
15.0
I'll do some code restucturing from the master branch and create a new pr to the 14.0 branch when ready.
We need more maintainers / contributors in this repo.
If you want to volunteer..
Please message below..
It seems ta-900 has moved on. In meanwhile..I'm willing to take care of some basics.
@serhack @cryptochangements34 Can you add me to this repo as a maintainer.
I would like to have permisison to create and delete branches. Merge commits..
Setup CI, acces to repo settings so it will be possible in the future to Publishing to Pypi
Currently there are 2 modules in this repo, each of them have a lot of dependencies and data.
Some of the data is double. Proposal is to use common odoo practice and perform a clean up by adding a parent base module.
The base module will define XMR currency and symbol.
To fix allow to use enough decimal places and optional integration with accounting let it depend on the oca module account_cryptocurrency
Sets up the monero journals.
also have the following dependencies:
account
queue_job
"external_dependencies": {"python": ["monero"]}
It will not depend on web. So it can be used on systems without website installed.
monero-rpc-odoo rename to payment_monero
Depends on the base_monero
module.
monero-rpc-odoo-pos
monero-rpc-odoo-pos
rename to pos_payment_monero
Depends on the base_monero
module.
Remove the field is_cryptocurrency
, as it is unused.
(maybe implement a hook to recalulate the exchange rate.)
"category": "Accounting"
to 'category': 'Sales/Point of Sale'
Future module to be developed to initiate a monero payment from the odoo backend to a supplier?
Will also depend on base monero.
Depends on the base_monero
module.
edit:
since the monero lib is used instead of monero-rpc.
Change the names to prevent confusion.
Steps to reproduce:
Create an odoo test environment with demo data.
Install monero-odoo-rpc with all its dependencies.
Activate the monero currency
Set monero payment acquirer to test mode.
Visit the webshop.
(prices are still in usd as it should).
Buy an product in the webshop.
Click Proceed to checkout. and Odoo crashes.
odoo_1 | 2022-04-23 19:29:36,179 1 CRITICAL devel odoo.addons.monero-rpc-odoo.models.monero_acq: Monero RPC Error
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 158, in _new_conn
odoo_1 | conn = connection.create_connection(
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 80, in create_connection
odoo_1 | raise err
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 70, in create_connection
odoo_1 | sock.connect(sa)
odoo_1 | ConnectionRefusedError: [Errno 111] Connection refused
odoo_1 |
odoo_1 | During handling of the above exception, another exception occurred:
odoo_1 |
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 597, in urlopen
odoo_1 | httplib_response = self._make_request(conn, method, url,
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 354, in _make_request
odoo_1 | conn.request(method, url, **httplib_request_kw)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1256, in request
odoo_1 | self._send_request(method, url, body, headers, encode_chunked)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1302, in _send_request
odoo_1 | self.endheaders(body, encode_chunked=encode_chunked)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1251, in endheaders
odoo_1 | self._send_output(message_body, encode_chunked=encode_chunked)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1011, in _send_output
odoo_1 | self.send(msg)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 951, in send
odoo_1 | self.connect()
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in connect
odoo_1 | conn = self._new_conn()
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 167, in _new_conn
odoo_1 | raise NewConnectionError(
odoo_1 | urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7faf7731e850>: Failed to establish a new connection: [Errno 111] Connection refused
odoo_1 |
odoo_1 | During handling of the above exception, another exception occurred:
odoo_1 |
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
odoo_1 | resp = conn.urlopen(
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 637, in urlopen
odoo_1 | retries = retries.increment(method, url, error=e, _pool=self,
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 399, in increment
odoo_1 | raise MaxRetryError(_pool, url, error or ResponseError(cause))
odoo_1 | urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=18082): Max retries exceeded with url: /json_rpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7faf7731e850>: Failed to establish a new connection: [Errno 111] Connection refused'))
odoo_1 |
odoo_1 | During handling of the above exception, another exception occurred:
odoo_1 |
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/opt/odoo/auto/addons/monero-rpc-odoo/models/monero_acq.py", line 33, in get_wallet
odoo_1 | wallet = Wallet(rpc_server)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/wallet.py", line 43, in __init__
odoo_1 | self.refresh()
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/wallet.py", line 54, in refresh
odoo_1 | for _acc in self._backend.accounts():
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/backends/jsonrpc/wallet.py", line 78, in accounts
odoo_1 | _accounts = self.raw_request("get_accounts")
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/backends/jsonrpc/wallet.py", line 391, in raw_request
odoo_1 | rsp = self.session.post(
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 581, in post
odoo_1 | return self.request('POST', url, data=data, json=json, **kwargs)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 533, in request
odoo_1 | resp = self.send(prep, **send_kwargs)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 646, in send
odoo_1 | r = adapter.send(request, **kwargs)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
odoo_1 | raise ConnectionError(e, request=request)
odoo_1 | requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=18082): Max retries exceeded with url: /json_rpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7faf7731e850>: Failed to establish a new connection: [Errno 111] Connection refused'))
odoo_1 | 2022-04-23 19:29:36,214 1 ERROR devel odoo.addons.monero-rpc-odoo.controllers.website_sale: USER IMPACT: Monero Payment Acquirer experienced an Error with RPC: ConnectionError
odoo_1 | 2022-04-23 19:29:36,317 1 INFO devel werkzeug: 192.168.112.13 - - [23/Apr/2022 19:29:36] "GET /shop/payment HTTP/1.1" 500 - 38 0.055 0.170
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 158, in _new_conn
odoo_1 | conn = connection.create_connection(
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 80, in create_connection
odoo_1 | raise err
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 70, in create_connection
odoo_1 | sock.connect(sa)
odoo_1 | ConnectionRefusedError: [Errno 111] Connection refused
odoo_1 |
odoo_1 | During handling of the above exception, another exception occurred:
odoo_1 |
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 597, in urlopen
odoo_1 | httplib_response = self._make_request(conn, method, url,
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 354, in _make_request
odoo_1 | conn.request(method, url, **httplib_request_kw)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1256, in request
odoo_1 | self._send_request(method, url, body, headers, encode_chunked)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1302, in _send_request
odoo_1 | self.endheaders(body, encode_chunked=encode_chunked)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1251, in endheaders
odoo_1 | self._send_output(message_body, encode_chunked=encode_chunked)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 1011, in _send_output
odoo_1 | self.send(msg)
odoo_1 | File "/usr/local/lib/python3.8/http/client.py", line 951, in send
odoo_1 | self.connect()
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in connect
odoo_1 | conn = self._new_conn()
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 167, in _new_conn
odoo_1 | raise NewConnectionError(
odoo_1 | urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7faf7731e850>: Failed to establish a new connection: [Errno 111] Connection refused
odoo_1 |
odoo_1 | During handling of the above exception, another exception occurred:
odoo_1 |
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
odoo_1 | resp = conn.urlopen(
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 637, in urlopen
odoo_1 | retries = retries.increment(method, url, error=e, _pool=self,
odoo_1 | File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 399, in increment
odoo_1 | raise MaxRetryError(_pool, url, error or ResponseError(cause))
odoo_1 | urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=18082): Max retries exceeded with url: /json_rpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7faf7731e850>: Failed to establish a new connection: [Errno 111] Connection refused'))
odoo_1 |
odoo_1 | During handling of the above exception, another exception occurred:
odoo_1 |
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/opt/odoo/custom/src/private/monero-rpc-odoo/controllers/website_sale.py", line 46, in payment
odoo_1 | wallet = acquirer.get_wallet()
odoo_1 | File "/opt/odoo/custom/src/private/monero-rpc-odoo/models/monero_acq.py", line 40, in get_wallet
odoo_1 | raise e
odoo_1 | File "/opt/odoo/custom/src/private/monero-rpc-odoo/models/monero_acq.py", line 33, in get_wallet
odoo_1 | wallet = Wallet(rpc_server)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/wallet.py", line 43, in __init__
odoo_1 | self.refresh()
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/wallet.py", line 54, in refresh
odoo_1 | for _acc in self._backend.accounts():
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/backends/jsonrpc/wallet.py", line 78, in accounts
odoo_1 | _accounts = self.raw_request("get_accounts")
odoo_1 | File "/usr/local/lib/python3.8/site-packages/monero/backends/jsonrpc/wallet.py", line 391, in raw_request
odoo_1 | rsp = self.session.post(
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 581, in post
odoo_1 | return self.request('POST', url, data=data, json=json, **kwargs)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 533, in request
odoo_1 | resp = self.send(prep, **send_kwargs)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 646, in send
odoo_1 | r = adapter.send(request, **kwargs)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
odoo_1 | raise ConnectionError(e, request=request)
odoo_1 | requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=18082): Max retries exceeded with url: /json_rpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7faf7731e850>: Failed to establish a new connection: [Errno 111] Connection refused'))
odoo_1 |
odoo_1 | During handling of the above exception, another exception occurred:
odoo_1 |
odoo_1 | Traceback (most recent call last):
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/service/wsgi_server.py", line 113, in application
odoo_1 | return application_unproxied(environ, start_response)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/service/wsgi_server.py", line 88, in application_unproxied
odoo_1 | result = odoo.http.root(environ, start_response)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1307, in __call__
odoo_1 | return self.dispatch(environ, start_response)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1273, in __call__
odoo_1 | return self.app(environ, start_wrapped)
odoo_1 | File "/usr/local/lib/python3.8/site-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
odoo_1 | return self.app(environ, start_response)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 1497, in dispatch
odoo_1 | result = ir_http._dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/website_sale/models/ir_http.py", line 15, in _dispatch
odoo_1 | return super(IrHttp, cls)._dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/website/models/ir_http.py", line 183, in _dispatch
odoo_1 | response = super(Http, cls)._dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
odoo_1 | return super(Http, cls)._dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/web_editor/models/ir_http.py", line 21, in _dispatch
odoo_1 | return super(IrHttp, cls)._dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/utm/models/ir_http.py", line 29, in _dispatch
odoo_1 | response = super(IrHttp, cls)._dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/http_routing/models/ir_http.py", line 508, in _dispatch
odoo_1 | result = super(IrHttp, cls)._dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_http.py", line 241, in _dispatch
odoo_1 | return cls._handle_exception(e)
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/utm/models/ir_http.py", line 34, in _handle_exception
odoo_1 | response = super(IrHttp, cls)._handle_exception(exc)
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/http_routing/models/ir_http.py", line 609, in _handle_exception
odoo_1 | raise e
odoo_1 | File "/opt/odoo/custom/src/odoo/addons/http_routing/models/ir_http.py", line 600, in _handle_exception
odoo_1 | response = super(IrHttp, cls)._handle_exception(exception)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_http.py", line 206, in _handle_exception
odoo_1 | raise exception
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
odoo_1 | result = request.dispatch()
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 808, in dispatch
odoo_1 | r = self._call_function(**self.params)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 361, in _call_function
odoo_1 | return checked_call(self.db, *args, **kwargs)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 94, in wrapper
odoo_1 | return f(dbname, *args, **kwargs)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 349, in checked_call
odoo_1 | result = self.endpoint(*a, **kw)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 914, in __call__
odoo_1 | return self.method(*args, **kw)
odoo_1 | File "/opt/odoo/custom/src/odoo/odoo/http.py", line 533, in response_wrap
odoo_1 | response = f(*args, **kw)
odoo_1 | File "/opt/odoo/custom/src/private/monero-rpc-odoo/controllers/website_sale.py", line 73, in payment
odoo_1 | raise ValidationError(
odoo_1 | odoo.exceptions.ValidationError: Current technical issues prevent Monero from being accepted, choose another payment method
odoo_1 | 2022-04-23 19:29:36,784 1 INFO ? werkzeug: 192.168.112.13 - - [23/Apr/2022 19:29:36] "GET /shop/payment?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 - - - -
Exprected result:
An proper error message and no server crash.
Roadmap / todo:
In odoo repo's it is common to use a branch name similar to the odoo version.
E.g. 14.0
, 15.0
, 16.0
, 17.0
For each version, we start with a fresh new branch.
Then per module a PR is created to migrate the code from the previous version to the next one.
14.0
--> 15.0
In the PR the complete commit history is preserved. And a migration commit is added on top.
eg
[add] base_monero
[MIG] base_monero: Migration to 15.0
We should follow this workflow here in this repo as well.
Tasks:
main
branch14.0
branch as the default15.0
branch15.0
branch16.0
branch17.0
branch@serhack @cryptochangements34 Can you take care of this?
Edit: If you give me the permissions, I'm also happy to do it.
new empty branch can be created with.
$ git checkout --orphan NEWBRANCH
$ git rm -rf .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.