Files
odoo_source/addons/event/data
Sébastien Mottet (oms)andThibault Delavallée be11161a42 [FIX] event(_questions): take better care of 2many fields when updating from event type
PURPOSE

Fix various issues spotted in 13.3 when testing event. Notably
computation of 2many fields coming from template.

SPECIFICATIONS

When updating template on an event, one2many fields should be better managed.
Previous heuristic was

  * if event type uses o2m configuration (use_ticket / _schedule / _question)
    and has lines

   * erase existing lines;
   * create new lines based on old one;

This has the drawback of loosing information of what is sent (mail) or
sold (tickets) or answered( questions). Another drawback is that only
types having line are synchronized. This means that if updating several
times the event type you could end up with an XMas configuration with
lines coming from different event types, depending on their o2m configuration.

We choose a better heuristic that should solve this issue

  * every time we change type, independently of its use_* field that is used
    mainly for UX on the type itself:

    * erase existing lines that have not been used yet (no mail sent, no
      ticket linked to registrations, no answer linked to registrations)
    * create new lines based on old one; if type has no lines, event will
      have its old empty line erased as well;

It means that we try to synchronize more the type to the event while keeping
configuration line already used in some registrations.

Also provide some other fixes like deletion restrictions or better domain
for UX purpose. See sub commits for more details.

LINKS

Task ID 2244487
PR odoo/odoo#52998
FwdPort of odoo/odoo#52923

X-original-commit: 645f70cad033083e82a3ef9102c694c331badef9
Co-authored-by: Sebastien Mottet <oms@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-06-16 09:14:31 +00:00
..