summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/x_manufactures.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-01-23 09:20:18 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-01-23 09:20:18 +0000
commitda5f5134f56b2ccf1c1de16c3f7616ab3719f3ea (patch)
treebc1bcb4fb00f2659be81810d528a9cf2cc6ce20d /indoteknik_api/models/x_manufactures.py
parente52cf84fd2284330412162b44066f29bd382f590 (diff)
parent8af5ee591aabc2d5d946c0eece93a5caab989975 (diff)
Merged in release (pull request #27)
Release
Diffstat (limited to 'indoteknik_api/models/x_manufactures.py')
-rw-r--r--indoteknik_api/models/x_manufactures.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/indoteknik_api/models/x_manufactures.py b/indoteknik_api/models/x_manufactures.py
index 19fdcb9c..988d7a45 100644
--- a/indoteknik_api/models/x_manufactures.py
+++ b/indoteknik_api/models/x_manufactures.py
@@ -8,16 +8,16 @@ class Manufactures(models.Model):
base_url = self.env['ir.config_parameter'].get_param('web.base.url')
data = {
'id': manufacture.id,
- 'logo': base_url + 'api/image/x_manufactures/x_logo_manufacture/' + str(manufacture.id) if manufacture.x_logo_manufacture else '',
+ 'logo': self.env['ir.attachment'].api_image('x_manufactures', 'x_logo_manufacture', manufacture.id),
'name': manufacture.x_name
}
if with_detail:
data_with_detail = {
'description': manufacture.x_short_desc,
'banners': [
- base_url + 'api/image/x_banner.banner/x_banner_image/' + str(x.id)
+ self.env['ir.attachment'].api_image('x_banner.banner', 'x_banner_image', x.id)
for x in manufacture.x_manufactures_banners
- if x.x_status_banner == 'tayang' and x.x_banner_image
+ if x.x_status_banner == 'tayang'
]
}
data.update(data_with_detail)