diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-11-03 17:09:24 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-11-03 17:09:24 +0700 |
| commit | 03dfa0271a0da453c83de83c73398dabb0e16fc7 (patch) | |
| tree | aa0e6ad88df68c9b54d790b907396a227883fea8 /indoteknik_api/models | |
| parent | 7f0ba3734ffbfa22813e199fbf8a556750a350f7 (diff) | |
Get manufacture API
Diffstat (limited to 'indoteknik_api/models')
| -rw-r--r-- | indoteknik_api/models/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_api/models/x_manufactures.py | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/indoteknik_api/models/__init__.py b/indoteknik_api/models/__init__.py index de2a2804..bca7d9fe 100644 --- a/indoteknik_api/models/__init__.py +++ b/indoteknik_api/models/__init__.py @@ -1,3 +1,4 @@ from . import blog_post from . import product_pricelist from . import product_template +from . import x_manufactures
\ No newline at end of file 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 |
