Skip to content

11.0 qr payments#1109

Closed
KolushovAlexandr wants to merge 69 commits into
itpp-labs:11.0from
KolushovAlexandr:11.0-qr-payments
Closed

11.0 qr payments#1109
KolushovAlexandr wants to merge 69 commits into
itpp-labs:11.0from
KolushovAlexandr:11.0-qr-payments

Conversation

@KolushovAlexandr
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread qr_payments/tools/async.py
data['body'] = message['data']['order_short']

data['out_trade_no'] = (str(time.time()).replace('.', '') \
+ '{0:010}'.format(random.randint(1, 9999999999)) \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent
the backslash is redundant between brackets

data['mch_id'] = request.env['ir.config_parameter'].get_param('wechat.mchId')
data['body'] = message['data']['order_short']

data['out_trade_no'] = (str(time.time()).replace('.', '') \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the backslash is redundant between brackets

import logging
import requests
import odoo
import json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'json' imported but unused

Copy link
Copy Markdown
Contributor

@itpp-bot itpp-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 installable modules are updated:

├─ payment_wechat/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ controllers/
|  |  ├─ __init__.py
|  |  └─ p_w_controllers.py
|  ├─ demo/
|  |  └─ w_p_demo.xml
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  ├─ models/
|  |  ├─ __init__.py
|  |  └─ wechat_models.py
|  ├─ static/
|  |  └─ description/
|  |     └─ icon.png
|  └─ views/
|     └─ views.xml
├─ pos_payment/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  └─ static/
|     └─ description/
|        └─ icon.png
├─ pos_qr_scan/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  ├─ static/
|  |  ├─ lib/
|  |  |  └─ jsqrcode/
|  |  |     ├─ COPYING
|  |  |     ├─ README
|  |  |     ├─ alignpat.js
|  |  |     ├─ bitmat.js
|  |  |     ├─ bmparser.js
|  |  |     ├─ datablock.js
|  |  |     ├─ databr.js
|  |  |     ├─ datamask.js
|  |  |     ├─ decoder.js
|  |  |     ├─ detector.js
|  |  |     ├─ errorlevel.js
|  |  |     ├─ findpat.js
|  |  |     ├─ formatinf.js
|  |  |     ├─ gf256.js
|  |  |     ├─ gf256poly.js
|  |  |     ├─ grid.js
|  |  |     ├─ qrcode.js
|  |  |     ├─ rsdecoder.js
|  |  |     └─ version.js
|  |  └─ src/
|  |     ├─ css/
|  |     |  └─ pos.css
|  |     ├─ description/
|  |     |  └─ icon.png
|  |     ├─ js/
|  |     |  └─ qr_scan.js
|  |     └─ xml/
|  |        └─ templates.xml
|  └─ views/
|     └─ assets.xml
├─ pos_wechat/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ data/
|  |  └─ account_journal_data.xml
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  ├─ models/
|  |  ├─ __init__.py
|  |  ├─ account_journal.py
|  |  └─ wechat_micropay.py
|  ├─ static/
|  |  ├─ description/
|  |  |  └─ icon.png
|  |  └─ src/
|  |     └─ js/
|  |        ├─ tour.js
|  |        └─ wechat_pay.js
|  ├─ tests/
|  |  ├─ __init__.py
|  |  └─ test_micropay.py
|  └─ views/
|     └─ assets.xml
└─ wechat/
   ├─ README.rst
   ├─ __init__.py
   ├─ __manifest__.py
   ├─ controllers/
   |  ├─ __init__.py
   |  └─ wechat_controllers.py
   ├─ doc/
   |  ├─ changelog.rst
   |  └─ index.rst
   ├─ models/
   |  ├─ __init__.py
   |  ├─ ir_config_parameter.py
   |  ├─ wechat_micropay.py
   |  └─ wechat_order.py
   ├─ tests/
   |  ├─ __init__.py
   |  └─ test_wechat_order.py
   ├─ tools/
   |  ├─ __init__.py
   |  └─ async.py
   └─ views/
      └─ wechat_micropay_views.xml

Not installable modules remain unchanged.

sent by ✌️ Odoo Review Bot

`1.0.0`
-------

- Init version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

`1.0.0`
-------

- Init version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

`1.0.0`
-------

- Init version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

`1.0.0`
-------

- Init version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Comment thread wechat/doc/changelog.rst
`1.0.0`
-------

- Init version
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Comment thread wechat/tools/async.py
try:
# python 3
return method.__self__
except:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use bare 'except'

Comment thread wechat/tools/async.py
import threading


from odoo import api, tools
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'odoo.tools' imported but unused

]


def _patch_post(self, post_result):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many blank lines (2)

'result_code': 'SUCCESS',
'openid': '123',
'total_fee': total_fee,
'order_ref': order_ref,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'order_ref'

# Try to compute url automatically
try:
scheme = request.httprequest.scheme
except:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use bare 'except'


from odoo.tests.common import HttpCase, HOST, PORT, get_db_name
from odoo import api, SUPERUSER_ID
from odoo.addons.bus.models.bus import dispatch
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'odoo.addons.bus.models.bus.dispatch' imported but unused

# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import logging
import json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'json' imported but unused

'terminal_ref': terminal_ref,
'pos_id': pos_id,
},
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

// TODO: do we need to extend init_from_JSON too ?
export_as_JSON: function(){
var res = PaymentlineSuper.prototype.export_as_JSON.apply(this, arguments);
res['micropay_id'] = this.micropay_id;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

['micropay_id'] is better written in dot notation.

micropay_id: msg['micropay_id'],
cashregister: this.wechat_cashregister,
pos: this});
newPaymentline.set_amount( msg['total_fee'] / 100.0 );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

['total_fee'] is better written in dot notation.

@KolushovAlexandr
Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants