[FIX] event_sale: correctly use event_ok instead of event_id for event-based SO lines
When confirming a sale.order that includes a product that is either an event registration or an event stand it shows the event edit registration wizard which has no sense for the event stand part. Fix the event_configurator_tour since the autocomplete showed the wrong product at the first place. The test was based on the event_id field of the sale.order.line but should be based on the event_ok field instead. Also add more text to the tour so the autocomplete shows the right product at first place. LINKS Task ID-2318655 Task ID-2558875 PR odoo/odoo#71787
This commit is contained in:
committed by
Thibault Delavallée
parent
819725c725
commit
54e8a81809
@@ -23,7 +23,7 @@ class SaleOrder(models.Model):
|
||||
for so in self:
|
||||
# confirm registration if it was free (otherwise it will be confirmed once invoice fully paid)
|
||||
so.order_line._update_registrations(confirm=so.amount_total == 0, cancel_to_draft=False)
|
||||
if any(line.event_id for line in so.order_line):
|
||||
if any(line.event_ok for line in so.order_line):
|
||||
return self.env['ir.actions.act_window'] \
|
||||
.with_context(default_sale_order_id=so.id) \
|
||||
._for_xml_id('event_sale.action_sale_order_event_registration')
|
||||
@@ -74,7 +74,7 @@ class SaleOrderLine(models.Model):
|
||||
RegistrationSudo = self.env['event.registration'].sudo()
|
||||
registrations = RegistrationSudo.search([('sale_order_line_id', 'in', self.ids)])
|
||||
registrations_vals = []
|
||||
for so_line in self.filtered('event_id'):
|
||||
for so_line in self.filtered('event_ok'):
|
||||
existing_registrations = registrations.filtered(lambda self: self.sale_order_line_id.id == so_line.id)
|
||||
if confirm:
|
||||
existing_registrations.filtered(lambda self: self.state not in ['open', 'cancel']).action_confirm()
|
||||
|
||||
@@ -20,7 +20,7 @@ tour.register('event_configurator_tour', {
|
||||
}, {
|
||||
trigger: 'div[name="product_id"] input, div[name="product_template_id"] input',
|
||||
run: function (actions) {
|
||||
actions.text('Event');
|
||||
actions.text('Event Registration');
|
||||
}
|
||||
}, {
|
||||
trigger: 'ul.ui-autocomplete a:contains("Event")',
|
||||
|
||||
Reference in New Issue
Block a user