fields.date.context_today doesn't work with datetime => we now use the native field create_date Coding style improvements.

This commit is contained in:
Alexis de Lattre
2013-11-07 12:50:36 +01:00
committed by Enric Tobella
parent abedbfaa96
commit 0779669064
6 changed files with 10 additions and 13 deletions

View File

@@ -20,6 +20,5 @@
#
##############################################################################
import wizard
import account_banking_sepa
from . import wizard
from . import account_banking_sepa

View File

@@ -35,7 +35,7 @@ class banking_export_sepa(orm.Model):
for sepa_file in self.browse(cr, uid, ids, context=context):
ref = sepa_file.payment_order_ids[0].reference
if ref:
label = ref.replace('/', '-')
label = unidecode(ref.replace('/', '-'))
else:
label = 'error'
res[sepa_file.id] = 'sct_%s.xml' % label
@@ -64,8 +64,7 @@ class banking_export_sepa(orm.Model):
('SLEV', 'Following Service Level'),
], 'Charge Bearer', readonly=True,
help='Shared : transaction charges on the sender side are to be borne by the debtor, transaction charges on the receiver side are to be borne by the creditor (most transfers use this). 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. Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme.'),
'generation_date': fields.datetime(
'Generation Date', readonly=True),
'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',
@@ -78,6 +77,5 @@ class banking_export_sepa(orm.Model):
}
_defaults = {
'generation_date': fields.date.context_today,
'state': 'draft',
}

View File

@@ -19,7 +19,7 @@
<field name="prefered_exec_date" />
<field name="batch_booking" />
<field name="charge_bearer"/>
<field name="generation_date" />
<field name="create_date" />
<newline />
<field name="file" filename="filename"/>
<field name="filename" invisible="True"/>
@@ -48,7 +48,7 @@
<tree string="SEPA Credit Transfer">
<field name="filename"/>
<field name="prefered_exec_date"/>
<field name="generation_date"/>
<field name="create_date"/>
<field name="nb_transactions"/>
</tree>
</field>

View File

@@ -20,4 +20,4 @@
#
##############################################################################
import export_sepa
from . import export_sepa

View File

@@ -36,7 +36,7 @@ _logger = logging.getLogger(__name__)
class banking_export_sepa_wizard(orm.TransientModel):
_name = 'banking.export.sepa.wizard'
_description = 'Export SEPA Credit Transfer XML file'
_description = 'Export SEPA Credit Transfer File'
_columns = {
'state': fields.selection([
@@ -418,7 +418,7 @@ class banking_export_sepa_wizard(orm.TransientModel):
}, context=context)
action = {
'name': 'SEPA Credit Transfer XML',
'name': 'SEPA Credit Transfer File',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form,tree',

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2010-2012 Akretion (http://www.akretion.com)
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
-->