Files
odoo_source/addons
Sébastien Theys fd3febf7d7 [IMP] various: add event and ticket name on sale order and invoice line
In event_sale it is possible to have one product representing several tickets. But before this commit, on the sale order and invoice the client only saw the name of the product and didn't know which event/ticket they subscribed to.

The goal of this commit is to overwrite that behavior whenever a sale order or invoice line is related to an event ticket, to show the ticket name and event name instead of the product name.

Technically, the following changes have been done:

----------------------------------------

* various: add a method to compute a default name for a SaleOrderLine, based on its product

I added the method because the code to compute the name was duplicated in several places. This will make it more consistent.

Moreover this gives the option for modules to override the method to define a custom name as necessary.

----------------------------------------

* event_sale: compute a consistent description for a SaleOrderLine based on an EventTicket

The description will be the same whether the sale order comes from the front end or the back end. It takes into account the customer language.

The default description will be computed as follow:

1. The ticket name should be the first line of the product description on the SO.
2. The event name should be the second line of the product description on the SO.

To compute the ticket multi-line description we decided to ignore entirely the product name and the product description_sale because they are considered to be replaced by the ticket name and event name.

We also ignore them because the work-flow of creating a new event does not lead to filling them correctly, as the product is created through the event interface.

----------------------------------------

* event_sale: improve sale order line and event registration views

It was possible to select a ticket related to a product before an event was selected.
This is typically the case for tickets defined in an event_type but not in an event.

The ticket field is now hidden until both the product and the event have been selected.
This way we are sure the selected ticket will belong to an event and not an event_type.

We reset the ticket on event change because we don't want the user to be able to select a ticket belonging to the wrong event.

We also improve here the comments of the related on-change methods.

----------------------------------------

* website_event_sale: update views to show ticket name and event name

The standard behavior was to show the product name in several places instead of the sale order line description.

However, for event tickets, we don't want to show the product name, but the ticket name and event name instead.

----------------------------------------

* website_event_sale: add ticket on confirmation page

The ticket name was missing from the registration confirmation page (shown when the ticket is free and/or the user paid with a direct method). This is now fixed.

----------------------------------------

Task: 1837987
PR: 25819
2018-08-14 16:51:16 +02:00
..
2018-08-10 15:20:37 +02:00
2018-08-13 15:38:34 +02:00
2018-08-13 15:38:34 +02:00
2018-08-13 17:32:22 +02:00
2018-08-13 15:38:34 +02:00
2018-08-13 14:33:48 +02:00