Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump drafthorse to 2025.1.0 (backport #79) #81

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions eu_einvoice/european_e_invoice/custom/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ def _set_seller_electronic_address(self):
electronic_address = self.company.email

if electronic_address:
self.doc.trade.agreement.seller.electronic_address.add(
URIUniversalCommunication(uri_ID=("EM", electronic_address))
)
self.doc.trade.agreement.seller.electronic_address.uri_ID = ("EM", electronic_address)

def _set_seller_contact(self):
seller_contact_phone = self.company.phone_no
Expand Down Expand Up @@ -293,9 +291,7 @@ def _set_buyer(self):
self._set_buyer_contact()

if self.invoice.contact_email:
self.doc.trade.agreement.buyer.electronic_address.add(
URIUniversalCommunication(uri_ID=("EM", self.invoice.contact_email))
)
self.doc.trade.agreement.buyer.electronic_address.uri_ID = ("EM", self.invoice.contact_email)

self._set_buyer_tax_id()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get_xml_bytes(self) -> bytes:
def read_values_from_einvoice(self) -> None:
xml_bytes = self.get_xml_bytes()
try:
doc = DrafthorseDocument.parse(xml_bytes)
doc = DrafthorseDocument.parse(xml_bytes, strict=False)
except XMLSyntaxError:
frappe.throw(_("The uploaded file does not contain valid XML data."))

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dynamic = ["version"]
dependencies = [
# "frappe~=15.0.0" # Installed and managed by bench.
"factur-x~=3.1",
"drafthorse~=2.4.0",
"drafthorse~=2025.1.0",
"saxonche~=12.5.0",
"lxml>=4.9.3,<6.0.0",
]
Expand Down
Loading