[FIX] event_sale: registration data on portal confirmation
When a customer with a sale portal link confirms the order, the
registrations in the order won't have the data for the partner of the
order which would be the expected default.
In 6cfdf64a86 the intention is to avoid
that registrations made on the website by anonymous users are registered
with the public user. There's a side effect to this in the portal
workflow though.
We can reproduce it like this:
- We need a payment aqcquire wich confirms our sale order (we can use
payment demo)
- In backend, create a sale order with the desired partner and a
registration to an event.
- Send the quotation to the partner.
- With the link portal (and without being logged in) sign and pay the
order with the demo payment aquirer.
Result:
- The order gets confirmed.
- The registrations are created with no partner (booked by).
So this fix avoids the original issue (having a public user as the
registration partner) but saving the case where we are confident about
the booked by value.
TT44782
closes odoo/odoo#148758
X-original-commit: 28020f2046b0183293a06ab03d4724173e3a0fa0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -105,7 +105,8 @@ class EventRegistration(models.Model):
|
||||
def _synchronize_so_line_values(self, so_line):
|
||||
if so_line:
|
||||
return {
|
||||
'partner_id': False if self.env.user._is_public() else so_line.order_id.partner_id.id,
|
||||
# Avoid registering public users but respect the portal workflows
|
||||
'partner_id': False if self.env.user._is_public() and self.env.user.partner_id == so_line.order_id.partner_id else so_line.order_id.partner_id.id,
|
||||
'event_id': so_line.event_id.id,
|
||||
'event_ticket_id': so_line.event_ticket_id.id,
|
||||
'sale_order_id': so_line.order_id.id,
|
||||
|
||||
Reference in New Issue
Block a user