Skip to content

Commit

Permalink
!fixup Merge branch '14.0-mig-l10n_it_fatturapa_in' of https://github…
Browse files Browse the repository at this point in the history
….com/dcorio/l10n-italy into 14.0-mig-l10n_it_fatturapa_in
  • Loading branch information
TheMule71 committed Apr 30, 2021
1 parent 7ac784f commit 3f2204f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions l10n_it_fatturapa_in/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"license": "AGPL-3",
"depends": [
"l10n_it_fatturapa",
"l10n_it_fiscal_document_type",
"l10n_it_withholding_tax_reason",
],
"data": [
Expand Down
35 changes: 17 additions & 18 deletions l10n_it_fatturapa_in/models/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,23 @@ def _compute_xml_data(self):
wiz_obj = self.env["wizard.import.fatturapa"].with_context(
from_attachment=att
)
if wiz_obj:
fatt = wiz_obj.get_invoice_obj(att)
cedentePrestatore = fatt.FatturaElettronicaHeader.CedentePrestatore
partner_id = wiz_obj.getCedPrest(cedentePrestatore)
att.xml_supplier_id = partner_id
att.invoices_number = len(fatt.FatturaElettronicaBody)
att.invoices_total = 0
invoices_date = []
for invoice_body in fatt.FatturaElettronicaBody:
dgd = invoice_body.DatiGenerali.DatiGeneraliDocumento
att.invoices_total += float(dgd.ImportoTotaleDocumento or 0)
invoice_date = format_date(
att.with_context(lang=att.env.user.lang).env,
fields.Date.from_string(dgd.Data),
)
if invoice_date not in invoices_date:
invoices_date.append(invoice_date)
att.invoices_date = " ".join(invoices_date)
fatt = wiz_obj.get_invoice_obj(att)
cedentePrestatore = fatt.FatturaElettronicaHeader.CedentePrestatore
partner_id = wiz_obj.getCedPrest(cedentePrestatore)
att.xml_supplier_id = partner_id
att.invoices_number = len(fatt.FatturaElettronicaBody)
att.invoices_total = 0
invoices_date = []
for invoice_body in fatt.FatturaElettronicaBody:
dgd = invoice_body.DatiGenerali.DatiGeneraliDocumento
att.invoices_total += float(dgd.ImportoTotaleDocumento or 0)
invoice_date = format_date(
att.with_context(lang=att.env.user.lang).env,
fields.Date.from_string(dgd.Data),
)
if invoice_date not in invoices_date:
invoices_date.append(invoice_date)
att.invoices_date = " ".join(invoices_date)

@api.depends("in_invoice_ids")
def _compute_registered(self):
Expand Down
3 changes: 2 additions & 1 deletion l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,8 @@ def invoiceCreate(self, fatt, fatturapa_attachment, FatturaBody, partner_id):

# compute the invoice
invoice.with_context(
check_move_validity=False)._move_autocomplete_invoice_lines_values()
check_move_validity=False
)._move_autocomplete_invoice_lines_values()

self.set_vendor_bill_data(FatturaBody, invoice)

Expand Down

0 comments on commit 3f2204f

Please sign in to comment.