PURPOSE
Merge rendering tools used in mail and sms templates as well as partially
in mailings and move them directly in mail.render.mixin.
SPECIFICATIONS
Move tools related to language computation from mail.template model to the
mail.render.mixin. It allows to update both
* mail.template: simply update calls accordingly;
* sms.template: remove code doing what is now available through mail.render
.mixin inherit;
Lang field is moved to mail.render.mixin as it is used notably for the language
computation. It therefore adds the field on mailing.mailing model although
not used currently.
LINKS
Task ID 1963529
Community PR odoo/odoo#32397
This commit clean-ups the code for model `sms.template.preview` which
mainly includes the following changes :
* remove 'res_id' field and use only the reference field instead;
* remove inheritance from `sms.template` as we only need a body field
computed based on record and template;
* convert onchange of lang / record to compute field for body;
* fix 'No Records' warning which previously appeared even if there were
records to be previewed (by adding compute field 'no_records');
LINKS
TaskID 2180132
Community PR odoo/odoo#44104
Upgrade PR odoo/upgrade#763
Related: odoo/upgrade#763
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
We should always ensure to assign something in a compute method
Since sms_template_id is not required, we have to check that it is set
before trying to render the template
Also make sure to have a default value in case you don't have a res_id
closesodoo/odoo#38546
X-original-commit: b96bb2a00737339dc53ff06167c1a0cd424ad717
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Add a way for the user to preview sms content from a sms
template depending of a record (targeted model) and the
installed languages (as for the mail template). Add button
to open this preview on the form of the sms template.
TASK_ID : 2053631