-
- Downloads
[REF] website_event(_track/_question) : move from onchange / default to stored...
[REF] website_event(_track/_question) : move from onchange / default to stored editable computed fields PURPOSE Try to move from onchange / default_get to stored editable computed fields. Behavior should be the same (computed or set by user), with support of create / write / onchange field update without additional code. SPECIFICATIONS: GLOBAL RULES Update classic fields updated in some cases by onchange and/or default methods by fields with store=True, readonly=False. It means their value comes either from manual user input, either from trigger based computation. Remove onchange and default_get when possible, leading to an unique computation method and clearing fields definition. Also clean some fields definition inconsistencies, notably required fields that should instead be correctly computed or default that have no real meaning. SPECIFICATIONS: WEBSITE_TRACK(_PROPOSAL) Keep an explicit onchange for tick / untick of website_track_proposal. Indeed otherwise you have a loop of dependencies between website_track and website_track_proposal * untick website_track: website_track_proposal = False (done in _compute_website_track_proposal) * tick website_track: no effect * untick website_track_proposal: no effect * tick website_track_proposa: website_track = True It would be complicated to write in computed fields, as they depend on each other, on cache and current values, ... It is therefore simpler to keep an onchange: when ticking website_track_proposal set website_track as True in interface. LINKS Task ID 2089156 Community PR odoo/odoo#42911
Showing
- addons/website_event/models/event_event.py 2 additions, 3 deletionsaddons/website_event/models/event_event.py
- addons/website_event_track/models/event_event.py 58 additions, 36 deletionsaddons/website_event_track/models/event_event.py
- addons/website_event_track/models/event_track.py 17 additions, 10 deletionsaddons/website_event_track/models/event_track.py
Please register or sign in to comment