Skip to content

Commit 9daf9f4

Browse files
committed
Merge PR #412 into 16.0
Signed-off-by rafaelbn
2 parents d829a40 + eb954f9 commit 9daf9f4

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

partner_event/README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
112112
mission is to support the collaborative development of Odoo features and
113113
promote its widespread use.
114114

115+
.. |maintainer-yajo| image:: https://github.com/yajo.png?size=40px
116+
:target: https://github.com/yajo
117+
:alt: yajo
118+
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
119+
:target: https://github.com/rafaelbn
120+
:alt: rafaelbn
121+
122+
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
123+
124+
|maintainer-yajo| |maintainer-rafaelbn|
125+
115126
This module is part of the `OCA/event <https://github.com/OCA/event/tree/16.0/partner_event>`_ project on GitHub.
116127

117128
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

partner_event/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"views/event_registration_view.xml",
2525
"wizard/res_partner_register_event_view.xml",
2626
],
27+
"maintainers": ["yajo", "rafaelbn"],
2728
"post_init_hook": "post_init_hook",
2829
"installable": True,
2930
}

partner_event/models/res_partner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ def write(self, data):
4242
def address_get(self, adr_pref=None):
4343
attendee_partner = self.env.context.get("get_attendee_partner_address", False)
4444
if attendee_partner:
45-
return super(ResPartner, attendee_partner).address_get(adr_pref)
45+
return {adr_pref: attendee_partner}
4646
return super(ResPartner, self).address_get(adr_pref)

partner_event/static/description/index.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -446,10 +447,14 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
446447
<div class="section" id="maintainers">
447448
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
448449
<p>This module is maintained by the OCA.</p>
449-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
450+
<a class="reference external image-reference" href="https://odoo-community.org">
451+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
452+
</a>
450453
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
451454
mission is to support the collaborative development of Odoo features and
452455
promote its widespread use.</p>
456+
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
457+
<p><a class="reference external image-reference" href="https://github.com/yajo"><img alt="yajo" src="https://github.com/yajo.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/rafaelbn"><img alt="rafaelbn" src="https://github.com/rafaelbn.png?size=40px" /></a></p>
453458
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/16.0/partner_event">OCA/event</a> project on GitHub.</p>
454459
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
455460
</div>

partner_event/tests/test_event_registration.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
from psycopg2 import IntegrityError
1111

1212
from odoo import fields
13-
from odoo.tests import common
13+
from odoo.tests import Form, common
14+
from odoo.tools import mute_logger
1415

1516

1617
class TestEventRegistration(common.TransactionCase):
@@ -95,6 +96,7 @@ def test_data_update(self):
9596
self.partner_01.write({"email": "[email protected]"})
9697
self.assertEqual(event_2.registration_ids.email, "[email protected]")
9798

99+
@mute_logger("odoo.sql_db")
98100
def test_delete_registered_partner(self):
99101
# We can't delete a partner with registrations
100102
with self.assertRaises(IntegrityError), self.cr.savepoint():
@@ -104,3 +106,17 @@ def test_delete_registered_partner(self):
104106
partner3 = self.env["res.partner"].create({"name": "unregistered partner"})
105107
partner3.unlink()
106108
self.assertFalse(partner3.exists())
109+
110+
def test_attendee_partner_is_not_contact(self):
111+
# Create a partner that belongs to a company but is saved as "other address"
112+
self.partner_01.type = "other"
113+
self.partner_01.parent_id = self.env["res.partner"].create(
114+
{"name": "Company", "is_company": True}
115+
)
116+
# The partner gets registered
117+
with Form(self.registration_01) as reg_f:
118+
reg_f.attendee_partner_id = self.partner_01
119+
# Partner data inherited in registration
120+
self.assertEqual(self.registration_01.name, self.partner_01.name)
121+
self.assertEqual(self.registration_01.email, self.partner_01.email)
122+
self.assertEqual(self.registration_01.phone, self.partner_01.phone)

0 commit comments

Comments
 (0)