Skip to content

Commit

Permalink
🌈 pre-commit: pos_invoice_pay cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Vildan Safin <[email protected]>
  • Loading branch information
Enigma228322 committed Feb 17, 2020
1 parent b495015 commit 33f038e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 35 deletions.
24 changes: 0 additions & 24 deletions pos_invoice_pay/actions/ir_action_server.xml

This file was deleted.

18 changes: 7 additions & 11 deletions pos_invoice_pay/static/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
// Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
// License MIT (https://opensource.org/licenses/MIT).
/* eslint no-useless-escape: "off"*/
odoo.define("pos_invoices", function(require) {
"use_strict";
"use strict";

var core = require("web.core");
var gui = require("point_of_sale.gui");
Expand Down Expand Up @@ -92,7 +93,6 @@ odoo.define("pos_invoices", function(require) {
var _super_posmodel = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
initialize: function(session, attributes) {
var self = this;
_super_posmodel.initialize.apply(this, arguments);
this.bus.add_channel_callback(
"pos_sale_orders",
Expand Down Expand Up @@ -279,7 +279,6 @@ odoo.define("pos_invoices", function(require) {
},

validate_invoice: function(id) {
var result = $.Deferred();
return rpc.query({
model: "account.invoice",
method: "action_invoice_open",
Expand All @@ -288,8 +287,7 @@ odoo.define("pos_invoices", function(require) {
},

get_invoices_to_render: function(invoices) {
var self = this,
muted_invoices_ids = [],
var muted_invoices_ids = [],
order = {},
id = 0,
i = 0,
Expand Down Expand Up @@ -415,8 +413,7 @@ odoo.define("pos_invoices", function(require) {
},

_sale_order_search_string: function(sale_order) {
var str = sale_order.name,
id_string = String(sale_order.id);
var str = sale_order.name;
if (sale_order.date_order) {
str += "|" + sale_order.date_order;
}
Expand Down Expand Up @@ -629,7 +626,7 @@ odoo.define("pos_invoices", function(require) {
this.render_data(this.get_data());

this.$(".list-contents").delegate(this.$listEl, "click", function(event) {
self.select_line(event, $(this), parseInt($(this).data("id")));
self.select_line(event, $(this), parseInt($(this).data("id"), 10));
});

if (this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard) {
Expand Down Expand Up @@ -672,7 +669,6 @@ odoo.define("pos_invoices", function(require) {
var contents = this.$el[0].querySelector(".list-contents");
contents.innerHTML = "";
for (var i = 0, len = Math.min(data.length, 1000); i < len; i++) {
var item = data[i];
var item_html = QWeb.render(this.itemTemplate, {
widget: this,
item: data[i],
Expand Down Expand Up @@ -1011,7 +1007,7 @@ odoo.define("pos_invoices", function(require) {
var total = self.pos.selected_invoice.residual,
due = 0,
plines = order.paymentlines.models;
if (paymentline === void 0) {
if (paymentline === undefined) {
due = total - order.get_total_paid();
} else {
due = total;
Expand All @@ -1031,7 +1027,7 @@ odoo.define("pos_invoices", function(require) {
change = 0,
plines = order.paymentlines.models,
i = 0;
if (paymentline === void 0) {
if (paymentline === undefined) {
change = -due + order.get_total_paid();
} else {
change = -due;
Expand Down

0 comments on commit 33f038e

Please sign in to comment.