Coverage for ingadhoc-odoo-saas / saas_client / models / ir_attachment.py: 46%

18 statements  

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

1import os 

2 

3from odoo import api, models 

4 

5 

6class IrAttachment(models.Model): 

7 _inherit = "ir.attachment" 

8 

9 @api.autovacuum 

10 def _gc_file_store(self): 

11 assert isinstance(self, IrAttachment) 

12 if os.environ.get("ADHOC_ODOO_STORAGE_MODE") == "fuse": 

13 return 

14 super()._gc_file_store() 

15 

16 def _mark_for_gc(self, fname): 

17 if os.environ.get("ADHOC_ODOO_STORAGE_MODE") == "fuse": 17 ↛ 18line 17 didn't jump to line 18 because the condition on line 17 was never true

18 return 

19 super()._mark_for_gc(fname) 

20 

21 def _gc_file_store_unsafe(self): 

22 if os.environ.get("ADHOC_ODOO_STORAGE_MODE") == "fuse": 

23 return 

24 super()._gc_file_store_unsafe()