-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] import fiscal documents with native upload button
- Loading branch information
Showing
2 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |