Skip to content

Conversation

@GabbasovDinar
Copy link

No description provided.


CHANNEL_NAME = "wechat.miniprogram"

class WeChatOrder(models.Model):

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

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

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

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

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;

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({

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) {

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){

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

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;

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 {

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

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]

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]

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

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;

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;

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

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

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

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

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, _

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

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

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

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, _

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

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) {

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) {

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

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) {

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

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

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) {

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

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) {

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

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

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

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

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

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

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

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