Skip to content

Commit

Permalink
[IMP] Code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
lanto-razafindrabe committed Jul 30, 2024
1 parent f0a580d commit b5c9b47
Show file tree
Hide file tree
Showing 64 changed files with 879 additions and 782 deletions.
2 changes: 1 addition & 1 deletion .docker_files/main/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# © 2018 Numigi
# Copyright 2018 Numigi
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
30 changes: 15 additions & 15 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# © 2018 Numigi
# Copyright 2018 Numigi
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'Main Module',
'version': '1.0.0',
'author': 'Numigi',
'maintainer': 'Numigi',
'website': 'https://www.numigi.com',
'license': 'LGPL-3',
'category': 'Other',
'summary': 'Install all addons required for testing.',
'depends': [
'account_check_printing_aeroo',
'report_aeroo',
'report_aeroo_invoice',
'report_aeroo_replace_qweb',
"name": "Main Module",
"version": "1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://www.numigi.com",
"license": "LGPL-3",
"category": "Other",
"summary": "Install all addons required for testing.",
"depends": [
"account_check_printing_aeroo",
"report_aeroo",
"report_aeroo_invoice",
"report_aeroo_replace_qweb",
],
'installable': True,
"installable": True,
}
4 changes: 2 additions & 2 deletions account_check_printing_aeroo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# © 2017 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2017 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
38 changes: 19 additions & 19 deletions account_check_printing_aeroo/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# © 2017 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2017 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
'name': 'Aeroo Check Printing',
'version': '1.0.0',
'author': 'Savoir-faire Linux',
'maintainer': 'Savoir-faire Linux',
'website': 'http://www.savoirfairelinux.com',
'license': 'LGPL-3',
'category': 'Accounting',
'summary': 'Check Printing With Aeroo',
'depends': [
'account_check_printing',
'report_aeroo',
"name": "Aeroo Check Printing",
"version": "1.0.0",
"author": "Savoir-faire Linux",
"maintainer": "Savoir-faire Linux",
"website": "http://www.savoirfairelinux.com",
"license": "LGPL-3",
"category": "Accounting",
"summary": "Check Printing With Aeroo",
"depends": [
"account_check_printing",
"report_aeroo",
],
'data': [
'views/account_journal.xml',
"data": [
"views/account_journal.xml",
],
'demo': [
'demo/report.xml',
"demo": [
"demo/report.xml",
],
'installable': True,
'application': False,
"installable": True,
"application": False,
}
2 changes: 1 addition & 1 deletion account_check_printing_aeroo/demo/report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="report_name">check_ca</field>
<field name="report_type">aeroo</field>
<field name="aeroo_in_format">odt</field>
<field name="aeroo_out_format_id" ref="report_aeroo.aeroo_mimetype_pdf_odt"/>
<field name="aeroo_out_format_id" ref="report_aeroo.aeroo_mimetype_pdf_odt" />
<field name="aeroo_template_path">account_check_printing_aeroo/demo/check_sample.odt</field>
<field name="aeroo_template_source">file</field>
<field name="aeroo_lang_eval">'en_US'</field>
Expand Down
2 changes: 1 addition & 1 deletion account_check_printing_aeroo/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2021 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2021 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import account_payment, account_journal
11 changes: 7 additions & 4 deletions account_check_printing_aeroo/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# © 2017 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2017 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import fields, models
Expand All @@ -10,5 +10,8 @@ class AccountJournal(models.Model):
_inherit = "account.journal"

check_report_id = fields.Many2one(
'ir.actions.report', 'Check Report', ondelete='restrict',
domain="[('report_type', '=', 'aeroo'), ('model', '=', 'account.payment')]")
"ir.actions.report",
"Check Report",
ondelete="restrict",
domain="[('report_type', '=', 'aeroo'), ('model', '=', 'account.payment')]",
)
16 changes: 9 additions & 7 deletions account_check_printing_aeroo/models/account_payment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# © 2017 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2017 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import models, _
Expand All @@ -11,12 +11,14 @@ class AccountPayment(models.Model):
_inherit = "account.payment"

def do_print_checks(self):
journal = self.mapped('journal_id')
journal = self.mapped("journal_id")
if len(journal) != 1:
raise UserError(_(
'In order to generate checks in batch, all selected '
'payments must belong to the same journal (bank account).'
))
raise UserError(
_(
"In order to generate checks in batch, all selected "
"payments must belong to the same journal (bank account)."
)
)
if journal.check_report_id:
return journal.check_report_id.report_action(self)
return super().do_print_checks()
4 changes: 2 additions & 2 deletions account_check_printing_aeroo/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# © 2017 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2017 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
42 changes: 23 additions & 19 deletions account_check_printing_aeroo/tests/test_check_printing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# © 2017 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2017 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from datetime import datetime
from odoo.tests import common


Expand All @@ -11,22 +10,27 @@ class TestCheckPrinting(common.SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner = cls.env['res.partner'].search([], limit=1)
cls.report = cls.env.ref('account_check_printing_aeroo.sample_report')
cls.journal = cls.env['account.journal'].create({
'name': 'BMO CAD',
'code': 'BMO',
'type': 'bank',
'check_report_id': cls.report.id,
})
cls.payment = cls.env['account.payment'].create({
'partner_id': cls.partner.id,
'amount': 1234.56,
'journal_id': cls.journal.id,
'payment_type': 'outbound',
'payment_method_id': cls.env.ref(
'account_check_printing.account_payment_method_check').id,
})
cls.partner = cls.env["res.partner"].search([], limit=1)
cls.report = cls.env.ref("account_check_printing_aeroo.sample_report")
cls.journal = cls.env["account.journal"].create(
{
"name": "BMO CAD",
"code": "BMO",
"type": "bank",
"check_report_id": cls.report.id,
}
)
cls.payment = cls.env["account.payment"].create(
{
"partner_id": cls.partner.id,
"amount": 1234.56,
"journal_id": cls.journal.id,
"payment_type": "outbound",
"payment_method_id": cls.env.ref(
"account_check_printing.account_payment_method_check"
).id,
}
)

def test_print_check(self):
self.payment.do_print_checks()
4 changes: 2 additions & 2 deletions account_check_printing_aeroo/views/account_journal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<record id="view_account_journal_form" model="ir.ui.view">
<field name="name">account.journal.form</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account_check_printing.view_account_journal_form_inherited"/>
<field name="inherit_id" ref="account_check_printing.view_account_journal_form_inherited" />
<field name="arch" type="xml">
<field name="check_next_number" position="after">
<field name="check_report_id"/>
<field name="check_report_id" />
</field>
</field>
</record>
Expand Down
6 changes: 3 additions & 3 deletions report_aeroo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# © 2008-2014 Alistek
# © 2016-2018 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2008-2014 Alistek
# Copyright 2016-2018 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License GPL-3.0 or later (http://www.gnu.org/licenses/gpl).

from . import controllers
Expand Down
32 changes: 16 additions & 16 deletions report_aeroo/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# © 2008-2014 Alistek
# © 2016-2018 Savoir-faire Linux
# © 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# Copyright 2008-2014 Alistek
# Copyright 2016-2018 Savoir-faire Linux
# Copyright 2018 Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License GPL-3.0 or later (http://www.gnu.org/licenses/gpl).

{
'name': 'Aeroo Reports',
'version': '1.0.1',
'category': 'Generic Modules/Aeroo Reports',
'summary': 'Enterprise grade reporting solution',
'author': 'Alistek',
'maintainer': 'Numigi',
'website': 'https://bit.ly/numigi-com',
'depends': ['mail'],
'external_dependencies': {
'python': ['aeroolib', 'babel', 'genshi'],
"name": "Aeroo Reports",
"version": "1.0.1",
"category": "Generic Modules/Aeroo Reports",
"summary": "Enterprise grade reporting solution",
"author": "Alistek",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"depends": ["mail"],
"external_dependencies": {
"python": ["aeroolib", "babel", "genshi"],
},
'data': [
"data": [
"security/security.xml",
"views/ir_actions_report.xml",
"views/mail_template.xml",
"views/report_aeroo_assets.xml",
"data/report_aeroo_data.xml",
"security/ir.model.access.csv",
],
'demo': ["demo/report_sample.xml"],
"demo": ["demo/report_sample.xml"],
"license": "GPL-3 or any later version",
'installable': True,
"installable": True,
}
Loading

0 comments on commit b5c9b47

Please sign in to comment.