Skip to content

Commit

Permalink
💚 pre-commit: auto cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Yelizariev committed Feb 12, 2020
1 parent 97dc0da commit 998caf3
Show file tree
Hide file tree
Showing 296 changed files with 15,080 additions and 10,624 deletions.
6 changes: 4 additions & 2 deletions .DINAR/image/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
This folder is attached on image building as ``custom/`` folder in [doobba](https://github.com/Tecnativa/doodba#image-usage).
Few additional [files](https://github.com/itpp-labs/DINAR/tree/master/embedded-files/.DINAR/image) are attached temporary on image building.
This folder is attached on image building as `custom/` folder in
[doobba](https://github.com/Tecnativa/doodba#image-usage). Few additional
[files](https://github.com/itpp-labs/DINAR/tree/master/embedded-files/.DINAR/image) are
attached temporary on image building.
1 change: 0 additions & 1 deletion .DINAR/image/src/addons.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# see https://github.com/Tecnativa/doodba#optodoocustomsrcaddonsyaml

---
ENV:
DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ on:

jobs:
notify:

runs-on: ubuntu-latest

steps:
- name: Send notifications to Telegram
run: curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} -d text="${MESSAGE}" >> /dev/null
env:
MESSAGE: "Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}"
- name: Send notifications to Telegram
run:
curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN
}}/sendMessage -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} -d text="${MESSAGE}"
>> /dev/null
env:
MESSAGE:
"Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}"
27 changes: 13 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,27 @@ addons:
postgresql: "9.5"
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow

env:
global:
- VERSION="12.0" TESTS="0" LINT_CHECK="0" UNIT_TEST="0"
- SERVER_OPTIONS="--log-handler=odoo.addons.pos_longpolling:DEBUG"
- EXCLUDE="hw_printer_network,hw_twitter_printing"
- PYLINT_ODOO_JSLINTRC="/home/travis/maintainer-quality-tools/travis/cfg/.jslintrc"

- VERSION="12.0" TESTS="0" LINT_CHECK="0" UNIT_TEST="0"
- SERVER_OPTIONS="--log-handler=odoo.addons.pos_longpolling:DEBUG"
- EXCLUDE="hw_printer_network,hw_twitter_printing"
- PYLINT_ODOO_JSLINTRC="/home/travis/maintainer-quality-tools/travis/cfg/.jslintrc"

matrix:
- LINT_CHECK="1"
- CHECK_TAGS="1"
- TESTS="1" ODOO_REPO="odoo/odoo"
- MAKEPOT="1"
- TESTS="1" ODOO_REPO="OCA/OCB""

- LINT_CHECK="1"
- CHECK_TAGS="1"
- TESTS="1" ODOO_REPO="odoo/odoo"
- MAKEPOT="1"
- TESTS="1" ODOO_REPO="OCA/OCB""

