From 60353cf46369a43217f4f2b63d7e64bcb11c8f62 Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Mon, 27 Nov 2017 11:12:27 +0100 Subject: [PATCH 1/2] [FIX] server: do not restart if phoenix is True (#21209) Before this commit, saving a file being watched by watchdog (--dev=reload) with vim (and possibly other text editors) would crash the server via a KeyboardInterrupt error. This happens because vim, emacs cause multiple filesystem events to happen when saving a single file, the FSWatcher registers these events as multiple SIGHUPs which in turn calls restart() multiple times in a very small amount of time which makes the KeyboardInterrupts completely shut down the server This is fixed by only calling restart() if odoo.phoenix is False, since catching a SIGHUP sets it to true. Fixes #21178 Special thanks to @odony for the help :) --- odoo/service/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/odoo/service/server.py b/odoo/service/server.py index b1fb4068d88..c0deb3989d7 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -137,8 +137,9 @@ class FSWatcher(object): except SyntaxError: _logger.error('autoreload: python code change detected, SyntaxError in %s', path) else: - _logger.info('autoreload: python code updated, autoreload activated') - restart() + if not getattr(odoo, 'phoenix', False): + _logger.info('autoreload: python code updated, autoreload activated') + restart() def start(self): self.observer.start() From e372ca5cd88e714283bd3b2b5918bdc21c0ab6a5 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 1 Aug 2018 10:12:26 +0200 Subject: [PATCH 2/2] [FIX] account: aged partner balance report consistent return Before this commit, the function that computes the aged partner balance could return a list instead of a dict if no partner were found After this commit, we make the function's signature consistent closes #26095 --- addons/account/report/account_aged_partner_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 909c8d2cd39..317da02a0af 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -68,7 +68,7 @@ class ReportAgedPartnerBalance(models.AbstractModel): partner_ids = [partner['partner_id'] for partner in partners if partner['partner_id']] lines = dict((partner['partner_id'] or False, []) for partner in partners) if not partner_ids: - return [], [], [] + return [], [], {} # This dictionary will store the not due amount of all partners undue_amounts = {}