Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions account_vendor_bank_account_default/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
===================================
Account Vendor Bank Account Default
===================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:469bab1b746f6b2716cfd595ae29fdbadc667a433546b1c2ee95c89817221d1a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fbank--payment-lightgray.png?logo=github
:target: https://github.com/OCA/bank-payment/tree/18.0/account_vendor_bank_account_default
:alt: OCA/bank-payment
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/bank-payment-18-0/bank-payment-18-0-account_vendor_bank_account_default
: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/bank-payment&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows you to set a default bank account on partners for
their vendor bills.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

- Go to a partner form view, and edit the Default Bank Account in the
Sales and Purchase tab. The partner must be of type 'company', or an
individual without a parent company.

**Note:** If you do not set this value, it will be equal to the first
bank account created in the contact. This is the standard behaviour of
Odoo

- You can disable the default bank account option at contact level,
unmarking the "Has Default Bank Account" check.

Usage
=====

To use this module, you need to:

1. Create a vendor bill and select a partner with a default bank
account. Its recipient bank account will be the default one.

Known issues / Roadmap
======================

- This module depends on account_payment_partner. If the payment mode of
the invoice has a payment method that does not require a bank account,
the default bank account will be empty.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-payment/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/bank-payment/issues/new?body=module:%20account_vendor_bank_account_default%0Aversion:%2018.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
-------

* Sygel

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

- `Sygel <https://www.sygel.es>`__:

- Harald Panten
- Valentin Vinagre
- Alberto Martínez

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.

.. |maintainer-tisho99| image:: https://github.com/tisho99.png?size=40px
:target: https://github.com/tisho99
:alt: tisho99

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-tisho99|

This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/18.0/account_vendor_bank_account_default>`_ 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_vendor_bank_account_default/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
22 changes: 22 additions & 0 deletions account_vendor_bank_account_default/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 Alberto Martínez <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Account Vendor Bank Account Default",
"summary": "Set a default bank account on partners for their vendor bills",
"version": "18.0.1.0.0",
"development_status": "Beta",
"category": "Banking addons",
"website": "https://github.com/OCA/bank-payment",
"author": "Sygel, Odoo Community Association (OCA)",
"maintainers": ["tisho99"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"account",
"account_payment_partner",
],
"data": [
"views/res_partner_views.xml",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \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_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_res_partner
msgid "Contact"
msgstr ""

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__default_bank_id
msgid "Default Bank Account"
msgstr ""

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__has_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__has_default_bank_id
msgid "Has Default Bank Account"
msgstr ""

#. module: account_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__user_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__user_default_bank_id
msgid "User Default Bank Account"
msgstr ""
45 changes: 45 additions & 0 deletions account_vendor_bank_account_default/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-09 08:58+0000\n"
"Last-Translator: Alberto Martínez <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: account_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_res_partner
msgid "Contact"
msgstr "Contacte"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__default_bank_id
msgid "Default Bank Account"
msgstr "Compte bancari per defecte"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__has_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__has_default_bank_id
msgid "Has Default Bank Account"
msgstr "Té compte bancari per defecte"

#. module: account_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_account_move
msgid "Journal Entry"
msgstr "Entrada de diari"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__user_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__user_default_bank_id
msgid "User Default Bank Account"
msgstr "Compte bancari per defecte de l'usuari"
45 changes: 45 additions & 0 deletions account_vendor_bank_account_default/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-06 11:58+0000\n"
"Last-Translator: Alberto Martínez <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: account_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_res_partner
msgid "Contact"
msgstr "Contacto"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__default_bank_id
msgid "Default Bank Account"
msgstr "Cuenta bancaria por defecto"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__has_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__has_default_bank_id
msgid "Has Default Bank Account"
msgstr "Tiene cuenta bancaria por defecto"

#. module: account_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_account_move
msgid "Journal Entry"
msgstr "Entrada de diario"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__user_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__user_default_bank_id
msgid "User Default Bank Account"
msgstr "Cuenta bancaria por defecto del usuario"
45 changes: 45 additions & 0 deletions account_vendor_bank_account_default/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-07-23 09:58+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: account_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_res_partner
msgid "Contact"
msgstr "Contatto"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__default_bank_id
msgid "Default Bank Account"
msgstr "Conto bancario predefinito"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__has_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__has_default_bank_id
msgid "Has Default Bank Account"
msgstr "Ha conto bancario predefinito"

#. module: account_vendor_bank_account_default
#: model:ir.model,name:account_vendor_bank_account_default.model_account_move
msgid "Journal Entry"
msgstr "Registrazione contabile"

#. module: account_vendor_bank_account_default
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_partner__user_default_bank_id
#: model:ir.model.fields,field_description:account_vendor_bank_account_default.field_res_users__user_default_bank_id
msgid "User Default Bank Account"
msgstr "Conto bancario predefinito utente"
4 changes: 4 additions & 0 deletions account_vendor_bank_account_default/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import account_move
from . import res_partner
25 changes: 25 additions & 0 deletions account_vendor_bank_account_default/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Alberto Martínez <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class AccountMove(models.Model):
_inherit = "account.move"

def _compute_partner_bank_id(self):
res = super()._compute_partner_bank_id()
for move in self:
payment_mode = move.payment_mode_id
if (
payment_mode
and move.move_type == "in_invoice"
and payment_mode.payment_type == "outbound"
and payment_mode.payment_method_id.bank_account_required
):
move.partner_bank_id = (
move.bank_partner_id.default_bank_id
if move.bank_partner_id.has_default_bank_id
else False
)
return res
Loading