From 974e46cefea91c4feca64a815c30f5e89f072cab Mon Sep 17 00:00:00 2001 From: SaraiOsorio Date: Fri, 1 Dec 2017 13:36:20 -0600 Subject: [PATCH] [ADD][bio_login]-system parameter --- bio_login/__openerp__.py | 1 + bio_login/data/config_parameter_data.xml | 9 +++++++++ bio_login/models/res_users.py | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 bio_login/data/config_parameter_data.xml diff --git a/bio_login/__openerp__.py b/bio_login/__openerp__.py index d6009d8..7729867 100644 --- a/bio_login/__openerp__.py +++ b/bio_login/__openerp__.py @@ -11,6 +11,7 @@ 'description': 'Bio Login', 'depends': [], 'data': [ + 'data/config_parameter_data.xml', 'views/res_user_view.xml', ], 'installable': True, diff --git a/bio_login/data/config_parameter_data.xml b/bio_login/data/config_parameter_data.xml new file mode 100644 index 0000000..78edfdf --- /dev/null +++ b/bio_login/data/config_parameter_data.xml @@ -0,0 +1,9 @@ + + + + + ngrok_url + http://0d0b113c.ngrok.io/BioEngineClientWS/BioEngineClient.asmx?WSDL + + + \ No newline at end of file diff --git a/bio_login/models/res_users.py b/bio_login/models/res_users.py index 90b622d..97320a5 100644 --- a/bio_login/models/res_users.py +++ b/bio_login/models/res_users.py @@ -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']