Coverage for ingadhoc-account-payment / account_payment_pro / __init__.py: 79%

13 statements  

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

1from . import models 

2from . import wizards 

3 

4 

5def _update_payment_receipt_template(env): 

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

7 if template: 7 ↛ exitline 7 didn't return from function '_update_payment_receipt_template' because the condition on line 7 was always true

8 template.write( 

9 { 

10 "body_html": """<div style="margin: 0px; padding: 0px;"> 

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

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

13 Thank you for your payment. 

14 Here is your payment receipt <span style="font-weight:bold;" t-out="(object.name or '').replace('/','-') or ''">BNK1-2021-05-0002</span> amounting 

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

16 <br/><br/> 

17 Do not hesitate to contact us if you have any questions. 

18 <br/><br/> 

19 Best regards, 

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

21 <br/><br/> 

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

23 </t> 

24 </p> 

25 </div> 

26 """, 

27 } 

28 ) 

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

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

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

32 Gracias por su pago. 

33 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 

34 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>. 

35 <br/><br/> 

36 No dude en contactarnos si tiene alguna pregunta. 

37 <br/><br/> 

38 Saludos, 

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

40 <br/><br/> 

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

42 </t> 

43 </p> 

44 </div> 

45 """ 

46 

47 if env["res.lang"].search([("code", "=", "es_419")]): 47 ↛ 49line 47 didn't jump to line 49 because the condition on line 47 was always true

48 template.with_context(lang="es_419").write({"body_html": text_es}) 

49 if env["res.lang"].search([("code", "=", "es_AR")]): 49 ↛ 50line 49 didn't jump to line 50 because the condition on line 49 was never true

50 template.with_context(lang="es_AR").write({"body_html": text_es}) 

51 

52 

53def _post_init_hooks(env): 

54 _update_payment_receipt_template(env)