summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/x_manufactures.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-01-24 11:43:52 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-01-24 11:43:52 +0700
commit2a3a0a7e88ef24456eeda070a7d74f1457efdb18 (patch)
tree2bb4cd374d46b5d5e4fb6e32fe239c5ccc83daf4 /indoteknik_api/models/x_manufactures.py
parent287cf8497b4b6bb825870ee2b3d1b49d4c29ab6a (diff)
parent646b9e22fc11f6f1d1b556761a3df2df61f8f59b (diff)
Merge branch 'release' into staging
Diffstat (limited to 'indoteknik_api/models/x_manufactures.py')
-rw-r--r--indoteknik_api/models/x_manufactures.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/indoteknik_api/models/x_manufactures.py b/indoteknik_api/models/x_manufactures.py
index 19fdcb9c..b85f6d27 100644
--- a/indoteknik_api/models/x_manufactures.py
+++ b/indoteknik_api/models/x_manufactures.py
@@ -5,19 +5,18 @@ class Manufactures(models.Model):
_inherit = 'x_manufactures'
def api_single_response(self, manufacture, with_detail=False):
- 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)