diff --git a/account_invoice_bank_details/README.rst b/account_invoice_bank_details/README.rst new file mode 100644 index 000000000..8fcb95e0e --- /dev/null +++ b/account_invoice_bank_details/README.rst @@ -0,0 +1,87 @@ +============================ +Invoice Bank Account Details +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:657b7f7cf034140aacc1399eb1719ee731e5822db3867f71a6ed769e1a8f739d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoice--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/account-invoice-reporting/tree/17.0/account_invoice_bank_details + :alt: OCA/account-invoice-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-invoice-reporting-17-0/account-invoice-reporting-17-0-account_invoice_bank_details + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoice-reporting&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to select a default bank account based on the +currency of the invoice. It will also display the bank details on the +invoice + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp + +Contributors +------------ + +- `camptocamp `__: +- Vincent Renaville +- `Trobz `__: +- Do Anh Duy + +Other credits +------------- + +The migration of this module from 13.0 to 17.0 was financially supported +by Camptocamp + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/account-invoice-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_invoice_bank_details/__init__.py b/account_invoice_bank_details/__init__.py new file mode 100644 index 000000000..83e553ac4 --- /dev/null +++ b/account_invoice_bank_details/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/account_invoice_bank_details/__manifest__.py b/account_invoice_bank_details/__manifest__.py new file mode 100644 index 000000000..b371a2108 --- /dev/null +++ b/account_invoice_bank_details/__manifest__.py @@ -0,0 +1,16 @@ +{ + "name": "Invoice Bank Account Details", + "summary": "Select bank account base on currency + print bank details on report" + "reports and customer portal", + "version": "17.0.1.0.0", + "category": "Account", + "website": "https://github.com/OCA/account-invoice-reporting", + "author": "Camptocamp, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["account"], + "data": [ + "report/invoice_report_templates.xml", + ], + "application": False, + "installable": True, +} diff --git a/account_invoice_bank_details/i18n/fr.po b/account_invoice_bank_details/i18n/fr.po new file mode 100644 index 000000000..7f38cac6f --- /dev/null +++ b/account_invoice_bank_details/i18n/fr.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_bank_details +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-01-08 08:32+0000\n" +"PO-Revision-Date: 2021-01-08 08:32+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_invoice_bank_details +#: model_terms:ir.ui.view,arch_db:account_invoice_bank_details.report_invoice_document_hide_detail +msgid "BIC / SWIFT:" +msgstr "" + +#. module: account_invoice_bank_details +#: model_terms:ir.ui.view,arch_db:account_invoice_bank_details.report_invoice_document_hide_detail +msgid "Bank:" +msgstr "Banque:" + +#. module: account_invoice_bank_details +#: model_terms:ir.ui.view,arch_db:account_invoice_bank_details.report_invoice_document_hide_detail +msgid "IBAN:" +msgstr "" + +#. module: account_invoice_bank_details +#: model_terms:ir.ui.view,arch_db:account_invoice_bank_details.report_invoice_document_hide_detail +msgid "Payment information:" +msgstr "Payable auprès de:" + +#. module: account_invoice_bank_details +#: model:ir.model,name:account_invoice_bank_details.model_account_move +msgid "Journal Entries" +msgstr "Pièces comptables" diff --git a/account_invoice_bank_details/models/__init__.py b/account_invoice_bank_details/models/__init__.py new file mode 100644 index 000000000..4951448be --- /dev/null +++ b/account_invoice_bank_details/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import account_move diff --git a/account_invoice_bank_details/models/account_move.py b/account_invoice_bank_details/models/account_move.py new file mode 100644 index 000000000..a1d84d287 --- /dev/null +++ b/account_invoice_bank_details/models/account_move.py @@ -0,0 +1,32 @@ +# Copyright 2020-2021 Camptocamp - Vincent Renaville +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + @api.depends("currency_id", "company_id.partner_id") + def _compute_partner_bank_id(self): + for record in self: + if record.currency_id: + # try to find bank account by currency + partner_bank = self.env["res.partner.bank"].search( + [ + ("currency_id", "=", self.currency_id.id), + ("partner_id", "=", self.company_id.partner_id.id), + ], + limit=1, + ) + + # if not found take first bank account of the company + if not partner_bank: + partner_bank = self.env["res.partner.bank"].search( + [("partner_id", "=", self.company_id.partner_id.id)], limit=1 + ) + + record.partner_bank_id = partner_bank.id + + else: + return super()._compute_partner_bank_id diff --git a/account_invoice_bank_details/pyproject.toml b/account_invoice_bank_details/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/account_invoice_bank_details/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_invoice_bank_details/readme/CONTRIBUTORS.md b/account_invoice_bank_details/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..d097aa7a5 --- /dev/null +++ b/account_invoice_bank_details/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- [camptocamp](https://camptocamp.com): +- Vincent Renaville \<\> +- [Trobz](https://trobz.com): +- Do Anh Duy \<\> diff --git a/account_invoice_bank_details/readme/CREDITS.md b/account_invoice_bank_details/readme/CREDITS.md new file mode 100644 index 000000000..59b3719e5 --- /dev/null +++ b/account_invoice_bank_details/readme/CREDITS.md @@ -0,0 +1,2 @@ +The migration of this module from 13.0 to 17.0 was financially supported +by Camptocamp diff --git a/account_invoice_bank_details/readme/DESCRIPTION.md b/account_invoice_bank_details/readme/DESCRIPTION.md new file mode 100644 index 000000000..2439913d6 --- /dev/null +++ b/account_invoice_bank_details/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module allows you to select a default bank account based on the +currency of the invoice. It will also display the bank details on the +invoice diff --git a/account_invoice_bank_details/report/invoice_report_templates.xml b/account_invoice_bank_details/report/invoice_report_templates.xml new file mode 100644 index 000000000..952d03f6b --- /dev/null +++ b/account_invoice_bank_details/report/invoice_report_templates.xml @@ -0,0 +1,28 @@ + + + + + + diff --git a/account_invoice_bank_details/static/description/index.html b/account_invoice_bank_details/static/description/index.html new file mode 100644 index 000000000..8f12c21f8 --- /dev/null +++ b/account_invoice_bank_details/static/description/index.html @@ -0,0 +1,434 @@ + + + + + +Invoice Bank Account Details + + + +
+

Invoice Bank Account Details

+ + +

Beta License: AGPL-3 OCA/account-invoice-reporting Translate me on Weblate Try me on Runboat

+

This module allows you to select a default bank account based on the +currency of the invoice. It will also display the bank details on the +invoice

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 13.0 to 17.0 was financially supported +by Camptocamp

+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/account-invoice-reporting project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ +