Skip to content

Commit

Permalink
Merge PR #1183 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 25, 2023
2 parents cd066c3 + 4d1c73b commit eefc338
Show file tree
Hide file tree
Showing 44 changed files with 6,369 additions and 0 deletions.
133 changes: 133 additions & 0 deletions account_payment_partner/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
=======================
Account Payment Partner
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1e2b38367db6bacc47711402f2eb9ef0f076f2c8a0317874407c547af811eb59
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |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/17.0/account_payment_partner
: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-17-0/bank-payment-17-0-account_payment_partner
: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=17.0
:alt: Try me on Runboat

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

This module adds several fields:

- the *Supplier Payment Mode* and *Customer Payment Mode* on Partners,
- the *Payment Mode* on Invoices.
- the *Show bank account* on Payment Mode.
- the *# of digits for customer bank account* on Payment Mode.
- the *Bank account from journals* on Payment Mode.
- the *Payment mode* on Invoices Analysis.

On a Payment Order, in the wizard *Select Invoices to Pay*, the invoices
will be filtered per Payment Mode.

Allows to print in the invoice to which account number the payment (via
SEPA direct debit) is going to be charged so the customer knows that
information, but there are some customers that don't want that everyone
looking at the invoice sees the full account number (and even GDPR can
say a word about that), so that's the reason behind the several options.

**Table of contents**

.. contents::
:local:

Usage
=====

You are able to add a payment mode directly on a partner.

This payment mode is automatically associated to the invoice related to
the partner. This default value could be changed in a draft invoice.

When you create a payment order, only invoices related to chosen payment
mode are displayed.

Invoices without any payment mode are displayed too.

Changelog
=========

10.0.1.2.0 (2018-05-24)
-----------------------

- [IMP] Add options to show partner bank account in invoice report
(`#458 <https://github.com/OCA/bank-payment/issues/458>`__)

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_payment_partner%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
-------

* Akretion
* Tecnativa

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

- Alexis de Lattre <[email protected]>
- Raphaël Valyi
- Stefan Rijnhart (Therp)
- Alexandre Fayolle
- Stéphane Bidoul <[email protected]>
- Danimar Ribeiro
- Angel Moya <[email protected]>
- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Carlos Dauden
- Víctor Martínez

- `DynApps <https://www.dynapps.be>`__:

- Raf Ven <[email protected]>

- Marçal Isern <[email protected]>
- Miquel Alzanillas <[email protected]>

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/bank-payment <https://github.com/OCA/bank-payment/tree/17.0/account_payment_partner>`_ project on GitHub.

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

from .hooks import pre_init_hook
from . import models
from . import reports
28 changes: 28 additions & 0 deletions account_payment_partner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2014 Akretion - Alexis de Lattre <[email protected]>
# Copyright 2014 Tecnativa - Pedro M. Baeza
# Copyright 2018 Tecnativa - Carlos Dauden
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Account Payment Partner",
"version": "17.0.1.0.0",
"category": "Banking addons",
"license": "AGPL-3",
"summary": "Adds payment mode on partners and invoices",
"author": "Akretion, Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/bank-payment",
"development_status": "Mature",
"depends": ["account_payment_mode"],
"data": [
"views/res_partner_view.xml",
"views/account_move_view.xml",
"views/account_move_line.xml",
"views/account_payment_mode.xml",
"views/report_invoice.xml",
"reports/account_invoice_report_view.xml",
],
"demo": ["demo/partner_demo.xml"],
"installable": True,
"pre_init_hook": "pre_init_hook",
}
35 changes: 35 additions & 0 deletions account_payment_partner/demo/partner_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record
id="default_supplier_payment_mode_id"
model="ir.property"
forcecreate="True"
>
<field name="name">Default Supplier Payment Mode</field>
<field
name="fields_id"
search="[('model','=','res.partner'),('name','=','supplier_payment_mode_id')]"
/>
<field
name="value"
eval="'account.payment.mode,'+str(ref('account_payment_mode.payment_mode_outbound_ct1'))"
/>
<field name="company_id" ref="base.main_company" />
</record>
<record
id="default_customer_payment_mode_id"
model="ir.property"
forcecreate="True"
>
<field name="name">Default Customer Payment Mode</field>
<field
name="fields_id"
search="[('model','=','res.partner'),('name','=','customer_payment_mode_id')]"
/>
<field
name="value"
eval="'account.payment.mode,'+str(ref('account_payment_mode.payment_mode_inbound_ct1'))"
/>
<field name="company_id" ref="base.main_company" />
</record>
</odoo>
22 changes: 22 additions & 0 deletions account_payment_partner/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import logging

from odoo.tools import sql

logger = logging.getLogger(__name__)


def pre_init_hook(env):
"""Prepare new payment_mode fields.
Add columns to avoid Memory error on an existing Odoo instance
with lots of data.
The payment_mode_id fields are introduced by this module and computed only
from each other or the also newly introduced supplier_payment_mode_id and
customer_payment_mode_id on res.partner, so they can stay NULL, nothing
to compute.
"""
if not sql.column_exists(env.cr, "account_move", "payment_mode_id"):
sql.create_column(env.cr, "account_move", "payment_mode_id", "int4")
if not sql.column_exists(env.cr, "account_move_line", "payment_mode_id"):
sql.create_column(env.cr, "account_move_line", "payment_mode_id", "int4")
Loading

0 comments on commit eefc338

Please sign in to comment.