Daily updates from Odoo
Tuesday, March 24, 2020
2 changes · master
Code cleanup and technical improvements
Email, SMS, and related communication templates now use a shared rendering service instead of separate internal paths. This simplifies maintenance and keeps link handling and shortening consistent across affected business apps, with no intended change for end users.
Original PR description
PURPOSE Merge rendering tools used in mail and sms templates and move them directly in mail.render.mixin SPECIFICATIONS Clean rendering methods API and calls. Ensure they are private. Improve naming and docstrings to ease understanding. Move rendering methods on mail.render.mixin. It makes no senss to have to create a void mail.template recordset just to invoke jinjna rendering engine. Now rendering will be available * either directly through inherit; * either by calling env['mail.render.mixin']._render_template(); Move local to global links convertion as well as links shortening tool methods on mail.render.mixin . That way this mixin holds tools related to rendering and its post-processing. This impacts mail.template, sms.template and mailing.mailing as side effect without any functional change. LINKS Task ID 1963529 Community PR odoo/odoo#32397 Enterprise PR odoo/enterprise#8634 Upgrade PR odoo/upgrade#911
CRM lead and sales team fields now update through a more consistent stored-field approach instead of separate onchange/default logic. This should preserve existing behavior while making lead assignment, conversion flows, and website CRM scoring easier to maintain and more reliable.
Original PR description
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…
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. USE EDITABLE STORED FIELDS 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. CLEAN MODELS IN WEBSITE CRM SCORE Purpose of this merge is also to clean models in website crm score. Future tasks will improve the use of sales team in crm and first steps is to clean a bit models linked to sales team. LINKS Task ID 2088565 (crm: from onchange to compute) Community PR odoo/odoo#41955 Enterprise PR odoo/enterprise#7322 Upgrade PR odoo/upgrade#781