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.

21 lines
636 B

  1. # Copyright 2019 Coop IT Easy SCRL fs
  2. # Robin Keunen <robin@coopiteasy.be>
  3. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
  4. # pylint: disable=consider-merging-classes-inherited
  5. from odoo.addons.component.core import AbstractComponent
  6. class BaseRestService(AbstractComponent):
  7. _name = "emc.rest.service"
  8. _inherit = "base.rest.service"
  9. _collection = "emc.services"
  10. _description = """
  11. Base Rest Services
  12. """
  13. def _one_to_many_to_dict(self, record):
  14. if record:
  15. return {"id": record.get_api_external_id(), "name": record.name}
  16. else:
  17. return {}