Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] account_banking_mandate_contact: Migration to 16.0. #1233

Merged
Merged
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
104 changes: 104 additions & 0 deletions account_banking_mandate_contact/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
===============================
Account Banking Mandate Contact
===============================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |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/16.0/account_banking_mandate_contact
: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-16-0/bank-payment-16-0-account_banking_mandate_contact
: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=16.0
:alt: Try me on Runboat

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

This module allows to select a specific banking mandate
(and thus, a specific bank account) at contact level, so that when doing
a debit order, such mandate is used for the invoices issued to that contact.

**Table of contents**

.. contents::
:local:

Usage
=====

For selecting the mandate at contact level:

#. Go to *Invoicing > Customers > Customers*.
#. Open or create one contact that has a parent.
#. On the "..." page, fill *Contact Mandate*.
#. That mandate will be populated in the debit order.

Then the normal flow will be:

#. Go to Invoicing > Customers > Customer invoices.
#. Create a new invoice for that contact.
#. Post the invoice.
#. Add it to a payment order, by any of the options that you can check on the *account_payment_order* module.
#. The populated mandate will be the one on the contact.

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_banking_mandate_contact%0Aversion:%2016.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
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Carlos Dauden
* Ernesto Tejeda
* Pedro M. Baeza

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

* 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.

This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/16.0/account_banking_mandate_contact>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions account_banking_mandate_contact/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
18 changes: 18 additions & 0 deletions account_banking_mandate_contact/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2019 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Account Banking Mandate Contact",
"summary": "Assign specific banking mandates in contact level",
"version": "16.0.1.0.1",
"development_status": "Production/Stable",
"category": "Banking addons",
"website": "https://github.com/OCA/bank-payment",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["account_banking_mandate", "sale"],
"data": [
"views/res_partner.xml",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_contact
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_banking_mandate_contact
#: model:ir.model,name:account_banking_mandate_contact.model_res_partner
msgid "Contact"
msgstr ""

#. module: account_banking_mandate_contact
#: model:ir.model.fields,field_description:account_banking_mandate_contact.field_res_partner__contact_mandate_id
#: model:ir.model.fields,field_description:account_banking_mandate_contact.field_res_users__contact_mandate_id
msgid "Contact Mandate"
msgstr ""

#. module: account_banking_mandate_contact
#: model:ir.model,name:account_banking_mandate_contact.model_account_move_line
msgid "Journal Item"
msgstr ""
34 changes: 34 additions & 0 deletions account_banking_mandate_contact/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_contact
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-21 12:57+0100\n"
"PO-Revision-Date: 2020-02-21 12:58+0100\n"
"Last-Translator: Carlos Dauden <[email protected]>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.8.7.1\n"

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

#. module: account_banking_mandate_contact
#: model:ir.model.fields,field_description:account_banking_mandate_contact.field_res_partner__contact_mandate_id
#: model:ir.model.fields,field_description:account_banking_mandate_contact.field_res_users__contact_mandate_id
msgid "Contact Mandate"
msgstr "Mandato del contacto"

#. module: account_banking_mandate_contact
#: model:ir.model,name:account_banking_mandate_contact.model_account_move_line
msgid "Journal Item"
msgstr "Apunte contable"
3 changes: 3 additions & 0 deletions account_banking_mandate_contact/models/__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 account_move_line
from . import res_partner
27 changes: 27 additions & 0 deletions account_banking_mandate_contact/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2019 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).


from odoo import models


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

# Extended to use partner_shipping_id mandate if it have set
def _prepare_payment_line_vals(self, payment_order):
vals = super(AccountMoveLine, self)._prepare_payment_line_vals(payment_order)
if payment_order.payment_type != "inbound" or self.move_id.mandate_id:
return vals
mandate = (
self.move_id.partner_shipping_id.valid_mandate_id
or self.move_id.partner_id.valid_mandate_id
)
if mandate:
vals.update(
{
"mandate_id": mandate.id,
"partner_bank_id": mandate.partner_bank_id.id,
}
)
return vals
21 changes: 21 additions & 0 deletions account_banking_mandate_contact/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2019 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

contact_mandate_id = fields.Many2one(
comodel_name="account.banking.mandate",
string="Contact Mandate",
)

def _compute_valid_mandate_id(self):
partners_to_process = self.filtered(
lambda x: x.contact_mandate_id.state == "valid"
)
for partner in partners_to_process:
partner.valid_mandate_id = partner.contact_mandate_id
return super(ResPartner, self - partners_to_process)._compute_valid_mandate_id()
9 changes: 9 additions & 0 deletions account_banking_mandate_contact/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Carlos Dauden
* Ernesto Tejeda
* Pedro M. Baeza

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

* Alberto Martínez
3 changes: 3 additions & 0 deletions account_banking_mandate_contact/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module allows to select a specific banking mandate
(and thus, a specific bank account) at contact level, so that when doing
a debit order, such mandate is used for the invoices issued to that contact.
14 changes: 14 additions & 0 deletions account_banking_mandate_contact/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
For selecting the mandate at contact level:

#. Go to *Invoicing > Customers > Customers*.
#. Open or create one contact that has a parent.
#. On the "..." page, fill *Contact Mandate*.
#. That mandate will be populated in the debit order.

Then the normal flow will be:

#. Go to Invoicing > Customers > Customer invoices.
#. Create a new invoice for that contact.
#. Post the invoice.
#. Add it to a payment order, by any of the options that you can check on the *account_payment_order* module.
#. The populated mandate will be the one on the contact.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading