Skip to content

Commit

Permalink
Merge pull request #129 from INRIM/t_12678
Browse files Browse the repository at this point in the history
[UPD] added codice_lettore_grum on ca.punto_accesso
  • Loading branch information
Marcoapu authored Oct 24, 2024
2 parents a746e3d + 72f05a1 commit 45b6516
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
12 changes: 12 additions & 0 deletions inrim_controllo_accessi/models/ca_punto_accesso.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ class CaPuntoAccesso(models.Model):
ca_tag_lettore_ids = fields.One2many('ca.tag_lettore', 'ca_punto_accesso_id')
remote_update = fields.Boolean(readonly=True)
active = fields.Boolean(default=True)
codice_lettore_grum = fields.Integer(

This comment has been minimized.

Copy link
@archetipo

archetipo Oct 24, 2024

Member

No questa modifica andava in inrim_controllo_accessi_custom non in questo modulo

string='Codice Lettore GRUM',
)

@api.constrains('codice_lettore_grum', 'typology')
def _check_codice_lettore_grum(self):
for record in self:
if record.typology == 'stamping' and not record.codice_lettore_grum:
raise UserError("Il codice lettore GRUM è obbligatorio se la tipologia è: Timbratura.")
if record.codice_lettore_grum:
if not (20 <= record.codice_lettore_grum <= 999):
raise UserError("Il codice lettore GRUM deve essere compreso tra 20 e 999.")

@api.constrains('date_start', 'date_end')
def _check_date(self):
Expand Down
1 change: 1 addition & 0 deletions inrim_controllo_accessi/views/ca_punto_accesso_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<field name="system_error"/>
<field name="direction"/>
<field name="typology"/>
<field name="codice_lettore_grum" required="typology == 'stamping'"/>

This comment has been minimized.

Copy link
@archetipo

archetipo Oct 24, 2024

Member

idem come sopra va in inrim_controllo_accessi_custom

<field name="type_ids" invisible="True"/>
</group>
<group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@
<field name="model">ca.anag_servizi</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="abbreviation"/>
<field name="tipo_spazio_id"/>
<field name="spazio_id"/>
<field name="ca_persona_id"/>
<field name="ca_ente_azienda_id"/>
<field name="date_start"/>
<field name="date_end"/>
</tree>
</field>
</record>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
<field name="model">ca.settore_ente</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="abbreviation"/>
<field name="ca_persona_id"/>
<field name="ca_ente_azienda_id"/>
<field name="date_start"/>
<field name="date_end"/>
</tree>
</field>
</record>
Expand Down

0 comments on commit 45b6516

Please sign in to comment.