mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Added a new filename in the format Clieop03-[reference].txt
This commit is contained in:
@@ -61,7 +61,10 @@ class clieop_export(osv.osv):
|
||||
'date_generated':
|
||||
fields.date('Generation Date', readonly=True, select=True),
|
||||
'file':
|
||||
fields.binary('ClieOp File', readonly=True),
|
||||
fields.binary('ClieOp File', readonly=True,),
|
||||
'filename': fields.char(
|
||||
'File Name', size=32,
|
||||
),
|
||||
'state':
|
||||
fields.selection([
|
||||
('draft', 'Draft'),
|
||||
@@ -69,6 +72,7 @@ class clieop_export(osv.osv):
|
||||
('done', 'Reconciled'),
|
||||
], 'State', readonly=True),
|
||||
}
|
||||
|
||||
def get_daynr(self, cr, uid, context=None):
|
||||
'''
|
||||
Return highest day number
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
<field name="date_generated" />
|
||||
<field name="testcode" />
|
||||
<newline />
|
||||
<field name="file" colspan="4" />
|
||||
<field name="filename" invisible="True"/>
|
||||
<field name="file" colspan="4" filename="filename"/>
|
||||
</page>
|
||||
<page string="Payment Orders">
|
||||
<field name="payment_order_ids" colspan="4" nolabel="1">
|
||||
|
||||
@@ -143,8 +143,11 @@ class banking_export_clieop_wizard(osv.osv_memory):
|
||||
'payment_order_id', 'Payment Orders',
|
||||
readonly=True,
|
||||
),
|
||||
'filename': fields.char(
|
||||
'File Name', size=32,
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
_defaults = {
|
||||
'test': True,
|
||||
}
|
||||
@@ -334,6 +337,7 @@ class banking_export_clieop_wizard(osv.osv_memory):
|
||||
no_transactions = order.nr_posts,
|
||||
testcode = order.testcode,
|
||||
file = base64.encodestring(clieopfile.rawdata),
|
||||
filename = 'Clieop03-{0}.txt'.format(order.identification),
|
||||
daynumber = int(clieopfile.header.file_id[2:]),
|
||||
payment_order_ids = [
|
||||
[6, 0, [x.id for x in clieop_export['payment_order_ids']]]
|
||||
@@ -343,6 +347,7 @@ class banking_export_clieop_wizard(osv.osv_memory):
|
||||
filetype = order.name_transactioncode,
|
||||
testcode = order.testcode,
|
||||
file_id = file_id,
|
||||
filename = 'Clieop03-{0}.txt'.format(order.identification),
|
||||
state = 'finish',
|
||||
), context)
|
||||
return {
|
||||
@@ -375,7 +380,7 @@ class banking_export_clieop_wizard(osv.osv_memory):
|
||||
clieop_obj = self.pool.get('banking.export.clieop')
|
||||
payment_order_obj = self.pool.get('payment.order')
|
||||
clieop_file = clieop_obj.write(
|
||||
cursor, uid, clieop_export['file_id'].id, {'state':'sent'}
|
||||
cursor, uid, clieop_export['file_id'].id, {'state': 'sent'}
|
||||
)
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
for order in clieop_export['payment_order_ids']:
|
||||
|
||||
@@ -37,8 +37,9 @@
|
||||
<field name="prefered_date" />
|
||||
<field name="testcode" />
|
||||
<newline/>
|
||||
<field name="filename" invisible="True"/>
|
||||
<field name="file_id" />
|
||||
<field name="file" />
|
||||
<field name="file" filename="filename"/>
|
||||
<newline/>
|
||||
<button icon="gtk-close"
|
||||
string="Cancel"
|
||||
|
||||
Reference in New Issue
Block a user