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
123 changes: 123 additions & 0 deletions account_vendor_bank_account_default_purchase/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
============================================
Account Vendor Bank Account Default Purchase
============================================

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

.. |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_purchase
: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_purchase
: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 purchase orders.
That bank account will be propagated to its 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 set as a 'company', or as
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 purchase order. On the other info tab you can see its bank
account, which will be equal to the configured in the partner's
"Default Bank Account" field.
2. Confirm the purchase and create its vendor bill. Its recipient bank
account will be equal to the purchase's bank account.

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

- This module depends on account_payment_purchase. If the payment mode
of the purchase 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_purchase%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_purchase>`_ 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_purchase/__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
18 changes: 18 additions & 0 deletions account_vendor_bank_account_default_purchase/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 Purchase",
"summary": "Set a default bank account purchase orders",
"version": "18.0.1.0.0",
"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_payment_purchase",
"account_vendor_bank_account_default",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default_purchase
#
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_purchase
#: model:ir.model,name:account_vendor_bank_account_default_purchase.model_purchase_order
msgid "Purchase Order"
msgstr ""
22 changes: 22 additions & 0 deletions account_vendor_bank_account_default_purchase/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default_purchase
#
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_purchase
#: model:ir.model,name:account_vendor_bank_account_default_purchase.model_purchase_order
msgid "Purchase Order"
msgstr "Ordre de compra"
22 changes: 22 additions & 0 deletions account_vendor_bank_account_default_purchase/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default_purchase
#
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_purchase
#: model:ir.model,name:account_vendor_bank_account_default_purchase.model_purchase_order
msgid "Purchase Order"
msgstr "Pedido de compra"
22 changes: 22 additions & 0 deletions account_vendor_bank_account_default_purchase/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_vendor_bank_account_default_purchase
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-05 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_purchase
#: model:ir.model,name:account_vendor_bank_account_default_purchase.model_purchase_order
msgid "Purchase Order"
msgstr "Ordine di acquisto"
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 purchase_order
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2024 Alberto Martínez <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import api, models


class PurchaseOrder(models.Model):
_inherit = "purchase.order"

def _get_default_supplier_partner_bank(self, partner):
if not partner.has_default_bank_id:
return False
elif partner.default_bank_id:
return partner.default_bank_id.id
else:
return super()._get_default_supplier_partner_bank(partner)

@api.depends("partner_id", "company_id")
def _compute_payment_mode(self):
res = super()._compute_payment_mode()
for order in self:
if (
order.payment_mode_id.payment_method_id.bank_account_required
and order.partner_id
):
order.supplier_partner_bank_id = (
order._get_default_supplier_partner_bank(order.partner_id)
)
else:
order.supplier_partner_bank_id = False
return res
3 changes: 3 additions & 0 deletions account_vendor_bank_account_default_purchase/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
11 changes: 11 additions & 0 deletions account_vendor_bank_account_default_purchase/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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 set as a 'company', or as 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [Sygel](https://www.sygel.es):
- Harald Panten
- Valentin Vinagre
- Alberto Martínez
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows you to set a default bank account purchase orders.
That bank account will be propagated to its vendor bills.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- This module depends on account_payment_purchase. If the payment mode of the purchase has a payment method that does not require a bank account, the default bank account will be empty.
4 changes: 4 additions & 0 deletions account_vendor_bank_account_default_purchase/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module, you need to:

1. Create a purchase order. On the other info tab you can see its bank account, which will be equal to the configured in the partner's "Default Bank Account" field.
2. Confirm the purchase and create its vendor bill. Its recipient bank account will be equal to the purchase's bank account.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading