diff --git a/addons/bus/models/bus.py b/addons/bus/models/bus.py index 87762a65b9d..c9f3f919890 100644 --- a/addons/bus/models/bus.py +++ b/addons/bus/models/bus.py @@ -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 diff --git a/addons/hw_escpos/controllers/main.py b/addons/hw_escpos/controllers/main.py index b1a015763f9..a436fab2b66 100644 --- a/addons/hw_escpos/controllers/main.py +++ b/addons/hw_escpos/controllers/main.py @@ -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: diff --git a/addons/hw_escpos/escpos/escpos.py b/addons/hw_escpos/escpos/escpos.py index 59c276f82d9..fd8b2054ac2 100644 --- a/addons/hw_escpos/escpos/escpos.py +++ b/addons/hw_escpos/escpos/escpos.py @@ -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 diff --git a/addons/website/models/ir_translation.py b/addons/website/models/ir_translation.py index bb99cb0c4c3..1de67272053 100644 --- a/addons/website/models/ir_translation.py +++ b/addons/website/models/ir_translation.py @@ -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"