Skip to content

Commit

Permalink
ebill_paynet: Change import statement for zeep
Browse files Browse the repository at this point in the history
  • Loading branch information
TDu committed Feb 16, 2021
1 parent 1e5fb93 commit a91b8a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ebill_paynet/components/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import logging
import os

import requests
import zeep
from lxml import html
from requests import Session

from odoo.modules.module import get_resource_path

Expand All @@ -26,7 +26,7 @@ class PayNetDWS:

def __init__(self, url, test_service):
settings = zeep.Settings(xml_huge_tree=True)
session = Session()
session = requests.Session()
if test_service:
session.verify = SSL_TEST_CERTIFICATE
else:
Expand Down
6 changes: 4 additions & 2 deletions ebill_paynet/models/paynet_invoice_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

# Needs Jinja 2.10
from jinja2 import Environment, FileSystemLoader, select_autoescape
from zeep.exceptions import Fault

from odoo import fields, models
from odoo.modules.module import get_module_root
Expand All @@ -15,6 +14,9 @@

from ..components.api import PayNetDWS

import zeep # isort:skip


MODULE_PATH = get_module_root(os.path.dirname(__file__))
INVOICE_TEMPLATE_2013 = "invoice-2013A.xml"
INVOICE_TEMPLATE_2003 = "invoice-2003A.xml"
Expand Down Expand Up @@ -71,7 +73,7 @@ def send_to_paynet(self):
shipment_id = message.service_id.take_shipment(message.payload)
message.shipment_id = shipment_id
message.state = "sent"
except Fault as e:
except zeep.exceptions.Fault as e:
message.response = PayNetDWS.handle_fault(e)
message.state = "error"

Expand Down
4 changes: 2 additions & 2 deletions ebill_paynet/models/paynet_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import logging

import zeep
from lxml import etree
from zeep.exceptions import Fault

from odoo import api, fields, models
from odoo.exceptions import UserError
Expand Down Expand Up @@ -108,7 +108,7 @@ def get_shipment_content(self, shipment_id):
Authorization=dws.authorization(self.username, self.password),
ShipmentID=shipment_id,
)
except Fault as e:
except zeep.exceptions.Fault as e:
error = dws.handle_fault(e)
raise UserError(error)
return res
Expand Down

0 comments on commit a91b8a5

Please sign in to comment.