Skip to content

Commit

Permalink
[MIG] event_registration_partner_unique: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinafernandez-tecnativa committed Oct 17, 2023
1 parent ad93b36 commit 31d9680
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
3 changes: 2 additions & 1 deletion event_registration_partner_unique/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 Tecnativa - Cristina Martin R.
# Copyright 2020 Tecnativa - Víctor Martínez
# Copyright 2023 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Unique Partner per Event",
"summary": "Enforces 1 registration per partner and event",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Marketing",
"website": "https://github.com/OCA/event",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
1 change: 1 addition & 0 deletions event_registration_partner_unique/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
* Cristina Martin R.
* Victor M.M. Torres
* Víctor Martínez
* Carolina Fernandez
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Cristina Martin R.</li>
<li>Victor M.M. Torres</li>
<li>Víctor Martínez</li>
<li>Carolina Fernandez</li>
</ul>
</blockquote>
</li>
Expand Down
20 changes: 11 additions & 9 deletions event_registration_partner_unique/tests/test_event.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# Copyright 2016 Antiun Ingeniería S.L. - Jairo Llopis
# Copyright 2020 Tecnativa - Víctor Martínez
# Copyright 2023 Tecnativa - Carolina Fernandez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase


class DuplicatedPartnerCase(TransactionCase):
def setUp(self):
super().setUp()
self.event = self.env.ref("event.event_0")
self.event.forbid_duplicates = False
self.partner = self.env.ref("base.res_partner_1")
self.registration = self.env["event.registration"].create(
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.event = cls.env.ref("event.event_0")
cls.event.forbid_duplicates = False
cls.partner = cls.env.ref("base.res_partner_1")
cls.registration = cls.env["event.registration"].create(
{
"event_id": self.event.id,
"partner_id": self.partner.id,
"attendee_partner_id": self.partner.id,
"event_id": cls.event.id,
"partner_id": cls.partner.id,
"attendee_partner_id": cls.partner.id,
}
)

Expand Down

0 comments on commit 31d9680

Please sign in to comment.