Swapnesh Shah a60447807d [FIX] event_sale: flush out fields to recompute state correctly
Before this commit, the values of these 3 fields in database may be
desynchronised with the one set in the cache by the ORM but not
commited yet.

Before this commit, when confirming an attendee, the count was not
correctly recomputed. '_compute_seats' was triggerd when changing the
state of the registration but the value of 'state' was still the one
before the confirmation, making the sum outdated.

Note that two constraints are raised when modifying the field state:
- _check_seats_limit
- _check_ticket_seats_limit

If _check_seats_limit is executed first, the bug does not occures
because it first triggers the '_compute_seats' method on event.event
model, which has a correct flush method.

If _check_ticket_seats_limit is executed first, the bug occures
because the '_compute_seats' of event.registration is triggered first,
which did not have the flush implemented.

Fixes odoo/odoo#38340

closes odoo/odoo#39677

X-original-commit: 46b168139e6043f5b5d7cc81a2bec62ef346fcd0
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-31 17:21:01 +00:00
…
2019-10-03 12:48:09 +00:00
…
…
2019-10-03 12:48:09 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%