-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UPD] controller moved based on commit comments (#135)
* [UPD] controller moved based on commit comments * [FIX] fixed unit tests
- Loading branch information
Showing
19 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import models | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import anag_tipologie_istanze |
2 changes: 1 addition & 1 deletion
2
...api/controllers/anag_tipologie_istanze.py → ...app/controllers/anag_tipologie_istanze.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
'name': 'Inrim Controllo Accessi Custom', | ||
'version': '17.0.1.0.0', | ||
'description': "Inrim Controllo Accessi Custom", | ||
"author": "Alessio Gerace - Inrim", | ||
"website": "https://github.com/INRIM", | ||
'depends': [ | ||
'inrim_controllo_accessi' | ||
], | ||
'data': [ | ||
'views/ca_punto_accesso_views.xml', | ||
], | ||
'demo': [], | ||
'installable': True, | ||
'application': True, | ||
} |
26 changes: 26 additions & 0 deletions
26
inrim_controllo_accessi_custom/data/ca_punto_accesso_data.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data noupdate="1"> | ||
<record id="inrim_controllo_accessi.ca_punto_accesso_1p001" model="ca.punto_accesso"> | ||
<field name="ca_spazio_id" eval="ref('inrim_anagrafiche.ca_spazio_1p001')"/> | ||
<field name="ca_lettore_id" eval="ref('inrim_anagrafiche.inrim_demo_ca_lettore_1')"/> | ||
<field name="direction">in</field> | ||
<field name="typology">stamping</field> | ||
<field name="codice_lettore_grum">20</field> | ||
<field name="enable_sync">True</field> | ||
<field name="date_start" eval="datetime.today()"/> | ||
<field name="date_end" eval="datetime.today() + timedelta(days=15)"/> | ||
</record> | ||
|
||
<record id="inrim_controllo_accessi.ca_punto_accesso_1p002" model="ca.punto_accesso"> | ||
<field name="ca_spazio_id" eval="ref('inrim_anagrafiche.ca_spazio_1p002')"/> | ||
<field name="ca_lettore_id" eval="ref('inrim_anagrafiche.inrim_demo_ca_lettore_2')"/> | ||
<field name="direction">out</field> | ||
<field name="typology">stamping</field> | ||
<field name="codice_lettore_grum">20</field> | ||
<field name="enable_sync">True</field> | ||
<field name="date_start" eval="datetime.today()"/> | ||
<field name="date_end" eval="datetime.today() + timedelta(days=15)"/> | ||
</record> | ||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import ca_punto_accesso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from odoo import models, fields, api, _ | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class CaPuntoAccesso(models.Model): | ||
_inherit = "ca.punto_accesso" | ||
|
||
codice_lettore_grum = fields.Integer( | ||
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.") |
13 changes: 13 additions & 0 deletions
13
inrim_controllo_accessi_custom/views/ca_punto_accesso_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="ca_punto_accesso_view_form_inherit" model="ir.ui.view"> | ||
<field name="name">ca.punto_accesso.view.form.inherit</field> | ||
<field name="model">ca.punto_accesso</field> | ||
<field name="inherit_id" ref="inrim_controllo_accessi.ca_punto_accesso_view_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='typology']" position="after"> | ||
<field name="codice_lettore_grum" required="typology == 'stamping'"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import models | ||
from . import controllers |
3 changes: 3 additions & 0 deletions
3
inrim_controllo_accessi_richieste_accesso/controllers/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import richiesta_accesso_persona | ||
from . import richiesta_servizi_persona | ||
from . import anag_avanzamento_rich |
2 changes: 1 addition & 1 deletion
2
..._api/controllers/anag_avanzamento_rich.py → ...esso/controllers/anag_avanzamento_rich.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../controllers/richiesta_accesso_persona.py → .../controllers/richiesta_accesso_persona.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../controllers/richiesta_servizi_persona.py → .../controllers/richiesta_servizi_persona.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters