Standard
', + }) + cls.event_booth_category_2 = cls.env['event.booth.category'].create({ + 'name': 'Premium', + 'description': 'Premium
', + }) diff --git a/tests/test_event_booth_internals.py b/tests/test_event_booth_internals.py new file mode 100644 index 0000000..d20c8a9 --- /dev/null +++ b/tests/test_event_booth_internals.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from datetime import datetime, timedelta + +from odoo.addons.event_booth.tests.common import TestEventBoothCommon +from odoo.fields import Datetime as FieldsDatetime +from odoo.tests.common import users, tagged + + +@tagged('post_install', '-at_install', 'event_booth') +class TestEventData(TestEventBoothCommon): + + @users('user_eventmanager') + def test_event_booth_contact(self): + """ Test contact details computation """ + customer = self.env['res.partner'].browse(self.event_customer.ids) + category = self.env['event.booth.category'].browse(self.event_booth_category_1.ids) + self.assertTrue(all( + bool(customer[fname]) + for fname in ['name', 'email', 'country_id', 'phone'] + ) + ) + customer_email = customer.email + + event = self.env['event.event'].create({ + 'name': 'Event', + 'date_begin': FieldsDatetime.to_string(datetime.today() + timedelta(days=1)), + 'date_end': FieldsDatetime.to_string(datetime.today() + timedelta(days=15)), + 'event_type_id': False, + }) + self.assertEqual(event.event_booth_ids, self.env['event.booth']) + + booth = self.env['event.booth'].create({ + 'name': 'Test Booth', + 'booth_category_id': category.id, + 'event_id': event.id, + 'partner_id': customer.id, + }) + self.assertEqual(booth.contact_name, customer.name) + self.assertEqual(booth.contact_email, customer_email) + self.assertEqual(booth.contact_phone, customer.phone) + + booth.write({ + 'contact_email': '"New Emails"+ Create a Booth Category +
++ Booth categories are used to represent the different types of booths you rent (Premium Booth, Table and Chairs, ...) +
++ Create a Booth +
+ Booths are the physical stands that you rent during your event. +
++ Create a Booth +
+ Booths are the physical stands that you rent during your event. +
++ Create a Type Booth +
+ Booths are the physical stands that you rent during your event. +
+