Skip to content

Commit 4472ecb

Browse files
[IMP] account_invoice_import: black, isort, prettier
1 parent 9439c7f commit 4472ecb

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

account_invoice_import/models/account_invoice_import_config.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ class AccountInvoiceImportConfig(models.Model):
1414

1515
name = fields.Char(required=True)
1616
partner_id = fields.Many2one(
17-
"res.partner",
18-
ondelete="cascade",
19-
domain=[("parent_id", "=", False)],
17+
"res.partner", ondelete="cascade", domain=[("parent_id", "=", False)],
2018
)
2119
active = fields.Boolean(default=True)
2220
sequence = fields.Integer()

account_invoice_import/models/account_journal.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ def create_invoice_from_attachment(self, attachment_ids=None):
1313
return super().create_invoice_from_attachment(attachment_ids=attachment_ids)
1414
attachment = self.env["ir.attachment"].browse(attachment_ids[0])
1515
wiz = self.env["account.invoice.import"].create(
16-
{
17-
"invoice_file": attachment.datas,
18-
"invoice_filename": attachment.name,
19-
}
16+
{"invoice_file": attachment.datas, "invoice_filename": attachment.name}
2017
)
2118
action = wiz.import_invoice()
2219
# JS crash when there is not a 'views' key != False

account_invoice_import/scripts/mass_invoice_import.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ def handle_failure(directory, entry, file_path):
101101
fail_dir_path = fail_subdir_ok[directory]
102102
if fail_dir_path:
103103
logger.info(
104-
"Moving file %s to sub-directory %s",
105-
entry,
106-
args.fail_subdir,
104+
"Moving file %s to sub-directory %s", entry, args.fail_subdir,
107105
)
108106
os.rename(file_path, os.path.join(fail_dir_path, entry))
109107

account_invoice_import/wizard/account_invoice_import.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -1226,9 +1226,7 @@ def post_process_invoice(self, parsed_inv, invoice, import_config): # noqa: C90
12261226
)
12271227
)
12281228
assert not float_compare(
1229-
parsed_inv["amount_total"],
1230-
invoice.amount_total,
1231-
precision_rounding=prec,
1229+
parsed_inv["amount_total"], invoice.amount_total, precision_rounding=prec,
12321230
)
12331231

12341232
def update_invoice_lines(self, parsed_inv, invoice, seller):
@@ -1568,9 +1566,7 @@ def message_new(self, msg_dict, custom_values=None):
15681566
)
15691567
continue
15701568
logger.info(
1571-
"Attachment %d: %s. Trying to import it as an invoice",
1572-
i,
1573-
filename,
1569+
"Attachment %d: %s. Trying to import it as an invoice", i, filename,
15741570
)
15751571
# if it's an XML file, attach.content is a string
15761572
# if it's a PDF file, attach.content is a byte !
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../account_invoice_import

setup/account_invoice_import/setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)