install:
- pip install anybox.testing.openerp
- git clone https://github.com/it-projects-llc/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- git clone https://github.com/it-projects-llc/maintainer-quality-tools.git
${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly

Expand Down
4 changes: 1 addition & 3 deletions hw_twitter_printing/escpos_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def encode_char(char, cur_encoding):
"""
# char_utf8 = char.encode('utf-8')
encoded = ""
encoding = (
cur_encoding
) # we reuse the last encoding to prevent code page switches at every character
encoding = cur_encoding # we reuse the last encoding to prevent code page switches at every character
encodings = {
# TODO use ordering to prevent useless switches
# TODO Support other encodings not natively supported by python ( Thai, Khazakh, Kanjis )
Expand Down
86 changes: 49 additions & 37 deletions pos_cashbox/static/src/js/cashbox.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,83 @@
/* Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
* License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
odoo.define('pos_cashbox.open', function (require) {
* License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
odoo.define("pos_cashbox.open", function(require) {
"use strict";

var WidgetButton = require('web.form_widgets').WidgetButton;
var Session = require('web.Session');
var Model = require('web.DataModel');
var core = require('web.core');
var CrashManager = require('web.CrashManager');
var WidgetButton = require("web.form_widgets").WidgetButton;
var Session = require("web.Session");
var Model = require("web.DataModel");
var core = require("web.core");
var CrashManager = require("web.CrashManager");

var _t = core._t;


WidgetButton.include({
on_click: function(){
on_click: function() {
var self = this;
if (this.node.attrs.special === 'open_backend_cashbox'){
if (this.node.attrs.special === "open_backend_cashbox") {
var proxy_ip = this.view.datarecord.proxy_ip;
if (!proxy_ip) {
return this.show_warning_message(_t('Connection Refused. Please check the IP address to PosBox'));
return this.show_warning_message(
_t("Connection Refused. Please check the IP address to PosBox")
);
}
var url = this.get_full_url(proxy_ip);
this.connect(url);
this.open_cashbox().done(function(){
if (self.$el.hasClass('o_wow')) {
self.show_wow();
}
}).fail(function(){
return self.show_warning_message(_t("Connection Refused. Please check the connection to CashBox"));
});
this.open_cashbox()
.done(function() {
if (self.$el.hasClass("o_wow")) {
self.show_wow();
}
})
.fail(function() {
return self.show_warning_message(
_t(
"Connection Refused. Please check the connection to CashBox"
)
);
});
} else {
this._super.apply(this, arguments);
}
},
show_warning_message: function(message) {
new CrashManager().show_warning({data: {
exception_type: _t("Incorrect Operation"),
message: message
}});
new CrashManager().show_warning({
data: {
exception_type: _t("Incorrect Operation"),
message: message,
},
});
},
get_full_url: function(current_url) {
var port = ':8069';
var port = ":8069";
var url = current_url;
if(url.indexOf('//') < 0){
url = 'http://' + url;
if (url.indexOf("//") < 0) {
url = "http://" + url;
}
if(url.indexOf(':',5) < 0){
if (url.indexOf(":", 5) < 0) {
url += port;
}
return url;
},
connect: function(url) {
this.connection = new Session(void 0, url, { use_cors: true});
this.connection = new Session(void 0, url, {use_cors: true});
},
open_cashbox: function(){
open_cashbox: function() {
var self = this;
function send_opening_job(retries, done) {
done = done || new $.Deferred();
self.connection.rpc('/hw_proxy/open_cashbox').done(function(){
done.resolve();
}).fail(function(){
if(retries > 0){
send_opening_job(retries-1,done);
}else{
done.reject();
}
});
self.connection
.rpc("/hw_proxy/open_cashbox")
.done(function() {
done.resolve();
})
.fail(function() {
if (retries > 0) {
send_opening_job(retries - 1, done);
} else {
done.reject();
}
});
return done;
}
return send_opening_job(3);
Expand Down
13 changes: 10 additions & 3 deletions pos_cashbox/views/pos_cashbox_template.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -->
<odoo>
<template id="assets_backend" name="cash_box assets" inherit_id="web.assets_backend">
<template
id="assets_backend"
name="cash_box assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_cashbox/static/src/js/cashbox.js"></script>
<script
type="text/javascript"
src="/pos_cashbox/static/src/js/cashbox.js"
/>
</xpath>
</template>
</odoo>
24 changes: 16 additions & 8 deletions pos_cashbox/views/pos_cashbox_view.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -->
<odoo>
<record id="view_pos_session_form" model="ir.ui.view">
<field name="name">pos.session.form.view</field>
<field name="model">pos.session</field>
<field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
<field name="inherit_id" ref="point_of_sale.view_pos_session_form" />
<field name="arch" type="xml">
<xpath expr="//form/header/button[@name='action_pos_session_open']" position="before">
<field name="iface_cashdrawer" invisible="1"/>
<field name="proxy_ip" invisible="1"/>
<button name="open_backend_cashbox" type="object" string="Open CashBox"
attrs="{'invisible':['|','|', ('iface_cashdrawer', '=', False), ('cash_control', '=', False), ('state', 'not in', ['opening_control', 'closing_control'])]}"
class="oe_highlight o_wow" special="open_backend_cashbox">
<xpath
expr="//form/header/button[@name='action_pos_session_open']"
position="before"
>
<field name="iface_cashdrawer" invisible="1" />
<field name="proxy_ip" invisible="1" />
<button
name="open_backend_cashbox"
type="object"
string="Open CashBox"
attrs="{'invisible':['|','|', ('iface_cashdrawer', '=', False), ('cash_control', '=', False), ('state', 'not in', ['opening_control', 'closing_control'])]}"
class="oe_highlight o_wow"
special="open_backend_cashbox"
>
<i class='fa fa-archive' />
</button>
</xpath>
Expand Down
21 changes: 9 additions & 12 deletions pos_cashier_select/static/src/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@

.popup.popup-selection.cashier {
height: 90%;
width: 90%;
overflow-y: hidden;
max-height: 100%;


height: 90%;
width: 90%;
overflow-y: hidden;
max-height: 100%;
}

.pos .popup.popup-selection .selection .cashier {
max-height: 100%;
max-height: 100%;
}

.selection.scrollable-y.touch-scrollable.cashier {
max-height: 100%;
max-height: 100%;
}

.selection.cashier {
padding-bottom: 125px;
max-height: 100%;
padding-bottom: 125px;
max-height: 100%;
}

.footer.cashier {
background-color: #F0EEEE;
background-color: #f0eeee;
}
Loading

0 comments on commit 998caf3

Please sign in to comment.