Coverage for ingadhoc-odoo-saas-adhoc / saas_provider_upgrade / controllers / ir_attachment.py: 33%

7 statements  

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

1from odoo.addons.html_editor.controllers.main import HTML_Editor 

2 

3 

4class HTML_EditorUpgrade(HTML_Editor): 

5 def _attachment_create(self, name="", data=False, url=False, res_id=False, res_model="ir.ui.view"): 

6 """ 

7 Inherit the _attachment_create method to set the public field to True if res_model is "saas.upgrade.line" 

8 """ 

9 attachment = super()._attachment_create(name=name, data=data, url=url, res_id=res_id, res_model=res_model) 

10 if res_model == "saas.upgrade.line": 

11 attachment.sudo().write( 

12 { 

13 "public": True, 

14 } 

15 ) 

16 return attachment