Skip to content

Commit

Permalink
[IMP] import fiscal documents with native upload button
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Nov 9, 2023
1 parent aaad878 commit 42c3c9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions l10n_br_account/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
from . import fiscal_document_line
from . import account_incoterms
from . import ir_model_data
from . import account_journal
14 changes: 9 additions & 5 deletions l10n_br_account/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# Copyright 2023 Akretion (Raphaẽl Valyi <[email protected]>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import fields, models
from odoo import models


class AccountJournal(models.Model):
_inherit = "account.journal"

revenue_expense = fields.Boolean(
string="Gera Financeiro",
)
def create_invoice_from_attachment(self, attachment_ids=None):
if self.env.company.country_id.code != "BR" or len(attachment_ids) < 1:
return super().create_invoice_from_attachment(attachment_ids=attachment_ids)
attachments = self.env["ir.attachment"].browse(attachment_ids)
return self.env[
"l10n_br_fiscal.document.import.wizard.mixin"
]._get_importer_action(attachments)

0 comments on commit 42c3c9e

Please sign in to comment.