summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/x_manufactures.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_api/models/x_manufactures.py')
-rw-r--r--indoteknik_api/models/x_manufactures.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/indoteknik_api/models/x_manufactures.py b/indoteknik_api/models/x_manufactures.py
new file mode 100644
index 00000000..6755ac66
--- /dev/null
+++ b/indoteknik_api/models/x_manufactures.py
@@ -0,0 +1,14 @@
+from odoo import models
+
+
+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 '',
+ 'name': manufacture.x_name,
+ }
+ return data \ No newline at end of file