Commit Graph
6 Commits
Author SHA1 Message Date
Martin Trigaux 03ff8d4d58 [FIX] *: retrieve model with sudo in selection fields 2021-08-10 13:49:04 +02:00
Thibault Delavallée efa161e25c [IMP] sms: make template required on preview template
It makes no sense to make it not required.

Task ID 1963529
Community PR odoo/odoo#32397
2020-03-24 10:25:07 +00:00
Thibault Delavallée 2835e0ba38 [MOV] mail, sms: move language computation in render mixin directly
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
2020-03-24 10:24:42 +00:00
Dharmraj Jhala 587a6bd9f6 [IMP] sms: improve SMS preview without existing record behavior and code
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>
2020-02-11 14:14:19 +00:00
RomainLibert dfd25263f8 [FIX] sms: avoid cache miss in compute
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

closes odoo/odoo#38546

X-original-commit: b96bb2a00737339dc53ff06167c1a0cd424ad717
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-11 21:48:31 +00:00
ryv-odoo 076e71cb5b [IMP] sms: allow to preview a sms template
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
2019-09-12 14:53:44 +00:00