summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/x_manufactures.py
blob: 6755ac661167e9888a9cd22fd42610f205f25c0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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