[REV] sale: partial revert of 34f2d0c267c54cce53b654b4d1c4228f1cd32c20
* the referenced commit didn't remove the used config parameter * it's quite dumb to stop considering the parameters of a db out of nowhere and force the usage of a specific template when a lot of databases were potentially using another one. This commit makes sure the parameter is still used when defined. It is set to the forced valued in the data by default anyway. task-2880950 closes odoo/odoo#97565 Related: odoo/upgrade#3965 Related: odoo/enterprise#30168 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -779,7 +779,16 @@ class SaleOrder(models.Model):
|
||||
|
||||
:return: `mail.template` record or None if default template wasn't found
|
||||
"""
|
||||
return self.env.ref('sale.mail_template_sale_confirmation', raise_if_not_found=False)
|
||||
self.ensure_one()
|
||||
default_confirmation_template_id = self.env['ir.config_parameter'].sudo().get_param(
|
||||
'sale.default_confirmation_template'
|
||||
)
|
||||
default_confirmation_template = default_confirmation_template_id \
|
||||
and self.env['mail.template'].browse(int(default_confirmation_template_id)).exists()
|
||||
if default_confirmation_template:
|
||||
return default_confirmation_template
|
||||
else:
|
||||
return self.env.ref('sale.mail_template_sale_confirmation', raise_if_not_found=False)
|
||||
|
||||
def action_quotation_sent(self):
|
||||
""" Mark the given draft quotation(s) as sent.
|
||||
|
||||
Reference in New Issue
Block a user