[FIX] *: unnecessary semicolon (W0301)

+ empty spaces removal
+ added space after comma (C0326 - bad-whitespace)

Part-of: odoo/odoo#86332
This commit is contained in:
Victor Feyens
2022-04-27 07:51:23 +02:00
parent dcc71b984e
commit 7d422a2cd4
4 changed files with 15 additions and 16 deletions
+1 -1
View File
@@ -170,7 +170,7 @@ class ImDispatch(object):
with odoo.sql_db.db_connect('postgres').cursor() as cr:
conn = cr._cnx
cr.execute("listen imbus")
cr.commit();
cr.commit()
while True:
if select.select([conn], [], [], TIMEOUT) == ([], [], []):
pass
+12 -13
View File
@@ -95,9 +95,9 @@ class EscposDriver(Thread):
if not self.is_alive():
self.daemon = True
self.start()
def get_escpos_printer(self):
printers = self.connected_usb_devices()
if len(printers) > 0:
try:
@@ -201,10 +201,10 @@ class EscposDriver(Thread):
def check(string):
return string != True and bool(string) and string.strip()
def price(amount):
return ("{0:."+str(receipt['precision']['price'])+"f}").format(amount)
def money(amount):
return ("{0:."+str(receipt['precision']['money'])+"f}").format(amount)
@@ -218,7 +218,7 @@ class EscposDriver(Thread):
lwidth = int(width * ratio)
rwidth = width - lwidth
lwidth = lwidth - indent
left = left[:lwidth]
if len(left) != lwidth:
left = left + ' ' * (lwidth - len(left))
@@ -228,7 +228,7 @@ class EscposDriver(Thread):
right = ' ' * (rwidth - len(right)) + right
return ' ' * indent + left + right + '\n'
def print_taxes():
taxes = receipt['tax_details']
for tax in taxes:
@@ -279,29 +279,28 @@ class EscposDriver(Thread):
# Subtotal if the taxes are not included
taxincluded = True
if money(receipt['subtotal']) != money(receipt['total_with_tax']):
eprint.text(printline('','-------'));
eprint.text(printline('', '-------'))
eprint.text(printline(_('Subtotal'),money(receipt['subtotal']),width=40, ratio=0.6))
print_taxes()
#eprint.text(printline(_('Taxes'),money(receipt['total_tax']),width=40, ratio=0.6))
taxincluded = False
# Total
eprint.text(printline('','-------'));
eprint.text(printline('', '-------'))
eprint.set(align='center',height=2)
eprint.text(printline(_(' TOTAL'),money(receipt['total_with_tax']),width=40, ratio=0.6))
eprint.text('\n\n');
eprint.text('\n\n')
# Paymentlines
eprint.set(align='center')
for line in receipt['paymentlines']:
eprint.text(printline(line['journal'], money(line['amount']), ratio=0.6))
eprint.text('\n');
eprint.text('\n')
eprint.set(align='center',height=2)
eprint.text(printline(_(' CHANGE'),money(receipt['change']),width=40, ratio=0.6))
eprint.set(align='center')
eprint.text('\n');
eprint.text('\n')
# Extra Payment info
if receipt['total_discount'] != 0:
+1 -1
View File
@@ -804,7 +804,7 @@ class Escpos:
else:
encoding = 'cp437'
encoded = b'\xb1' # could not encode, output error character
break;
break
if encoding != self.encoding:
# if the encoding changed, remember it and prefix the character with
+1 -1
View File
@@ -20,7 +20,7 @@ class IrTranslation(models.Model):
(EXCLUDED.name, EXCLUDED.lang, EXCLUDED.res_id, EXCLUDED.src, EXCLUDED.type,
EXCLUDED.value, EXCLUDED.module, EXCLUDED.state, EXCLUDED.comments)
WHERE EXCLUDED.value IS NOT NULL AND EXCLUDED.value != ''
""";
"""
else:
conflict_clause = " ON CONFLICT DO NOTHING"