Skip to content
Snippets Groups Projects
Commit bee8ac5c authored by nie's avatar nie
Browse files

[FIX] event_sale: ticket price with pricelist

Steps:
- Install Events
- Go to Events / Configuration / Settings
- Enable Tickets
- Go to Sales / Configuration / Settings
- Enable Multiple Sales Prices per Product
- Go to Sales / Products
- Edit Event Registration
  - Sales tab
    - Pricing
      - Pricelist: Public Pricelist (USD)
      - Price: $6
- Go to Sales
- Create a new quotation
  - Pricelist: Public Pricelist (USD)
  - Product: Event Registration
  - Event: Design Fair
  - Ticket: VIP

Bug:
The pricelist is not taken into account. Unit price should be $900 but
is $1500.

Explanation:
The original issue comes from this commit: https://github.com/odoo/odoo/commit/379f1490c93dc599a74add2d678c18fbba1efa62
The advertised amount was not the one showing up in the cart. This is
because the pricelist was not taken into account anymore when entering
the payment process.

Using `price_reduce` instead of `price` enables all kinds of discounts
on the final price.
However, `price_reduce` relies on the context to find the current
pricelist.
This commit adds the context needed to compute the price of the tickets.
This context is the same as the one in the sales module since pricelists
are working fine there: https://github.com/odoo/odoo/blob/b208570ce8399bc6d3e4a8ba02eef6558e0a6ccc/addons/sale/models/sale.py#L1494



The currency conversion is done in `product.price`. It's therefore
already done when calling `price_reduce`.

opw:2519453

closes odoo/odoo#71114

X-original-commit: e92282f7
Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
parent ed723be9
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment