mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
@@ -7,7 +7,7 @@ Account Banking SEPA Direct Debit
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:cc6b6adc710eb6bcae42f36c083a6031a21ddb7677735e129ff178a3be9ec612
|
||||
!! source digest: sha256:7d9245ac67651ecbd5ff384e64e3f07f3c45897c58cb60b9bd0e4b0af6e0bb6c
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
@@ -129,6 +129,7 @@ Contributors
|
||||
* Pedro M. Baeza
|
||||
* Sergio Teruel
|
||||
* Carlos Roca
|
||||
* Carolina Fernandez
|
||||
* Manuel Regidor <manuel.regidor@sygel.es>
|
||||
|
||||
Maintainers
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Copyright 2013-2020 Akretion (www.akretion.com)
|
||||
# Copyright 2016 Tecnativa - Antonio Espinosa
|
||||
# Copyright 2014-2022 Tecnativa - Pedro M. Baeza
|
||||
# Copyright 2024 Tecnativa - Carolina Fernandez
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
@@ -26,6 +27,7 @@
|
||||
"data/report_paperformat.xml",
|
||||
"reports/sepa_direct_debit_mandate.xml",
|
||||
"views/report_sepa_direct_debit_mandate.xml",
|
||||
"data/mail_template_data.xml",
|
||||
],
|
||||
"demo": ["demo/sepa_direct_debit_demo.xml"],
|
||||
"installable": True,
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo noupdate="1">
|
||||
<record id="email_template_sepa_mandate" model="mail.template">
|
||||
<field name="name">SEPA Mandate: Send by email</field>
|
||||
<field
|
||||
name="model_id"
|
||||
ref="account_banking_mandate.model_account_banking_mandate"
|
||||
/>
|
||||
<field
|
||||
name="subject"
|
||||
>SEPA Mandate {{ object.unique_mandate_reference or 'n/a' }} for {{ object.company_id.name }} is pending to sign</field>
|
||||
<field
|
||||
name="email_from"
|
||||
>{{ object.company_id.partner_id.email_formatted }}</field>
|
||||
<field name="partner_to">{{ object.partner_id.id }}</field>
|
||||
<field name="body_html" type="html">
|
||||
<div style="margin: 0px; padding: 0px;">
|
||||
<p style="margin: 0px; padding: 0px; font-size: 13px;">
|
||||
Hello,
|
||||
<br /><br />
|
||||
Your SEPA Mandate for <t
|
||||
t-out="object.company_id.name or ''"
|
||||
contenteditable="false"
|
||||
data-oe-t-inline="true"
|
||||
>YourCompany</t> is pending to sign.
|
||||
<br /><br />
|
||||
Do not hesitate to contact us if you have any questions.
|
||||
<br />
|
||||
|
||||
<t t-if="user.signature">
|
||||
<br />
|
||||
<t t-out="user.signature or ''">--<br />Mitchell Admin</t>
|
||||
</t>
|
||||
</p>
|
||||
</div>
|
||||
</field>
|
||||
<field name="report_template" ref="report_sepa_direct_debit_mandate" />
|
||||
<field
|
||||
name="report_name"
|
||||
>{{ (object.unique_mandate_reference or 'SEPA Mandate').replace('/','_') }}</field>
|
||||
<field name="lang">{{ object.partner_id.lang }}</field>
|
||||
<field name="auto_delete" eval="True" />
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -20,6 +20,27 @@ msgid ""
|
||||
"object.partner_id.name.replace(' ', '_') or '')"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,body_html:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid ""
|
||||
"<div style=\"margin: 0px; padding: 0px;\">\n"
|
||||
" <p style=\"margin: 0px; padding: 0px; font-size: 13px;\">\n"
|
||||
" Hello,\n"
|
||||
" <br><br>\n"
|
||||
" Your SEPA Mandate for <t t-out=\"object.company_id.name or ''\" contenteditable=\"false\" data-oe-t-inline=\"true\">YourCompany</t> is pending to sign.\n"
|
||||
" <br><br>\n"
|
||||
" Do not hesitate to contact us if you have any questions.\n"
|
||||
" <br>\n"
|
||||
"\n"
|
||||
" <t t-if=\"user.signature\">\n"
|
||||
" <br>\n"
|
||||
" <t t-out=\"user.signature or ''\">--<br>Mitchell Admin</t>\n"
|
||||
" </t>\n"
|
||||
"</p>\n"
|
||||
"</div>\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
|
||||
msgid "<em>Account Number - IBAN:</em>"
|
||||
@@ -236,6 +257,11 @@ msgstr ""
|
||||
msgid "Mandate update"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate__is_sent
|
||||
msgid "Mark Mandate As Sent"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#. odoo-python
|
||||
#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:0
|
||||
@@ -321,6 +347,18 @@ msgstr ""
|
||||
msgid "SEPA Direct Debit of customers"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,subject:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid ""
|
||||
"SEPA Mandate {{ object.unique_mandate_reference or 'n/a' }} for {{ "
|
||||
"object.company_id.name }} is pending to sign"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,name:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid "SEPA Mandate: Send by email"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.actions.report,name:account_banking_sepa_direct_debit.report_sepa_direct_debit_mandate
|
||||
msgid "SEPA Mandate"
|
||||
@@ -332,6 +370,11 @@ msgstr ""
|
||||
msgid "Scheme"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_form
|
||||
msgid "Send by Email"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__format__sepa
|
||||
msgid "Sepa Mandate"
|
||||
@@ -453,6 +496,11 @@ msgstr ""
|
||||
msgid "pain.008.003.02 (direct debit in Germany)"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,report_name:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid "{{ (object.unique_mandate_reference or 'SEPA Mandate').replace('/','_') }}"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
|
||||
msgid ""
|
||||
|
||||
@@ -28,6 +28,43 @@ msgstr ""
|
||||
"'Mandato-%s-%s' % (object.unique_mandate_reference, object.partner_id and "
|
||||
"object.partner_id.name.replace(' ', '_') or '')"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,body_html:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid ""
|
||||
"<div style=\"margin: 0px; padding: 0px;\">\n"
|
||||
" <p style=\"margin: 0px; padding: 0px; font-size: 13px;\">\n"
|
||||
" Hello,\n"
|
||||
" <br/><br/>\n"
|
||||
" Your SEPA Mandate for <t t-out=\"object.company_id.name or ''\" contenteditable=\"false\" data-oe-t-inline=\"true\">YourCompany</t> is pending to sign.\n"
|
||||
" <br/><br/>\n"
|
||||
" Do not hesitate to contact us if you have any questions.\n"
|
||||
" <br/>\n"
|
||||
"\n"
|
||||
" <t t-if=\"user.signature\">\n"
|
||||
" <br/>\n"
|
||||
" <t t-out=\"user.signature or ''\">--<br/>Mitchell Admin</t>\n"
|
||||
" </t>\n"
|
||||
"</p>\n"
|
||||
"</div>\n"
|
||||
" "
|
||||
msgstr ""
|
||||
"<div style=\"margin: 0px; padding: 0px;\">\n"
|
||||
" <p style=\"margin: 0px; padding: 0px; font-size: 13px;\">\n"
|
||||
" Hola,\n"
|
||||
" <br/><br/>\n"
|
||||
" El Mandato SEPA para <t t-out=\"object.company_id.name or ''\" contenteditable=\"false\" data-oe-t-inline=\"true\">YourCompany</t> está pendiente de firma.\n"
|
||||
" <br/><br/>\n"
|
||||
" No dude en contactarnos si tiene alguna pregunta.\n"
|
||||
" <br/>\n"
|
||||
"\n"
|
||||
" <t t-if=\"user.signature\">\n"
|
||||
" <br/>\n"
|
||||
" <t t-out=\"user.signature or ''\">--<br/>Mitchell Admin</t>\n"
|
||||
" </t>\n"
|
||||
"</p>\n"
|
||||
"</div>\n"
|
||||
" "
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.sepa_direct_debit_mandate_document
|
||||
msgid "<em>Account Number - IBAN:</em>"
|
||||
@@ -292,6 +329,11 @@ msgstr ""
|
||||
msgid "Mandate update"
|
||||
msgstr "Actualizacion de mandato"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate__is_sent
|
||||
msgid "Mark Mandate As Sent"
|
||||
msgstr "Mandato enviado"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#. odoo-python
|
||||
#: code:addons/account_banking_sepa_direct_debit/models/account_payment_line.py:0
|
||||
@@ -387,12 +429,29 @@ msgstr "Adeudo directo SEPA de clientes"
|
||||
msgid "SEPA Mandate"
|
||||
msgstr "Mandato SEPA"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,subject:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid ""
|
||||
"Mandato SEPA {{ object.unique_mandate_reference or 'n/a' }} para {{ "
|
||||
"object.company_id.name }} está pendiente de firma"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,name:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid "SEPA Mandate: Send by email"
|
||||
msgstr "Mandato SEPA: Enviar por correo electrónico"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields,field_description:account_banking_sepa_direct_debit.field_account_banking_mandate__scheme
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_search
|
||||
msgid "Scheme"
|
||||
msgstr "Esquema"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model_terms:ir.ui.view,arch_db:account_banking_sepa_direct_debit.view_mandate_form
|
||||
msgid "Send by Email"
|
||||
msgstr "Enviar por correo electrónico"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:ir.model.fields.selection,name:account_banking_sepa_direct_debit.selection__account_banking_mandate__format__sepa
|
||||
msgid "Sepa Mandate"
|
||||
@@ -543,6 +602,11 @@ msgstr ""
|
||||
" efectuar los adeudos en su cuenta siguiendo las "
|
||||
"instrucciones del acreedor"
|
||||
|
||||
#. module: account_banking_sepa_direct_debit
|
||||
#: model:mail.template,report_name:account_banking_sepa_direct_debit.email_template_sepa_mandate
|
||||
msgid "{{ (object.unique_mandate_reference or SEPA Mandate).replace('/','_') }}"
|
||||
msgstr "{{ (object.unique_mandate_reference or 'Mandato SEPA').replace('/','_') }}"
|
||||
|
||||
#, python-format
|
||||
#~ msgid ""
|
||||
#~ "Automatically switched from <b>First</b> to <b>Recurring</b> when the "
|
||||
|
||||
@@ -4,3 +4,4 @@ from . import account_payment_mode
|
||||
from . import account_payment_method
|
||||
from . import account_payment_order
|
||||
from . import account_payment_line
|
||||
from . import mail_compose_message
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Copyright 2020 Akretion - Alexis de Lattre
|
||||
# Copyright 2014 Tecnativa - Pedro M. Baeza
|
||||
# Copyright 2024 Tecnativa - Carolina Fernandez
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
import logging
|
||||
from datetime import datetime
|
||||
@@ -45,6 +46,7 @@ class AccountBankingMandate(models.Model):
|
||||
)
|
||||
unique_mandate_reference = fields.Char(size=35) # cf ISO 20022
|
||||
display_name = fields.Char(compute="_compute_display_name2", store=True)
|
||||
is_sent = fields.Boolean()
|
||||
|
||||
@api.constrains("type", "recurrent_sequence_type")
|
||||
def _check_recurring_type(self):
|
||||
@@ -121,3 +123,29 @@ class AccountBankingMandate(models.Model):
|
||||
xmlid = "account_banking_sepa_direct_debit.report_sepa_direct_debit_mandate"
|
||||
action = self.env.ref(xmlid).report_action(self)
|
||||
return action
|
||||
|
||||
def action_mandate_send(self):
|
||||
"""Opens a wizard to compose an email, with relevant mail template loaded by default"""
|
||||
self.ensure_one()
|
||||
template_id = self.env["ir.model.data"]._xmlid_to_res_id(
|
||||
"account_banking_sepa_direct_debit.email_template_sepa_mandate",
|
||||
raise_if_not_found=False,
|
||||
)
|
||||
ctx = {
|
||||
"default_model": "account.banking.mandate",
|
||||
"default_res_id": self.id,
|
||||
"default_use_template": bool(template_id),
|
||||
"default_template_id": template_id,
|
||||
"default_composition_mode": "comment",
|
||||
"is_sent": True,
|
||||
"force_email": True,
|
||||
}
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"view_mode": "form",
|
||||
"res_model": "mail.compose.message",
|
||||
"views": [(False, "form")],
|
||||
"view_id": False,
|
||||
"target": "new",
|
||||
"context": ctx,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Copyright 2024 Tecnativa - Carolina Fernandez
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class MailComposeMessage(models.TransientModel):
|
||||
_inherit = "mail.compose.message"
|
||||
|
||||
def _action_send_mail(self, auto_commit=False):
|
||||
for wizard in self:
|
||||
if self.env.context.get("is_sent"):
|
||||
self.env[wizard.model].sudo().browse(wizard.res_id).is_sent = True
|
||||
return super(MailComposeMessage, self)._action_send_mail(
|
||||
auto_commit=auto_commit
|
||||
)
|
||||
@@ -10,4 +10,5 @@
|
||||
* Pedro M. Baeza
|
||||
* Sergio Teruel
|
||||
* Carlos Roca
|
||||
* Carolina Fernandez
|
||||
* Manuel Regidor <manuel.regidor@sygel.es>
|
||||
|
||||
@@ -367,7 +367,7 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:cc6b6adc710eb6bcae42f36c083a6031a21ddb7677735e129ff178a3be9ec612
|
||||
!! source digest: sha256:7d9245ac67651ecbd5ff384e64e3f07f3c45897c58cb60b9bd0e4b0af6e0bb6c
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/bank-payment/tree/16.0/account_banking_sepa_direct_debit"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_banking_sepa_direct_debit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>Create SEPA files for Direct Debit</p>
|
||||
@@ -472,6 +472,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<li>Pedro M. Baeza</li>
|
||||
<li>Sergio Teruel</li>
|
||||
<li>Carlos Roca</li>
|
||||
<li>Carolina Fernandez</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Manuel Regidor <<a class="reference external" href="mailto:manuel.regidor@sygel.es">manuel.regidor@sygel.es</a>></li>
|
||||
|
||||
@@ -33,6 +33,23 @@ class TestMandate(TransactionCase):
|
||||
self.env["account.banking.mandate"]._sdd_mandate_set_state_to_expired()
|
||||
self.assertEqual(self.mandate.state, "expired")
|
||||
|
||||
def test_action_mandate_send(self):
|
||||
email_ctx = self.mandate.action_mandate_send().get("context", {})
|
||||
mail_template = (
|
||||
self.env["mail.template"]
|
||||
.browse(email_ctx.get("default_template_id"))
|
||||
.copy({"auto_delete": False})
|
||||
)
|
||||
self.mandate.with_context(**email_ctx).message_post_with_template(
|
||||
mail_template.id
|
||||
)
|
||||
mail_message = self.mandate.message_ids[0]
|
||||
self.assertEqual(
|
||||
self.mandate.partner_id, mail_message.sudo().mail_ids.recipient_ids
|
||||
)
|
||||
self.assertEqual(self.mandate.state, "draft")
|
||||
self.assertTrue(self.mandate.is_sent)
|
||||
|
||||
def setUp(self):
|
||||
res = super().setUp()
|
||||
self.partner = self.env.ref("base.res_partner_12")
|
||||
|
||||
@@ -13,6 +13,13 @@
|
||||
<field name="inherit_id" ref="account_banking_mandate.view_mandate_form" />
|
||||
<field name="arch" type="xml">
|
||||
<button name="validate" position="before">
|
||||
<button
|
||||
name="action_mandate_send"
|
||||
type="object"
|
||||
string="Send by Email"
|
||||
states="draft"
|
||||
class="btn-primary"
|
||||
/>
|
||||
<button name="print_report" type="object" string="Print" />
|
||||
</button>
|
||||
<field name="partner_id" position="after">
|
||||
|
||||
Reference in New Issue
Block a user