Merge PR #565 into 11.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2019-08-21 18:12:24 +00:00
22 changed files with 495 additions and 1 deletions

View File

@@ -0,0 +1,67 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
============================
Account Banking Mandate Sale
============================
This modules adds the field *Direct Debit Mandate* on sale orders.
Configuration
=============
There is nothing to configure.
Usage
=====
When you select a payment mode that requires mandate on a sale order, Odoo will
select by default the first valid mandate of this customer.
The mandate will be copied from the sale order to the invoice.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/173/10.0
Known issues / Roadmap
======================
* No known issues.
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 smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Alexis de Lattre <alexis.delattre@akretion.com>
* Dave Burkholder <dave@thinkwelldesigns.com>
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit http://odoo-community.org.

View File

@@ -0,0 +1,2 @@
from . import models
from . import wizard

View File

@@ -0,0 +1,21 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Account Banking Mandate Sale',
'version': '11.0.1.0.0',
'category': 'Banking addons',
'license': 'AGPL-3',
'summary': "Adds mandates on sale orders",
'author': "Akretion, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
'depends': [
'account_payment_sale',
'account_banking_mandate',
],
'data': [
'views/sale_order.xml',
],
'installable': True,
}

View File

@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.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_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Quotation"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr ""

View File

@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
# Translators:
# Niki Waibel, 2016
msgid ""
msgstr ""
"Project-Id-Version: bank-payment (10.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-21 10:17+0000\n"
"PO-Revision-Date: 2016-11-01 20:09+0000\n"
"Last-Translator: Niki Waibel\n"
"Language-Team: German (http://www.transifex.com/oca/OCA-bank-payment-10-0/"
"language/de/)\n"
"Language: de\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"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr "Gewerbliche Instanz"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr "Lastschrift Mandat"
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr "Verkaufsanzahlungsrechnung"
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Sales Order"
msgstr "Kundenauftrag"

View File

@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: bank-payment (10.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-24 00:21+0000\n"
"PO-Revision-Date: 2016-12-27 12:11+0000\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-bank-payment-10-0/"
"language/es/)\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"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr "Entidad comercial"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr "Mandato de adeudo directo"
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr "Ventas. Anticipo pago factura"
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Sales Order"
msgstr "Pedido de venta"

View File

@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: bank-payment (10.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-20 01:40+0000\n"
"PO-Revision-Date: 2016-10-19 23:45+0000\n"
"Last-Translator: <>\n"
"Language-Team: Croatian (http://www.transifex.com/oca/OCA-bank-payment-10-0/"
"language/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Sales Order"
msgstr "Ponuda"

View File

@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
# Translators:
# Erwin van der Ploeg <erwin@odooexperts.nl>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-22 23:52+0000\n"
"PO-Revision-Date: 2016-07-22 23:52+0000\n"
"Last-Translator: Erwin van der Ploeg <erwin@odooexperts.nl>, 2016\n"
"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n"
"Language: nl\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"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr "Commerciële Entiteit"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr "Incasso mandaat"
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr "Verkoop Incassofactuur"
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Sales Order"
msgstr "Verkooporder"

View File

@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: bank-payment (10.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-18 00:42+0000\n"
"PO-Revision-Date: 2016-10-19 23:45+0000\n"
"Last-Translator: <>\n"
"Language-Team: Dutch (Netherlands) (http://www.transifex.com/oca/OCA-bank-"
"payment-10-0/language/nl_NL/)\n"
"Language: nl_NL\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"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Sales Order"
msgstr "Verkooporder"

View File

@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-01 19:28+0000\n"
"PO-Revision-Date: 2016-07-01 19:28+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/"
"teams/23907/pt_BR/)\n"
"Language: pt_BR\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"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Sales Order"
msgstr "Pedido de Venda"

View File

@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_mandate_sale
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-01 19:28+0000\n"
"PO-Revision-Date: 2016-07-01 19:28+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_commercial_partner_id
msgid "Commercial Entity"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model.fields,field_description:account_banking_mandate_sale.field_sale_order_mandate_id
msgid "Direct Debit Mandate"
msgstr "Mandat za direktne obremenitve"
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_advance_payment_inv
msgid "Sales Advance Payment Invoice"
msgstr ""
#. module: account_banking_mandate_sale
#: model:ir.model,name:account_banking_mandate_sale.model_sale_order
msgid "Sales Order"
msgstr "Plačilni nalog"

View File

@@ -0,0 +1 @@
from . import sale_order

View File

@@ -0,0 +1,37 @@
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
class SaleOrder(models.Model):
_inherit = "sale.order"
# This field commercial_partner_id should be moved
# in an OCA base module named for example sale_commercial_partner
commercial_partner_id = fields.Many2one(
related='partner_id.commercial_partner_id', string='Commercial Entity',
store=True, readonly=True)
mandate_id = fields.Many2one(
'account.banking.mandate', string='Direct Debit Mandate',
ondelete='restrict', readonly=True,
states={'draft': [('readonly', False)], 'sent': [('readonly', False)]})
@api.multi
def _prepare_invoice(self):
"""Copy mandate from sale order to invoice"""
vals = super(SaleOrder, self)._prepare_invoice()
vals['mandate_id'] = self.mandate_id.id
return vals
@api.onchange('payment_mode_id')
def payment_mode_change(self):
"""Select by default the first valid mandate of the partner"""
if (
self.payment_mode_id.payment_method_id.mandate_required and
self.partner_id):
mandates = self.env['account.banking.mandate'].search([
('state', '=', 'valid'),
('partner_id', '=', self.commercial_partner_id.id),
])
self.mandate_id = mandates[:1]

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_order_form" model="ir.ui.view">
<field name="name">account_banking_mandate_sale.sale_order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="account_payment_sale.view_order_form"/>
<field name="arch" type="xml">
<field name="fiscal_position_id" position="after">
<field name="commercial_partner_id" invisible="1"/>
<field name="mandate_id"
domain="[('partner_id', '=', commercial_partner_id), ('state', 'in', ('draft', 'valid'))]"/>
</field>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
from . import sale_make_invoice_advance

View File

@@ -0,0 +1,17 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api
class SaleAdvancePaymentInv(models.TransientModel):
_inherit = 'sale.advance.payment.inv'
@api.multi
def _create_invoice(self, order, so_line, amount):
"""Copy mandate from sale order to invoice"""
inv = super(SaleAdvancePaymentInv, self)._create_invoice(
order, so_line, amount)
if order.mandate_id:
inv.mandate_id = order.mandate_id.id
return inv

View File

@@ -1 +1 @@
11.0.20181025.0
11.0.20190821.0

View File

@@ -9,6 +9,7 @@ setuptools.setup(
version=version,
install_requires=[
'odoo11-addon-account_banking_mandate',
'odoo11-addon-account_banking_mandate_sale',
'odoo11-addon-account_banking_pain_base',
'odoo11-addon-account_banking_sepa_credit_transfer',
'odoo11-addon-account_banking_sepa_direct_debit',

View File

@@ -0,0 +1 @@
../../../../account_banking_mandate_sale

View File

@@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)