mirror of
https://github.com/brain-tec/account_ebics.git
synced 2025-08-14 22:55:38 +00:00
add ebics modules
This commit is contained in:
24
account_ebics_oca_cct/README.rst
Normal file
24
account_ebics_oca_cct/README.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: https://www.gnu.org/licenses/agpl
|
||||
:alt: License: AGPL-3
|
||||
|
||||
==============================
|
||||
Upload Payment Order via EBICS
|
||||
==============================
|
||||
|
||||
This module allows to upload a CCT Payment Order to the bank via the EBICS protocol.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
This module depends upon the following modules (cf. apps.odoo.com):
|
||||
|
||||
- account_ebics
|
||||
- account_banking_sepa_credit_transfer
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Create your Payment Order and generate the ISO 20022 Credit Transfer File.
|
||||
The wizard that allows to download this XML file now has an extra button called 'EBICS Upload'
|
||||
in order to send this file directly to your bank.
|
3
account_ebics_oca_cct/__init__.py
Normal file
3
account_ebics_oca_cct/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import models
|
||||
from . import wizard
|
19
account_ebics_oca_cct/__openerp__.py
Normal file
19
account_ebics_oca_cct/__openerp__.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2009-2018 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Upload Payment Order via EBICS',
|
||||
'version': '8.0.1.1.0',
|
||||
'license': 'AGPL-3',
|
||||
'author': 'Noviat',
|
||||
'category': 'Accounting & Finance',
|
||||
'depends': [
|
||||
'account_ebics',
|
||||
'account_banking_sepa_credit_transfer'],
|
||||
'data': [
|
||||
'views/payment_order.xml',
|
||||
'wizard/banking_export_sepa_wizard.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
2
account_ebics_oca_cct/models/__init__.py
Normal file
2
account_ebics_oca_cct/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import payment_order
|
13
account_ebics_oca_cct/models/payment_order.py
Normal file
13
account_ebics_oca_cct/models/payment_order.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2009-2018 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import fields, models
|
||||
|
||||
|
||||
class PaymentOrder(models.Model):
|
||||
_inherit = 'payment.order'
|
||||
|
||||
date_ebics_upload = fields.Date(
|
||||
string='EBICS upload date',
|
||||
readonly=True)
|
BIN
account_ebics_oca_cct/static/description/icon.png
Normal file
BIN
account_ebics_oca_cct/static/description/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
28
account_ebics_oca_cct/views/payment_order.xml
Normal file
28
account_ebics_oca_cct/views/payment_order.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_payment_order_form" model="ir.ui.view">
|
||||
<field name="name">payment.order.form.ebics</field>
|
||||
<field name="inherit_id" ref="account_payment.view_payment_order_form" />
|
||||
<field name="model">payment.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_prefered" position="after">
|
||||
<field name="date_ebics_upload"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_payment_order_tree" model="ir.ui.view">
|
||||
<field name="name">payment.order.tree.ebics</field>
|
||||
<field name="inherit_id" ref="account_payment.view_payment_order_tree"/>
|
||||
<field name="model">payment.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_created" position="after">
|
||||
<field name="date_ebics_upload"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
3
account_ebics_oca_cct/wizard/__init__.py
Normal file
3
account_ebics_oca_cct/wizard/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import banking_export_sepa_wizard
|
||||
from . import ebics_xfer
|
38
account_ebics_oca_cct/wizard/banking_export_sepa_wizard.py
Normal file
38
account_ebics_oca_cct/wizard/banking_export_sepa_wizard.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2009-2017 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import api, models, _
|
||||
|
||||
|
||||
class BankingExportSepaWizard(models.TransientModel):
|
||||
_inherit = 'banking.export.sepa.wizard'
|
||||
|
||||
@api.multi
|
||||
def ebics_upload(self):
|
||||
self.ensure_one()
|
||||
ctx = self._context.copy()
|
||||
payment_order = self.payment_order_ids[0]
|
||||
origin = _("Payment Order") + ': ' + payment_order.reference
|
||||
ctx.update({
|
||||
'default_upload_data': self.file,
|
||||
'default_upload_fname': self.filename,
|
||||
'origin': origin,
|
||||
'payment_order_id': payment_order.id,
|
||||
})
|
||||
ebics_xfer = self.env['ebics.xfer'].with_context(ctx).create({})
|
||||
ebics_xfer._onchange_upload_data()
|
||||
ebics_xfer._onchange_format_id()
|
||||
view = self.env.ref('account_ebics.ebics_xfer_view_form_upload')
|
||||
act = {
|
||||
'name': _('EBICS Upload'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'ebics.xfer',
|
||||
'view_id': view.id,
|
||||
'res_id': ebics_xfer.id,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'context': ctx,
|
||||
}
|
||||
return act
|
17
account_ebics_oca_cct/wizard/banking_export_sepa_wizard.xml
Normal file
17
account_ebics_oca_cct/wizard/banking_export_sepa_wizard.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="banking_export_sepa_wizard_view" model="ir.ui.view">
|
||||
<field name="name">banking.export.sepa.wizard.view</field>
|
||||
<field name="model">banking.export.sepa.wizard</field>
|
||||
<field name="inherit_id" ref="account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="save_sepa" position="before">
|
||||
<button name="ebics_upload" string="EBICS Upload" type="object" class="oe_highlight" states="finish"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
17
account_ebics_oca_cct/wizard/ebics_xfer.py
Normal file
17
account_ebics_oca_cct/wizard/ebics_xfer.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2009-2018 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models
|
||||
|
||||
|
||||
class EbicsXfer(models.TransientModel):
|
||||
_inherit = 'ebics.xfer'
|
||||
|
||||
def _ebics_upload(self):
|
||||
payment_order_id = self._context.get('payment_order_id')
|
||||
ebics_file = super(EbicsXfer, self)._ebics_upload()
|
||||
if ebics_file and payment_order_id:
|
||||
order = self.env['payment.order'].browse(payment_order_id)
|
||||
order.date_ebics_upload = ebics_file.date
|
||||
return ebics_file
|
Reference in New Issue
Block a user