Daily updates from Odoo
Monday, December 16, 2019
4 changes
Code cleanup and technical improvements
Mass mailing and SMS mailing setup fields now keep their values through stored editable computations instead of temporary form-change logic. This should preserve the same user experience while making mailing configuration more consistent, easier to maintain, and better covered by tests.
Original PR description
PURPOSE Try to move from onchange / default_get to stored editable computed fields. Normally behavior should be the same (computed or set by user), with support in create / write + onchange without…
PURPOSE Try to move from onchange / default_get to stored editable computed fields. Normally behavior should be the same (computed or set by user), with support in create / write + onchange without additional code. SPECIFICATIONS Update classic fields with onchange to stored editable computed fields. It means their value will come either from manual user input, either computed based on triggers. Purpose is to remove all onchange and default_get when possible. Clean fields definition inconsistencies, like default / required on computed fields. Indeed computed fields should always have a value, maybe coming from user input. They should not have default / required that are attributes for classic fields. Mailing domain computation is also cleaned and is now reset once the mailing domain is changed. Indeed trying to keep a previous domain based on try / except has no meaning from functional point of view. If model changes then domain should change as it is a business record, not just a technical domain to try to apply. Finally add some tests to help develop and maintain those fields computation. LINKS Task ID 2088577 PR #41877 Enterprise PR odoo/enterprise#7278
Mass mailing settings are now handled consistently at the data level instead of only when users edit forms. This reduces the risk of incorrect mailing behavior when records are created or updated outside the standard screens, including event and SMS mailing flows.
Original PR description
onchange acts only in views, to avoid future issue about that we cover the onchange behaviour with computed storable and not readonly fields. task-2088577
Marketing automation fields now rely on stored editable values that can be automatically calculated or manually set, replacing older form-only update logic. This should keep user behavior the same while making campaign and SMS activity data more consistent across creation, editing, and automation flows.
Original PR description
PURPOSE Try to move from onchange / default_get to stored editable computed fields. Normally behavior should be the same (computed or set by user), with support in create / write + onchange without additional code. SPECIFICATIONS Update classic fields with onchange to stored editable computed fields. It means their value will come either from manual user input, either computed based on triggers. Purpose is to remove all onchange and default_get when possible. Clean fields definition inconsistencies, like default / required on computed fields. Indeed computed fields should always have a value, maybe coming from user input. They should not have default / required that are attributes for classic fields. LINKS Task ID 2088577 PR #7278 Community PR odoo/odoo#41877
Marketing automation field updates now work consistently beyond screen-based editing. This reduces the risk of inconsistent campaign or SMS activity data when records are created or updated through other processes.
Original PR description
The onchange decorator works only with views,
to avoid future issues with that, we cover the
onchange behavior with computed storable and
writable fields (model level) for marketing_automation(_sms).
task-2088577