diff --git a/ext/custom-addons/dp_custom/wizards/wizard_reset_order.py b/ext/custom-addons/dp_custom/wizards/wizard_reset_order.py index 724f4f47..0eaecf27 100644 --- a/ext/custom-addons/dp_custom/wizards/wizard_reset_order.py +++ b/ext/custom-addons/dp_custom/wizards/wizard_reset_order.py @@ -1,7 +1,7 @@ # Copyright 2018-Today datenpol gmbh () # 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 import json @@ -48,12 +48,12 @@ class WizardResetOrder(models.TransientModel): def reset_order_status(self, order_id): self.ensure_one() -# portal_url = tools.config.get('portal_url') - info = '' - imos_url = r'https://2138.testshop.imos3d.com?id=142&tx_imosnetpublic_api[controller]=Basket&tx_imosnetpublic_api[action]=update' + imos_base_url = tools.config.get('imos_base_url') + imos_pass = tools.config.get('imos_pass') + 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} data = { - 'pass' : '8io4u39ruhiz378uih', + 'pass' : imos_pass, 'user' : 'publicapiuser', 'pid' : 5, 'logintype' : 'login', @@ -61,6 +61,7 @@ class WizardResetOrder(models.TransientModel): } response = requests.post(imos_url, data=data) + info = '' try: lRes = json.loads(response.content.decode()) except Exception as e: