You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
768 B

  1. import json, logging
  2. from odoo import http, models, fields, api
  3. from odoo.http import Response, request
  4. _logger = logging.getLogger(__name__)
  5. class PartnerGogocartojs(http.Controller):
  6. @http.route('/web/get_http_gogocarto_elements',methods=['GET'], type='http', csrf=False, auth="public", website=True)
  7. def get_gogocarto_elements_http(self):
  8. data = self._get_partner()
  9. return Response(json.dumps(data))
  10. def _get_partner(self):
  11. data = []
  12. all_partner = request.env['res.partner'].sudo()
  13. partners = all_partner.search(all_partner._get_gogocarto_domain())
  14. all_partner.debug_field_exported()
  15. for partner in partners:
  16. data.append(partner.gogocarto_serialization())
  17. return data