Coverage for ingadhoc-account-payment / account_payment_pro / models / base_language_install.py: 21%

13 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-09 19:54 +0000

1from odoo import models 

2 

3 

4class BaseLanguageInstall(models.TransientModel): 

5 _inherit = "base.language.install" 

6 

7 def lang_install(self): 

8 res = super().lang_install() 

9 

10 es_langs = self.lang_ids.filtered(lambda x: x.code in ["es_419", "es_AR"]) 

11 if es_langs: 

12 template = self.env.ref("account.mail_template_data_payment_receipt", raise_if_not_found=False) 

13 if template: 

14 text_es = """<div style="margin: 0px; padding: 0px;"> 

15 <p style="margin: 0px; padding: 0px; font-size: 13px;"> 

16 Apreciable <t t-out="object.partner_id.name or ''">Azure Interior</t><br/><br/> 

17 Gracias por su pago. 

18 Aquí está el recibo de su pago <span style="font-weight:bold;" t-out="(object.name or '').replace('/','-') or ''">BNK1-2021-05-0002</span> por un total 

19 de <span style="font-weight:bold;" t-out="format_amount(object.payment_total, object.currency_id) or ''">$ 10.00</span> de <t t-out="object.company_id.name or ''">SuEmpresa</t>. 

20 <br/><br/> 

21 No dude en contactarnos si tiene alguna pregunta. 

22 <br/><br/> 

23 Saludos, 

24 <t t-if="not is_html_empty(user.signature)"> 

25 <br/><br/> 

26 <t t-out="user.signature or ''">--<br/>Mitchell Admin</t> 

27 </t> 

28 </p> 

29 </div> 

30 """ 

31 for lang in es_langs: 

32 template.with_context(lang=lang.code).write({"body_html": text_es}) 

33 

34 return res