summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-02-19 15:16:19 +0000
committerThibault Delavallée <tde@odoo.com>2020-03-10 11:15:09 +0000
commit968ef0223f43f454946613e8bee27a4275615d32 (patch)
treed77f100ffd692b98b62c7a86da7ad893cf02d3f2 /addons/web/static/src/js/fields/basic_fields.js
parent7666f97693645ac3c6139089ed01ac411347af97 (diff)
[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
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions