diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-24 13:43:53 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-24 13:43:53 +0700 |
| commit | 92c97849b0755ab3396508fc6e6d5a12380bc549 (patch) | |
| tree | 5d5942199a1f15916fb4ac95a9fb130d856b515f /indoteknik_custom/models/ir_attachment.py | |
| parent | 4f743b1b2aa7001466404ebef0516fded12d674d (diff) | |
| parent | c1ac22304b557b9982b5fb79d23d29b6faf48090 (diff) | |
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/ir_attachment.py')
| -rw-r--r-- | indoteknik_custom/models/ir_attachment.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/ir_attachment.py b/indoteknik_custom/models/ir_attachment.py index fd86ab1b..6417fa3f 100644 --- a/indoteknik_custom/models/ir_attachment.py +++ b/indoteknik_custom/models/ir_attachment.py @@ -22,4 +22,9 @@ class Attachment(models.Model): def api_image(self, model, field, id): base_url = self.env['ir.config_parameter'].get_param('web.base.url') is_found = self.is_found(model, field, id) + return base_url + 'api/image/' + model + '/' + field + '/' + str(id) if is_found else '' + + def api_image_local(self, model, field, id): + base_url = self.env['ir.config_parameter'].get_param('web.base.local_url') + is_found = self.is_found(model, field, id) return base_url + 'api/image/' + model + '/' + field + '/' + str(id) if is_found else ''
\ No newline at end of file |
