-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][MIG] account_check_printing_aeroo (#69)
Co-authored-by: Majda EL MARIOULI <[email protected]>
- Loading branch information
Showing
16 changed files
with
218 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Aeroo Check Printing | ||
==================== | ||
|
||
This module allows creating check reports using Aeroo. | ||
|
||
Each journal (bank account) points to its own specific check report template. | ||
When clicking on 'Print Check' on the payment, the appropriate Aeroo template is selected. | ||
|
||
Configuration | ||
------------- | ||
To define an Aeroo report as the check report: | ||
|
||
* Go to Invoicing / Configuration / Journals | ||
* Select your bank/check journal | ||
* In the Advanced Settings tab, under Check Printing, select your check report template. | ||
|
||
.. image:: static/description/account_journal_form.png | ||
|
||
Contributors | ||
------------ | ||
* Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
|
||
More information | ||
---------------- | ||
* Meet us at https://bit.ly/numigi-com |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2024 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 |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2024 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": "16.0.1.0.0", | ||
"author": "Numigi", | ||
"maintainer": "numigi", | ||
"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", | ||
], | ||
"demo": [ | ||
"demo/report.xml", | ||
], | ||
"installable": True, | ||
"application": False, | ||
} |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0"?> | ||
<odoo noupdate="1"> | ||
|
||
<record id="sample_report" model="ir.actions.report"> | ||
<field name="name">Check Sample</field> | ||
<field name="type">ir.actions.report</field> | ||
<field name="model">account.payment</field> | ||
<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_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> | ||
</record> | ||
|
||
</odoo> |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * account_check_printing_aeroo | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-07 11:07+0000\n" | ||
"PO-Revision-Date: 2024-11-07 11:07+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: account_check_printing_aeroo | ||
#: model:ir.model.fields,field_description:account_check_printing_aeroo.field_account_journal__check_report_id | ||
msgid "Check Report" | ||
msgstr "Rapport de chèque" | ||
|
||
#. module: account_check_printing_aeroo | ||
#: model:ir.actions.report,name:account_check_printing_aeroo.sample_report | ||
msgid "Check Sample" | ||
msgstr "Chèque Démo" | ||
|
||
#. module: account_check_printing_aeroo | ||
#. odoo-python | ||
#: code:addons/account_check_printing_aeroo/models/account_payment.py:0 | ||
#, python-format | ||
msgid "" | ||
"In order to generate checks in batch, all selected payments must belong to " | ||
"the same journal (bank account)." | ||
msgstr "" | ||
"Afin de générer les chèques en lot, tous les paiements sélectionnés doivent " | ||
"appartenir à un même journal (compte bancaire)." | ||
|
||
#. module: account_check_printing_aeroo | ||
#: model:ir.model,name:account_check_printing_aeroo.model_account_journal | ||
msgid "Journal" | ||
msgstr "" | ||
|
||
#. module: account_check_printing_aeroo | ||
#: model:ir.model,name:account_check_printing_aeroo.model_account_payment | ||
msgid "Payments" | ||
msgstr "Paiements" |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# 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 |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2024 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 | ||
|
||
|
||
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')]", | ||
) |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2024 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, _ | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class AccountPayment(models.Model): | ||
|
||
_inherit = "account.payment" | ||
|
||
def do_print_checks(self): | ||
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)." | ||
) | ||
) | ||
if journal.check_report_id: | ||
return journal.check_report_id.report_action(self) | ||
return super().do_print_checks() |
Binary file added
BIN
+94.1 KB
account_check_printing_aeroo/static/description/account_journal_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from . import test_check_printing |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestCheckPrinting(TransactionCase): | ||
|
||
@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, | ||
} | ||
) | ||
|
||
def test_print_check(self): | ||
self.payment.do_print_checks() |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<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="arch" type="xml"> | ||
<field name="check_next_number" position="after"> | ||
<field name="check_report_id" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |