Skip to content

Commit

Permalink
Merge pull request #123 from INRIM/t_12711
Browse files Browse the repository at this point in the history
[ADD] added anag_tipologie_istanze get rest api
  • Loading branch information
Marcoapu authored Oct 24, 2024
2 parents 0af4518 + fcbdd75 commit 7f2a997
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 10 deletions.
8 changes: 0 additions & 8 deletions inrim_controllo_accessi/models/ca_anag_tipologie_istanze.py

This file was deleted.

1 change: 1 addition & 0 deletions inrim_controllo_accessi/models/ca_lettore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError


class CaLettore(models.Model):
Expand Down
3 changes: 2 additions & 1 deletion inrim_controllo_accessi_api/controllers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
from . import tag
from . import settore_ente
from . import anag_servizi
from . import anag_avanzamento_rich
from . import anag_avanzamento_rich
from . import anag_tipologie_istanze
12 changes: 12 additions & 0 deletions inrim_controllo_accessi_api/controllers/anag_tipologie_istanze.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from odoo import http

from .api_controller_inrim import InrimApiController, BadRequest

class InrimApiAnagTipologieIstanze(InrimApiController):

@http.route('/api/anag_tipologie_istanze', auth="none", type='http', methods=['GET'],

This comment has been minimized.

Copy link
@archetipo

archetipo Oct 24, 2024

Member

questi controllers vanno inseriti nel modulo controllo_accessi_inrim_app

csrf=False)
def api_get_ca_anag_tipologie_istanze(self, **params):
self.check_token('ca.anag_tipologie_istanze', 'read')
return self.handle_response(
*self.model.rest_get(params), is_list=True)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,23 @@ class CaAnagTipologieIstanze(models.Model):
_inherit = "ca.model.base.mixin"
_description = 'Anagrafica Tipologie Istanze'

name = fields.Char(required=True)
name = fields.Char(required=True)

def rest_boby_hint(self):
return {
"name": ""
}

def rest_get_record(self):
vals = {
'id': self.id,
'name': self.name
}
return vals

def rest_eval_body(self, body):
body, msg = super().rest_eval_body(
body, [
'name'
])
return body, msg

0 comments on commit 7f2a997

Please sign in to comment.