diff options
| author | Swapnesh Shah <swapneshshah111@gmail.com> | 2019-10-16 20:53:14 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-10-31 17:21:01 +0000 |
| commit | a60447807da8495877cc535b098e8628379bbe91 (patch) | |
| tree | efb5d0f1077175d1d39f2ed0c0369253527cf58a /doc/reference/javascript_reference.rst | |
| parent | 53902e8d765f4d1a2c3ebba43892b91c01d058f3 (diff) | |
[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>
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions
