Clean files

This commit is contained in:
Pedro M. Baeza
2014-10-07 00:09:26 +02:00
committed by Enric Tobella
parent 833144982b
commit c741907814
3 changed files with 0 additions and 182 deletions

View File

@@ -1,90 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for OpenERP
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import orm, fields
from openerp.addons.decimal_precision import decimal_precision as dp
from unidecode import unidecode
class banking_export_sepa(orm.Model):
'''SEPA export'''
_name = 'banking.export.sepa'
_description = __doc__
_rec_name = 'filename'
def _generate_filename(self, cr, uid, ids, name, arg, context=None):
res = {}
for sepa_file in self.browse(cr, uid, ids, context=context):
ref = sepa_file.payment_order_ids[0].reference
if ref:
label = unidecode(ref.replace('/', '-'))
else:
label = 'error'
res[sepa_file.id] = 'sct_%s.xml' % label
return res
_columns = {
'payment_order_ids': fields.many2many(
'payment.order',
'account_payment_order_sepa_rel',
'banking_export_sepa_id', 'account_order_id',
'Payment Orders',
readonly=True),
'nb_transactions': fields.integer(
'Number of Transactions', readonly=True),
'total_amount': fields.float(
'Total Amount', digits_compute=dp.get_precision('Account'),
readonly=True),
'batch_booking': fields.boolean(
'Batch Booking', readonly=True,
help="If true, the bank statement will display only one debit "
"line for all the wire transfers of the SEPA XML file ; "
"if false, the bank statement will display one debit line "
"per wire transfer of the SEPA XML file."),
'charge_bearer': fields.selection([
('SLEV', 'Following Service Level'),
('SHAR', 'Shared'),
('CRED', 'Borne by Creditor'),
('DEBT', 'Borne by Debtor'),
], 'Charge Bearer', readonly=True,
help="Following service level : transaction charges are to be "
"applied following the rules agreed in the service level and/or "
"scheme (SEPA Core messages must use this). Shared : "
"transaction charges on the creditor side are to be borne by "
"the creditor, transaction charges on the debtor side are to "
"be borne by the debtor. Borne by creditor : all transaction "
"charges are to be borne by the creditor. Borne by debtor : "
"all transaction charges are to be borne by the debtor."),
'create_date': fields.datetime('Generation Date', readonly=True),
'file': fields.binary('SEPA XML File', readonly=True),
'filename': fields.function(
_generate_filename, type='char', size=256, string='Filename',
readonly=True),
'state': fields.selection([
('draft', 'Draft'),
('sent', 'Sent'),
], 'State', readonly=True),
}
_defaults = {
'state': 'draft',
}

View File

@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_banking_export_sepa_form" model="ir.ui.view">
<field name="name">account.banking.export.sepa.form</field>
<field name="model">banking.export.sepa</field>
<field name="arch" type="xml">
<form string="SEPA Credit Transfer" version="7.0">
<header>
<field name="state" widget="statusbar"/>
</header>
<notebook>
<page string="General Information">
<group name="main">
<field name="total_amount" />
<field name="nb_transactions" />
<field name="batch_booking" />
<field name="charge_bearer"/>
<field name="create_date" />
<field name="file" filename="filename"/>
<field name="filename" invisible="True"/>
</group>
</page>
<page string="Payment Orders">
<field name="payment_order_ids" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="view_banking_export_sepa_tree" model="ir.ui.view">
<field name="name">account.banking.export.sepa.tree</field>
<field name="model">banking.export.sepa</field>
<field name="arch" type="xml">
<tree string="SEPA Credit Transfer">
<field name="filename"/>
<field name="create_date"/>
<field name="nb_transactions"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_account_banking_sepa" model="ir.actions.act_window">
<field name="name">SEPA Credit Transfer Files</field>
<field name="res_model">banking.export.sepa</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="menu_account_banking_sepa"
parent="account_payment.menu_main_payment"
action="action_account_banking_sepa"
sequence="15"
/>
<act_window id="act_banking_export_sepa_payment_order"
name="SEPA Credit Transfer Files"
domain="[('payment_order_ids', '=', active_id)]"
res_model="banking.export.sepa"
src_model="payment.order"
view_type="form"
view_mode="tree,form"
/>
</data>
</openerp>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="sepa_credit_transfer_mode" model="payment.mode">
<field name="name">SEPA Credit Transfer La Banque Postale</field>
<field name="journal" ref="account.bank_journal"/>
<field name="bank_id" ref="account_banking_payment_export.main_company_iban"/>
<field name="company_id" ref="base.main_company"/>
<field name="type" ref="export_sepa_sct_001_001_03"/>
</record>
</data>
</openerp>