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

DRAFT: 12.0 import customer facturae disable validation fix customer iban #4

Open
wants to merge 18 commits into
base: 12.0
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Set customer IBAN from XML in invoice
cesarlr committed Feb 7, 2023
commit 3d0dabc6423ab56243de10424a51bc50b25a9c6f
1 change: 1 addition & 0 deletions account_invoice_import_facturae/__manifest__.py
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
'external_dependencies': {
'python': [
'xmlsig',
'schwifty',
]
},
'images': ['images/sshot-wizard1.png'],
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
from odoo.tools.translate import _
from odoo.exceptions import ValidationError
logger = logging.getLogger(__name__)
from schwifty import IBAN

try:
import xmlsig
@@ -96,6 +97,7 @@ def parse_facturae_invoice(self, xml_root, xsd_file):
invoice.find('Items').findall('InvoiceLine')
]
attachments = {}
acc_number = invoice.find('PaymentDetails/Installment/AccountToBeDebited/AccountNumber').text
res = {
'type': inv_type,
'partner': partner_dict,
@@ -110,7 +112,7 @@ def parse_facturae_invoice(self, xml_root, xsd_file):
'amount_total': amount_total,
'check_total': amount_total,
'amount_untaxed': amount_untaxed,
'iban': False,
'iban': str(IBAN.generate('ES',acc_number[0:4],acc_number[8:20],acc_number[4:8])),
'bic': False,
'lines': res_lines,
'attachments': attachments,
9 changes: 8 additions & 1 deletion setup/account_invoice_import_facturae/setup.py
Original file line number Diff line number Diff line change
@@ -2,5 +2,12 @@

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
odoo_addon={
"external_dependencies_override": {
"python": {
"schwifty": "schwifty==2023.2.0",
"xmlsig": "0.1.4",
},

},
)