summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/ir_attachment.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-07-24 08:38:12 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-07-24 08:38:12 +0000
commitc344ccd81208b5b466ae047dbb9e084dd5d0f358 (patch)
treec07caf6a1df48719b828fbe270bb62ccc3e0c947 /indoteknik_custom/models/ir_attachment.py
parent989002aca3ed9b1e724e9b98d8ca3513ba598663 (diff)
parent2ad6b4ecf783b5dfe0d4aa11f238cbf6aefd9747 (diff)
Merged in production (pull request #66)
Production
Diffstat (limited to 'indoteknik_custom/models/ir_attachment.py')
-rw-r--r--indoteknik_custom/models/ir_attachment.py5
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