-
Notifications
You must be signed in to change notification settings - Fork 56
Pos addons 11.0 pos qr payments upd #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pos addons 11.0 pos qr payments upd #551
Conversation
|
|
||
| CHANNEL_NAME = "wechat.miniprogram" | ||
|
|
||
| class WeChatOrder(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected 2 blank lines, found 1
| @@ -0,0 +1,14 @@ | |||
| # Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar> | |||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | |||
| from odoo import fields, models | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'odoo.fields' imported but unused
| 'title': error.data.message || _t("Server Error"), | ||
| 'body': error.data.debug || _t('The server encountered an error while receiving your order.'), | ||
| }); | ||
| } else { // other Error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected comment inline with code no-inline-comments
Multiple spaces found before '// other Error' no-multi-spaces
| 'title': _t('The order could not be sent'), | ||
| 'body': _t('Check your internet connection and try again.'), | ||
| }); | ||
| } else if (error.code === 200) { // OpenERP Server Errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected comment inline with code no-inline-comments
Multiple spaces found before '// OpenERP Ser...' no-multi-spaces
| self.gui.show_screen('clientlist'); | ||
| }, | ||
| }); | ||
| } else if (error.code < 0) { // XmlHttpRequest Errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected comment inline with code no-inline-comments
Multiple spaces found before '// XmlHttpRequ...' no-multi-spaces
| this.miniprogram_order_id = data.id; | ||
| this.miniprogram_state = data.state; | ||
| this.table = this.pos.tables_by_id[data.table_id]; | ||
| this.floor = this.table ? this.pos.floors_by_id[data.floor_id] : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected newline between test and consequent of ternary expression multiline-ternary
Expected newline between consequent and alternate of ternary expression multiline-ternary
Unexpected use of undefined no-undefined
| return model.model === 'res.partner'; | ||
| }).fields; | ||
| var domain = [['id','=',partner_id]]; | ||
| rpc.query({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'rpc' is not defined no-undef
| if (l.quantity !== undefined && l.quantity !== line.quantity){ | ||
| line.set_quantity(l.quantity); | ||
| } | ||
| if (l.price !== undefined && l.price !== line.price) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of undefined no-undefined
| var product = self.db.get_product_by_id(l.product_id); | ||
| if (product) { | ||
| var line = new models.Orderline({}, {pos: self, order: order, product: product}); | ||
| if (l.quantity !== undefined && l.quantity !== line.quantity){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of undefined no-undefined
| self.get_miniprogram_order_lines_by_order_id(order.id).then(function(lines) { | ||
| order.lines_ids = lines; | ||
| self.on_wechat_miniprogram(order); | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
|
||
| // common data for the order and for the order of mini-program | ||
| this.table = this.pos.tables_by_id[data.table_id]; | ||
| this.floor = this.table ? this.pos.floors_by_id[data.floor_id] : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected newline between test and consequent of ternary expression multiline-ternary
Expected newline between consequent and alternate of ternary expression multiline-ternary
Unexpected use of undefined no-undefined
| line.set_unit_price(data.price); | ||
| } | ||
| return line; | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary 'else' after 'return' no-else-return
| self.get_miniprogram_order_lines_by_order_id(order.id).then(function(lines) { | ||
| order.lines_ids = lines; | ||
| self.on_wechat_miniprogram(order); | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
| // common data for the order and for the order of mini-program | ||
| this.table = this.pos.tables_by_id[data.table_id]; | ||
| this.floor = this.table | ||
| ? this.pos.floors_by_id[data.floor_id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '?'; readers may interpret this as an expression boundary.
| // common data for the order and for the order of mini-program | ||
| this.table = this.pos.tables_by_id[data.table_id]; | ||
| this.floor = this.table | ||
| ? this.pos.floors_by_id[data.floor_id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before '?'; readers may interpret this as an expression boundary.
| "auto_install": False, | ||
| "installable": True, | ||
| } | ||
| # TODO: ACCESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no newline at end of file
|
|
||
| // common data for the order and for the order of mini-program | ||
| this.table = this.pos.tables_by_id[data.table_id[0]]; | ||
| this.floor = this.pos.floors_by_id[data.floor_id] || undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of undefined no-undefined
|
|
||
| // common data for the order and for the order of mini-program | ||
| this.table = this.pos.tables_by_id[data.table_id[0]]; | ||
| this.floor = this.pos.floors_by_id[data.floor_id[0]] || undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected use of undefined no-undefined
| }); | ||
| order.destroy({'reason':'abandon'}); | ||
| }); | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
| }); | ||
| order.destroy({'reason':'abandon'}); | ||
| }); | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
| @@ -0,0 +1,25 @@ | |||
| # Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar> | |||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | |||
| from odoo import models, api, fields | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'odoo.fields' imported but unused
| order.orderlines.add(line); | ||
| } | ||
| }); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed no-trailing-spaces
8b70a01 to
f8e84d7
Compare
| @@ -0,0 +1,32 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| from odoo import api, fields, models, _ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'odoo.fields' imported but unused
| from datetime import datetime, timedelta | ||
|
|
||
| from odoo import models, api | ||
| from odoo import models, api, _, fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'odoo.fields' imported but unused
| import base64 | ||
| import json | ||
| import requests | ||
| from datetime import datetime, timedelta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'datetime.datetime' imported but unused
'datetime.timedelta' imported but unused
|
|
||
| from odoo import api, fields, models, _ | ||
| import logging | ||
| from odoo.exceptions import UserError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'odoo.exceptions.UserError' imported but unused
| @@ -0,0 +1,41 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| from odoo import api, fields, models, _ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'odoo._' imported but unused
| # Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar> | ||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
|
||
| from odoo import fields, models, api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'odoo.api' imported but unused
e1c7460 to
0958da7
Compare
| }); | ||
| }, | ||
| on_wechat_miniprogram: function(message) { | ||
| var order = this.get('orders').find(function(item) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of function array-callback-return
| PosModelSuper.prototype.initialize.apply(this, arguments); | ||
| this.bus.add_channel_callback("wechat.miniprogram", this.on_wechat_miniprogram, this); | ||
| this.ready.then(function() { | ||
| var not_found = self.get('orders').map(function(r) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of function array-callback-return
| this.ready.then(function() { | ||
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| return order.miniprogram_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
| return order.miniprogram_order | ||
| }); | ||
|
|
||
| var not_found = mp_orders.map(function(r) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of function array-callback-return
| this.ready.then(function() { | ||
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| return order.miniprogram_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| if (order.miniprogram_order) { | ||
| return order.miniprogram_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
| } | ||
| }); | ||
|
|
||
| var not_found = mp_orders.map(function(r) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of function array-callback-return
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| if (order.miniprogram_order) { | ||
| return order.miniprogram_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
| this.bus.add_channel_callback("wechat.miniprogram", this.on_wechat_miniprogram, this); | ||
| this.ready.then(function() { | ||
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of function array-callback-return
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| if (order.miniprogram_order && order.miniprogram_order.id) { | ||
| return order.miniprogram_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| if (order.miniprogram_order && order.miniprogram_order.id) { | ||
| return order.miniprogram_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
…y_from_miniprogram_ui, test_mobile_number_verification
fda33e5 to
0a1483e
Compare
| render_paymentmethods: function() { | ||
| var methods = this._super(); | ||
| var jsapi_journal = this.pos.get_mp_cashregister(); | ||
| var el = methods.find(`[data-id='${jsapi_journal.id}']`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing error: Unexpected character '`'
| render_paymentmethods: function() { | ||
| var methods = this._super(); | ||
| var jsapi_journal = this.pos.get_mp_cashregister(); | ||
| var el = methods.find(`[data-id='${jsapi_journal.id}']`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
| var methods = this._super(); | ||
| var jsapi_journal = this.pos.get_mp_cashregister(); | ||
| if (jsapi_journal) { | ||
| var el = methods.find(`[data-id='${jsapi_journal.journal_id[0]}']`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
| var methods = this._super(); | ||
| var jsapi_journal = this.pos.get_mp_cashregister(); | ||
| if (jsapi_journal) { | ||
| var el = methods.find(`[data-id='${jsapi_journal.journal_id[0]}']`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing error: Unexpected character '`'
|
It will be merged here: itpp-labs/pos-addons#1249 |
No description provided.