# -*- coding: utf-8 -*- from openerp import models, fields, api class ResPartner(models.Model): _inherit = 'res.partner' @api.model def getResPartnerMedic(self,domain): ResPartner = self.env['res.partner'].search(domain) values = [] for partner in ResPartner: values.append({ 'id': partner.id, 'name': partner.name, 'ruc': partner.ruc, 'street': partner.street, 'city': partner.city, 'phone': partner.phone, 'mobile': partner.mobile, 'email': partner.email, 'property_product_pricelist': partner.property_product_pricelist.name, 'property_product_pricelist_purchase': partner.property_product_pricelist_purchase.name, 'credit': partner.credit, 'debit': partner.debit, 'supplier': partner.supplier, 'is_medic': partner.is_medic, 'medic': [ partner.medic.id, partner.medic.name, ], }) return values