Skip to content

Pos addons 11.0 pos qr payments upd#551

Closed
GabbasovDinar wants to merge 137 commits into
it-projects-llc:pos-addons-11.0-pos-qr-paymentsfrom
GabbasovDinar:pos-addons-11.0-pos-qr-payments-upd
Closed

Pos addons 11.0 pos qr payments upd#551
GabbasovDinar wants to merge 137 commits into
it-projects-llc:pos-addons-11.0-pos-qr-paymentsfrom
GabbasovDinar:pos-addons-11.0-pos-qr-payments-upd

Conversation

@GabbasovDinar
Copy link
Copy Markdown

No description provided.


CHANNEL_NAME = "wechat.miniprogram"

class WeChatOrder(models.Model):
Copy link
Copy Markdown

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

Comment thread pos_wechat_miniprogram/models/http.py Outdated
@@ -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
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.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
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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;
Copy link
Copy Markdown

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({
Copy link
Copy Markdown

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) {
Copy link
Copy Markdown

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){
Copy link
Copy Markdown

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);
})
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.


// 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;
Copy link
Copy Markdown

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 {
Copy link
Copy Markdown

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);
})
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 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]
Copy link
Copy Markdown

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]
Copy link
Copy Markdown

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.

Comment thread pos_wechat_miniprogram/__manifest__.py Outdated
"auto_install": False,
"installable": True,
}
# TODO: ACCESS No newline at end of file
Copy link
Copy Markdown

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;
Copy link
Copy Markdown

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;
Copy link
Copy Markdown

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'});
});
})
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.

});
order.destroy({'reason':'abandon'});
});
})
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 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
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.fields' imported but unused

order.orderlines.add(line);
}
});

Copy link
Copy Markdown

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

@GabbasovDinar GabbasovDinar force-pushed the pos-addons-11.0-pos-qr-payments-upd branch from 8b70a01 to f8e84d7 Compare September 4, 2018 07:39
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-

from odoo import api, fields, models, _
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.fields' imported but unused

from datetime import datetime, timedelta

from odoo import models, api
from odoo import models, api, _, fields
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.fields' imported but unused

import base64
import json
import requests
from datetime import datetime, timedelta
Copy link
Copy Markdown

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

Comment thread pos_wechat_miniprogram/wizard/qrcode.py Outdated

from odoo import api, fields, models, _
import logging
from odoo.exceptions import UserError
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.exceptions.UserError' imported but unused

Comment thread pos_wechat_miniprogram/wizard/qrcode.py Outdated
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-

from odoo import api, fields, models, _
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._' 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
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.api' imported but unused

@GabbasovDinar GabbasovDinar force-pushed the pos-addons-11.0-pos-qr-payments-upd branch from e1c7460 to 0958da7 Compare September 19, 2018 08:29
});
},
on_wechat_miniprogram: function(message) {
var order = this.get('orders').find(function(item) {
Copy link
Copy Markdown

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) {
Copy link
Copy Markdown

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
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.

return order.miniprogram_order
});

var not_found = mp_orders.map(function(r) {
Copy link
Copy Markdown

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
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 semi


var mp_orders = self.get('orders').filter(function(order) {
if (order.miniprogram_order) {
return order.miniprogram_order
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.

}
});

var not_found = mp_orders.map(function(r) {
Copy link
Copy Markdown

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
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 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) {
Copy link
Copy Markdown

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
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.


var mp_orders = self.get('orders').filter(function(order) {
if (order.miniprogram_order && order.miniprogram_order.id) {
return order.miniprogram_order
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 semi

@GabbasovDinar GabbasovDinar force-pushed the pos-addons-11.0-pos-qr-payments-upd branch from fda33e5 to 0a1483e Compare September 21, 2018 08:20
render_paymentmethods: function() {
var methods = this._super();
var jsapi_journal = this.pos.get_mp_cashregister();
var el = methods.find(`[data-id='${jsapi_journal.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.

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}']`);
Copy link
Copy Markdown

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]}']`);
Copy link
Copy Markdown

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]}']`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parsing error: Unexpected character '`'

@yelizariev
Copy link
Copy Markdown

It will be merged here: itpp-labs/pos-addons#1249

@yelizariev yelizariev closed this May 12, 2020
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.

3 participants