Skip to content

Commit

Permalink
[FIX] partner_event: recover missing functionality
Browse files Browse the repository at this point in the history
In previous versions it was possible to use the registration wizard from
the attendees list. This commit recovers it.

TT45692
  • Loading branch information
chienandalu committed Oct 26, 2023
1 parent 0fd0ce3 commit 36c5b0b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 10 additions & 3 deletions partner_event/wizard/res_partner_register_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ def _prepare_registration(self, partner):
def button_register(self):
vals_list = []
Registration = self.env["event.registration"]
for partner in self.env["res.partner"].browse(
self.env.context.get("active_ids", [])
):
active_ids = self.env.context.get("active_ids", [])
if self.env.context.get("active_model", "") == "event.registration":
partners = (

Check warning on line 36 in partner_event/wizard/res_partner_register_event.py

View check run for this annotation

Codecov / codecov/patch

partner_event/wizard/res_partner_register_event.py#L36

Added line #L36 was not covered by tests
self.env["event.registration"]
.browse(active_ids)
.mapped("attendee_partner_id")
)
else:
partners = self.env["res.partner"].browse(active_ids)
for partner in partners:
if not Registration.search(
[
("event_id", "=", self.event.id),
Expand Down
8 changes: 8 additions & 0 deletions partner_event/wizard/res_partner_register_event_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,12 @@
<field name="binding_model_id" ref="base.model_res_partner" />
<field name="target">new</field>
</record>
<record id="action_partner_register_event" model="ir.actions.act_window">
<field name="name">Register in an event</field>
<field name="res_model">res.partner.register.event</field>
<field name="view_mode">form</field>
<field name="view_id" ref="res_partner_register_event_view" />
<field name="binding_model_id" ref="partner_event.model_event_registration" />
<field name="target">new</field>
</record>
</odoo>

0 comments on commit 36c5b0b

Please sign in to comment.