Skip to content

Commit

Permalink
[ADD][bio_login]-system parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
SaraiOsorio committed Dec 1, 2017
1 parent 8b71a6d commit 974e46c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions bio_login/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'description': 'Bio Login',
'depends': [],
'data': [
'data/config_parameter_data.xml',
'views/res_user_view.xml',
],
'installable': True,
Expand Down
9 changes: 9 additions & 0 deletions bio_login/data/config_parameter_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="ngrok_url_parameter" model="ir.config_parameter">
<field name="key">ngrok_url</field>
<field name="value">http://0d0b113c.ngrok.io/BioEngineClientWS/BioEngineClient.asmx?WSDL</field>
</record>
</data>
</odoo>
6 changes: 3 additions & 3 deletions bio_login/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def _login(self, db, login, password):
user_id,))
user_biokey = cr.fetchone()
if not request.session.login:
client = Client(
'http://0d0b113c.ngrok.io/BioEngineClientWS'
'/BioEngineClient.asmx?WSDL')
ngrok_url = self.pool.get('ir.config_parameter').get_param(
'ngrok_url_parameter')
client = Client(ngrok_url)
token = client.service.GetToken()['outToken']
transaction = client.service.GetTmpTransNum(
token)['outTmpTransNum']
Expand Down

0 comments on commit 974e46c

Please sign in to comment.