diff --git a/openerp/cli/shell.py b/openerp/cli/shell.py index 2e11645032d..76e715135cd 100644 --- a/openerp/cli/shell.py +++ b/openerp/cli/shell.py @@ -34,6 +34,7 @@ class Shell(Command): def console(self, local_vars): if not os.isatty(sys.stdin.fileno()): + local_vars['__name__'] = '__main__' exec sys.stdin in local_vars else: if 'env' not in local_vars: