-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] viin_brand_mail: fix runbot when debranding odoo bot
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
from . import models | ||
from . import wizard | ||
from odoo.tests.common import TransactionCase | ||
setupTransactionCase = TransactionCase.setUp | ||
|
||
|
||
def _setupTransactionCase_plus(self): | ||
"""Odoo has some test cases to check the return value when the Odoo bot performs an action | ||
Some tests like: | ||
- test_manual_revaluation_statement | ||
Therefore, it is necessary to check if the Odoo bot is being rebranded as the Viindoo bot | ||
Change the name and email of the Odoo bot if necessary | ||
""" | ||
res = setupTransactionCase(self) | ||
bot = self.env.ref('base.partner_root', raise_if_not_found=False) | ||
if bot.name == 'ViindooBot' or bot.email == '[email protected]': | ||
bot.write({ | ||
'name': 'OdooBot', | ||
'email': '[email protected]' | ||
}) | ||
return res | ||
|
||
|
||
def _post_init_hook(env): | ||
TransactionCase.setUp = _setupTransactionCase_plus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters