Skip to content

Commit

Permalink
Merge PR #324 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Aug 29, 2024
2 parents d86cc47 + 32d43ea commit 0da0a1c
Show file tree
Hide file tree
Showing 12 changed files with 656 additions and 0 deletions.
87 changes: 87 additions & 0 deletions account_invoice_bank_details/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/account-invoice-reporting/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 <https://github.com/OCA/account-invoice-reporting/issues/new?body=module:%20account_invoice_bank_details%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Camptocamp

Contributors
------------

- `camptocamp <https://camptocamp.com>`__:
- Vincent Renaville <https://www.camptocamp.com>
- `Trobz <https://trobz.com>`__:
- Do Anh Duy <[email protected]>

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 <https://github.com/OCA/account-invoice-reporting/tree/17.0/account_invoice_bank_details>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions account_invoice_bank_details/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
16 changes: 16 additions & 0 deletions account_invoice_bank_details/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
41 changes: 41 additions & 0 deletions account_invoice_bank_details/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -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 "<strong>BIC / SWIFT:</strong>"
msgstr ""

#. module: account_invoice_bank_details
#: model_terms:ir.ui.view,arch_db:account_invoice_bank_details.report_invoice_document_hide_detail
msgid "<strong>Bank:</strong>"
msgstr "<strong>Banque:</strong>"

#. module: account_invoice_bank_details
#: model_terms:ir.ui.view,arch_db:account_invoice_bank_details.report_invoice_document_hide_detail
msgid "<strong>IBAN:</strong>"
msgstr ""

#. module: account_invoice_bank_details
#: model_terms:ir.ui.view,arch_db:account_invoice_bank_details.report_invoice_document_hide_detail
msgid "<strong>Payment information:</strong>"
msgstr "<strong>Payable auprès de:</strong>"

#. module: account_invoice_bank_details
#: model:ir.model,name:account_invoice_bank_details.model_account_move
msgid "Journal Entries"
msgstr "Pièces comptables"
3 changes: 3 additions & 0 deletions account_invoice_bank_details/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import account_move
32 changes: 32 additions & 0 deletions account_invoice_bank_details/models/account_move.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions account_invoice_bank_details/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions account_invoice_bank_details/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [camptocamp](https://camptocamp.com):
- Vincent Renaville \<<https://www.camptocamp.com>\>
- [Trobz](https://trobz.com):
- Do Anh Duy \<<[email protected]>\>
2 changes: 2 additions & 0 deletions account_invoice_bank_details/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 13.0 to 17.0 was financially supported
by Camptocamp
3 changes: 3 additions & 0 deletions account_invoice_bank_details/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions account_invoice_bank_details/report/invoice_report_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<template
id="report_invoice_document_bank_details"
inherit_id="account.report_invoice_document"
>

<xpath expr="//span[@id='payment_terms_note_id']" position="after">
<p class="mb-auto text-left">
<strong>Payment information:</strong>
</p>
<p class="mb-auto justify-text">
<strong>Bank:</strong> <span t-field="o.partner_bank_id.bank_name" />
</p>
<p class="mb-auto justify-text">
<strong>BIC / SWIFT:</strong> <span
t-field="o.partner_bank_id.bank_bic"
/>
</p>
<p>
<strong>IBAN:</strong> <span t-field="o.partner_bank_id.acc_number" />
</p>
</xpath>

</template>

</odoo>
Loading

0 comments on commit 0da0a1c

Please sign in to comment.