Pos addons 11.0 pos qr payments upd#551
Conversation
|
|
||
| CHANNEL_NAME = "wechat.miniprogram" | ||
|
|
||
| class WeChatOrder(models.Model): |
| @@ -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 | |||
| '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.
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.
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.
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.
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({ |
| 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.
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.
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); | ||
| }) |
|
|
||
| // 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.
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.
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); | ||
| }) |
| // 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.
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.
Misleading line break before '?'; readers may interpret this as an expression boundary.
| "auto_install": False, | ||
| "installable": True, | ||
| } | ||
| # TODO: ACCESS 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.
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.
Unexpected use of undefined no-undefined
| }); | ||
| order.destroy({'reason':'abandon'}); | ||
| }); | ||
| }) |
| }); | ||
| order.destroy({'reason':'abandon'}); | ||
| }); | ||
| }) |
| @@ -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 | |||
| order.orderlines.add(line); | ||
| } | ||
| }); | ||
|
|
There was a problem hiding this comment.
Trailing spaces not allowed no-trailing-spaces
8b70a01 to
f8e84d7
Compare
| @@ -0,0 +1,32 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| from odoo import api, fields, models, _ | |||
| from datetime import datetime, timedelta | ||
|
|
||
| from odoo import models, api | ||
| from odoo import models, api, _, fields |
| import base64 | ||
| import json | ||
| import requests | ||
| from datetime import datetime, timedelta |
There was a problem hiding this comment.
'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.
'odoo.exceptions.UserError' imported but unused
| @@ -0,0 +1,41 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| from odoo import api, fields, models, _ | |||
| # 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 |
e1c7460 to
0958da7
Compare
| }); | ||
| }, | ||
| on_wechat_miniprogram: function(message) { | ||
| var order = this.get('orders').find(function(item) { |
There was a problem hiding this comment.
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.
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 |
| return order.miniprogram_order | ||
| }); | ||
|
|
||
| var not_found = mp_orders.map(function(r) { |
There was a problem hiding this comment.
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 |
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| if (order.miniprogram_order) { | ||
| return order.miniprogram_order |
| } | ||
| }); | ||
|
|
||
| var not_found = mp_orders.map(function(r) { |
There was a problem hiding this comment.
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 |
| 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.
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 |
|
|
||
| var mp_orders = self.get('orders').filter(function(order) { | ||
| if (order.miniprogram_order && order.miniprogram_order.id) { | ||
| return order.miniprogram_order |
…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.
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.
'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.
'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.
Parsing error: Unexpected character '`'
|
It will be merged here: itpp-labs/pos-addons#1249 |
No description provided.