-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from Tecnativa/8.0-event_project-cancel
[IMP] event_project: Cancel project when cancelling event
- Loading branch information
Showing
5 changed files
with
44 additions
and
2 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
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
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_event_project |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import fields | ||
from openerp.tests import common | ||
|
||
|
||
class TestEventProject(common.TransactionCase): | ||
def setUp(self): | ||
super(TestEventProject, self).setUp() | ||
self.project = self.env['project.project'].create({ | ||
'name': 'Test project', | ||
}) | ||
self.event = self.env['event.event'].create({ | ||
'name': 'Test event', | ||
'date_begin': fields.Datetime.now(), | ||
'date_end': fields.Datetime.now(), | ||
'project_id': self.project.id, | ||
}) | ||
|
||
def test_cancel_event(self): | ||
self.event.button_cancel() | ||
self.assertEqual(self.project.state, 'cancelled') |