prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Fix travis build on 9.0 branch
  the 9.0 branch of the project is red, with really strange errors about computed fields. There have been such errors since the merge of #469 but for some reason they were neither fatal nor breaking the build. 
  
  Splitting `database_cleanup` tests in .travis.yml seems to let the other modules go green, but the tests for database_cleanup are red. 
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `database_cleanup/models/purge_wizard.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 # © 2014-2016 Therp BV <http://therp.nl>
  3 # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4 import logging
  5 from openerp import _, api, fields, models
  6 from openerp.exceptions import AccessDenied
  7 
  8 
  9 class CleanupPurgeLine(models.AbstractModel):
  10     """ Abstract base class for the purge wizard lines """
  11     _name = 'cleanup.purge.line'
  12     _order = 'name'
  13 
  14     name = fields.Char('Name', readonly=True)
  15     purged = fields.Boolean('Purged', readonly=True)
  16     wizard_id = fields.Many2one('cleanup.purge.wizard')
  17 
  18     logger = logging.getLogger('openerp.addons.database_cleanup')
  19 
  20     @api.multi
  21     def purge(self):
  22         raise NotImplementedError
  23 
  24     @api.model
  25     def create(self, values):
  26         # make sure the user trying this is actually supposed to do it
  27         if not self.env.ref('database_cleanup.menu_database_cleanup')\
  28            .parent_id._filter_visible_menus():
  29             raise AccessDenied
  30         return super(CleanupPurgeLine, self).create(values)
  31 
  32 
  33 class PurgeWizard(models.AbstractModel):
  34     """ Abstract base class for the purge wizards """
  35     _name = 'cleanup.purge.wizard'
  36     _description = 'Purge stuff'
  37 
  38     @api.model
  39     def default_get(self, fields_list):
  40         res = super(PurgeWizard, self).default_get(fields_list)
  41         if 'purge_line_ids' in fields_list:
  42             res['purge_line_ids'] = self.find()
  43         return res
  44 
  45     @api.multi
  46     def find(self):
  47         raise NotImplementedError
  48 
  49     @api.multi
  50     def purge_all(self):
  51         self.mapped('purge_line_ids').purge()
  52         return True
  53 
  54     @api.model
  55     def get_wizard_action(self):
  56         wizard = self.create({})
  57         return {
  58             'type': 'ir.actions.act_window',
  59             'name': wizard.display_name,
  60             'views': [(False, 'form')],
  61             'res_model': self._name,
  62             'res_id': wizard.id,
  63             'flags': {
  64                 'action_buttons': False,
  65                 'sidebar': False,
  66             },
  67         }
  68 
  69     @api.multi
  70     def select_lines(self):
  71         return {
  72             'type': 'ir.actions.act_window',
  73             'name': _('Select lines to purge'),
  74             'views': [(False, 'tree'), (False, 'form')],
  75             'res_model': self._fields['purge_line_ids'].comodel_name,
  76             'domain': [('wizard_id', 'in', self.ids)],
  77         }
  78 
  79     @api.multi
  80     def name_get(self):
  81         return [
  82             (this.id, self._description)
  83             for this in self
  84         ]
  85 
  86     @api.model
  87     def create(self, values):
  88         # make sure the user trying this is actually supposed to do it
  89         if not self.env.ref('database_cleanup.menu_database_cleanup')\
  90            .parent_id._filter_visible_menus():
  91             raise AccessDenied
  92         return super(PurgeWizard, self).create(values)
  93 
  94     purge_line_ids = fields.One2many('cleanup.purge.line', 'wizard_id')
  95
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/database_cleanup/models/purge_wizard.py b/database_cleanup/models/purge_wizard.py
  --- a/database_cleanup/models/purge_wizard.py
  +++ b/database_cleanup/models/purge_wizard.py
  @@ -24,8 +24,8 @@
       @api.model
       def create(self, values):
           # make sure the user trying this is actually supposed to do it
  -        if not self.env.ref('database_cleanup.menu_database_cleanup')\
  -           .parent_id._filter_visible_menus():
  +        if self.env.ref(
  +                'base.group_erp_manager') not in self.env.user.groups_id:
               raise AccessDenied
           return super(CleanupPurgeLine, self).create(values)
   
  @@ -86,8 +86,8 @@
       @api.model
       def create(self, values):
           # make sure the user trying this is actually supposed to do it
  -        if not self.env.ref('database_cleanup.menu_database_cleanup')\
  -           .parent_id._filter_visible_menus():
  +        if self.env.ref(
  +                'base.group_erp_manager') not in self.env.user.groups_id:
               raise AccessDenied
           return super(PurgeWizard, self).create(values)
  
verification_info: {"golden_diff": "diff --git a/database_cleanup/models/purge_wizard.py b/database_cleanup/models/purge_wizard.py\n--- a/database_cleanup/models/purge_wizard.py\n+++ b/database_cleanup/models/purge_wizard.py\n@@ -24,8 +24,8 @@\n     @api.model\n     def create(self, values):\n         # make sure the user trying this is actually supposed to do it\n-        if not self.env.ref('database_cleanup.menu_database_cleanup')\\\n-           .parent_id._filter_visible_menus():\n+        if self.env.ref(\n+                'base.group_erp_manager') not in self.env.user.groups_id:\n             raise AccessDenied\n         return super(CleanupPurgeLine, self).create(values)\n \n@@ -86,8 +86,8 @@\n     @api.model\n     def create(self, values):\n         # make sure the user trying this is actually supposed to do it\n-        if not self.env.ref('database_cleanup.menu_database_cleanup')\\\n-           .parent_id._filter_visible_menus():\n+        if self.env.ref(\n+                'base.group_erp_manager') not in self.env.user.groups_id:\n             raise AccessDenied\n         return super(PurgeWizard, self).create(values)\n", "issue": "Fix travis build on 9.0 branch\nthe 9.0 branch of the project is red, with really strange errors about computed fields. There have been such errors since the merge of #469 but for some reason they were neither fatal nor breaking the build. \n\nSplitting `database_cleanup` tests in .travis.yml seems to let the other modules go green, but the tests for database_cleanup are red. \n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# \u00a9 2014-2016 Therp BV <http://therp.nl>\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\nimport logging\nfrom openerp import _, api, fields, models\nfrom openerp.exceptions import AccessDenied\n\n\nclass CleanupPurgeLine(models.AbstractModel):\n    \"\"\" Abstract base class for the purge wizard lines \"\"\"\n    _name = 'cleanup.purge.line'\n    _order = 'name'\n\n    name = fields.Char('Name', readonly=True)\n    purged = fields.Boolean('Purged', readonly=True)\n    wizard_id = fields.Many2one('cleanup.purge.wizard')\n\n    logger = logging.getLogger('openerp.addons.database_cleanup')\n\n    @api.multi\n    def purge(self):\n        raise NotImplementedError\n\n    @api.model\n    def create(self, values):\n        # make sure the user trying this is actually supposed to do it\n        if not self.env.ref('database_cleanup.menu_database_cleanup')\\\n           .parent_id._filter_visible_menus():\n            raise AccessDenied\n        return super(CleanupPurgeLine, self).create(values)\n\n\nclass PurgeWizard(models.AbstractModel):\n    \"\"\" Abstract base class for the purge wizards \"\"\"\n    _name = 'cleanup.purge.wizard'\n    _description = 'Purge stuff'\n\n    @api.model\n    def default_get(self, fields_list):\n        res = super(PurgeWizard, self).default_get(fields_list)\n        if 'purge_line_ids' in fields_list:\n            res['purge_line_ids'] = self.find()\n        return res\n\n    @api.multi\n    def find(self):\n        raise NotImplementedError\n\n    @api.multi\n    def purge_all(self):\n        self.mapped('purge_line_ids').purge()\n        return True\n\n    @api.model\n    def get_wizard_action(self):\n        wizard = self.create({})\n        return {\n            'type': 'ir.actions.act_window',\n            'name': wizard.display_name,\n            'views': [(False, 'form')],\n            'res_model': self._name,\n            'res_id': wizard.id,\n            'flags': {\n                'action_buttons': False,\n                'sidebar': False,\n            },\n        }\n\n    @api.multi\n    def select_lines(self):\n        return {\n            'type': 'ir.actions.act_window',\n            'name': _('Select lines to purge'),\n            'views': [(False, 'tree'), (False, 'form')],\n            'res_model': self._fields['purge_line_ids'].comodel_name,\n            'domain': [('wizard_id', 'in', self.ids)],\n        }\n\n    @api.multi\n    def name_get(self):\n        return [\n            (this.id, self._description)\n            for this in self\n        ]\n\n    @api.model\n    def create(self, values):\n        # make sure the user trying this is actually supposed to do it\n        if not self.env.ref('database_cleanup.menu_database_cleanup')\\\n           .parent_id._filter_visible_menus():\n            raise AccessDenied\n        return super(PurgeWizard, self).create(values)\n\n    purge_line_ids = fields.One2many('cleanup.purge.line', 'wizard_id')\n", "path": "database_cleanup/models/purge_wizard.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# \u00a9 2014-2016 Therp BV <http://therp.nl>\n# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).\nimport logging\nfrom openerp import _, api, fields, models\nfrom openerp.exceptions import AccessDenied\n\n\nclass CleanupPurgeLine(models.AbstractModel):\n    \"\"\" Abstract base class for the purge wizard lines \"\"\"\n    _name = 'cleanup.purge.line'\n    _order = 'name'\n\n    name = fields.Char('Name', readonly=True)\n    purged = fields.Boolean('Purged', readonly=True)\n    wizard_id = fields.Many2one('cleanup.purge.wizard')\n\n    logger = logging.getLogger('openerp.addons.database_cleanup')\n\n    @api.multi\n    def purge(self):\n        raise NotImplementedError\n\n    @api.model\n    def create(self, values):\n        # make sure the user trying this is actually supposed to do it\n        if self.env.ref(\n                'base.group_erp_manager') not in self.env.user.groups_id:\n            raise AccessDenied\n        return super(CleanupPurgeLine, self).create(values)\n\n\nclass PurgeWizard(models.AbstractModel):\n    \"\"\" Abstract base class for the purge wizards \"\"\"\n    _name = 'cleanup.purge.wizard'\n    _description = 'Purge stuff'\n\n    @api.model\n    def default_get(self, fields_list):\n        res = super(PurgeWizard, self).default_get(fields_list)\n        if 'purge_line_ids' in fields_list:\n            res['purge_line_ids'] = self.find()\n        return res\n\n    @api.multi\n    def find(self):\n        raise NotImplementedError\n\n    @api.multi\n    def purge_all(self):\n        self.mapped('purge_line_ids').purge()\n        return True\n\n    @api.model\n    def get_wizard_action(self):\n        wizard = self.create({})\n        return {\n            'type': 'ir.actions.act_window',\n            'name': wizard.display_name,\n            'views': [(False, 'form')],\n            'res_model': self._name,\n            'res_id': wizard.id,\n            'flags': {\n                'action_buttons': False,\n                'sidebar': False,\n            },\n        }\n\n    @api.multi\n    def select_lines(self):\n        return {\n            'type': 'ir.actions.act_window',\n            'name': _('Select lines to purge'),\n            'views': [(False, 'tree'), (False, 'form')],\n            'res_model': self._fields['purge_line_ids'].comodel_name,\n            'domain': [('wizard_id', 'in', self.ids)],\n        }\n\n    @api.multi\n    def name_get(self):\n        return [\n            (this.id, self._description)\n            for this in self\n        ]\n\n    @api.model\n    def create(self, values):\n        # make sure the user trying this is actually supposed to do it\n        if self.env.ref(\n                'base.group_erp_manager') not in self.env.user.groups_id:\n            raise AccessDenied\n        return super(PurgeWizard, self).create(values)\n\n    purge_line_ids = fields.One2many('cleanup.purge.line', 'wizard_id')\n", "path": "database_cleanup/models/purge_wizard.py"}]}