read url & pass for imos-portal from .conf file
parent
34d5a25b4a
commit
58a89396ad
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>)
|
# Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>)
|
||||||
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
|
# License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses).
|
||||||
|
|
||||||
from odoo import api, fields, models, _
|
from odoo import tools, api, fields, models, _
|
||||||
from odoo.exceptions import ValidationError, UserError
|
from odoo.exceptions import ValidationError, UserError
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
@ -48,12 +48,12 @@ class WizardResetOrder(models.TransientModel):
|
||||||
|
|
||||||
def reset_order_status(self, order_id):
|
def reset_order_status(self, order_id):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
# portal_url = tools.config.get('portal_url')
|
imos_base_url = tools.config.get('imos_base_url')
|
||||||
info = ''
|
imos_pass = tools.config.get('imos_pass')
|
||||||
imos_url = r'https://2138.testshop.imos3d.com?id=142&tx_imosnetpublic_api[controller]=Basket&tx_imosnetpublic_api[action]=update'
|
imos_url = imos_base_url + r'?id=142&tx_imosnetpublic_api[controller]=Basket&tx_imosnetpublic_api[action]=update'
|
||||||
idata = {"uid" : int(order_id[-6:]), "status" : 0}
|
idata = {"uid" : int(order_id[-6:]), "status" : 0}
|
||||||
data = {
|
data = {
|
||||||
'pass' : '8io4u39ruhiz378uih',
|
'pass' : imos_pass,
|
||||||
'user' : 'publicapiuser',
|
'user' : 'publicapiuser',
|
||||||
'pid' : 5,
|
'pid' : 5,
|
||||||
'logintype' : 'login',
|
'logintype' : 'login',
|
||||||
|
|
@ -61,6 +61,7 @@ class WizardResetOrder(models.TransientModel):
|
||||||
}
|
}
|
||||||
response = requests.post(imos_url, data=data)
|
response = requests.post(imos_url, data=data)
|
||||||
|
|
||||||
|
info = ''
|
||||||
try:
|
try:
|
||||||
lRes = json.loads(response.content.decode())
|
lRes = json.loads(response.content.decode())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue