mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[ADD] Ability to store the HSBC Client ID for HSBCNet, and use that on the payment files
[FIX] Upgrading to version 6.1
This commit is contained in:
@@ -118,6 +118,7 @@ class banking_import(osv.osv_memory):
|
||||
statement_obj = self.pool.get('account.bank.statement')
|
||||
statement_file_obj = self.pool.get('account.banking.imported.file')
|
||||
import_transaction_obj = self.pool.get('banking.import.transaction')
|
||||
period_obj = self.pool.get('account.period')
|
||||
|
||||
# get the parser to parse the file
|
||||
parser_code = banking_import.parser
|
||||
@@ -256,6 +257,12 @@ class banking_import(osv.osv_memory):
|
||||
)
|
||||
continue
|
||||
|
||||
# Get the period for the statement (as bank statement object checks this)
|
||||
period_ids = period_obj.search(cursor, uid, [('company_id','=',company.id),
|
||||
('date_start','<=',statement.date),
|
||||
('date_stop','>=',statement.date)])
|
||||
|
||||
# Create the bank statement record
|
||||
statement_id = statement_obj.create(cursor, uid, dict(
|
||||
name = statement.id,
|
||||
journal_id = account_info.journal_id.id,
|
||||
@@ -266,6 +273,8 @@ class banking_import(osv.osv_memory):
|
||||
state = 'draft',
|
||||
user_id = uid,
|
||||
banking_id = import_id,
|
||||
company_id = company.id,
|
||||
period_id = period_ids[0],
|
||||
))
|
||||
imported_statement_ids.append(statement_id)
|
||||
|
||||
@@ -282,6 +291,8 @@ class banking_import(osv.osv_memory):
|
||||
values[attr] = eval('transaction.%s' % attr)
|
||||
values['statement_id'] = statement_id
|
||||
values['bank_country_code'] = bank_country_code
|
||||
values['local_account'] = statement.local_account
|
||||
|
||||
transaction_id = import_transaction_obj.create(cursor, uid, values, context=context)
|
||||
if transaction_id:
|
||||
transaction_ids.append(transaction_id)
|
||||
@@ -292,6 +303,30 @@ class banking_import(osv.osv_memory):
|
||||
|
||||
import_transaction_obj.match(cursor, uid, transaction_ids, results=results, context=context)
|
||||
|
||||
#recompute statement end_balance for validation
|
||||
statement_obj.button_dummy(
|
||||
cursor, uid, imported_statement_ids, context=context)
|
||||
|
||||
|
||||
# Original code. Didn't take workflow logistics into account...
|
||||
#
|
||||
#cursor.execute(
|
||||
# "UPDATE payment_order o "
|
||||
# "SET state = 'done', "
|
||||
# "date_done = '%s' "
|
||||
# "FROM payment_line l "
|
||||
# "WHERE o.state = 'sent' "
|
||||
# "AND o.id = l.order_id "
|
||||
# "AND l.id NOT IN ("
|
||||
# "SELECT DISTINCT id FROM payment_line "
|
||||
# "WHERE date_done IS NULL "
|
||||
# "AND id IN (%s)"
|
||||
# ")" % (
|
||||
# time.strftime('%Y-%m-%d'),
|
||||
# ','.join([str(x) for x in payment_line_ids])
|
||||
# )
|
||||
#)
|
||||
|
||||
report = [
|
||||
'%s: %s' % (_('Total number of statements'),
|
||||
results.stat_skipped_cnt + results.stat_loaded_cnt),
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<notebook colspan="4">
|
||||
<page attrs="{'invisible': [('state', '!=', 'review')]}" string="Transactions">
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Transaction" min_rows="20" colors="red:duplicate;blue:reconcile_id">
|
||||
<tree string="Transaction" colors="red:duplicate;blue:reconcile_id">
|
||||
<field name="date"/>
|
||||
<field name="amount"/>
|
||||
<field name="ref"/>
|
||||
@@ -30,7 +30,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page attrs="{'invisible': [('state', '=', 'init'')]}" string="Log">
|
||||
<page attrs="{'invisible': [('state', '=', 'init')]}" string="Log">
|
||||
<field name="log" colspan="4" nolabel="1" width="500"/>
|
||||
</page>
|
||||
<page attrs="{'invisible': [('state', '!=', 'ready')]}" string="Statements">
|
||||
|
||||
@@ -38,7 +38,7 @@ class banking_transaction_wizard(osv.osv_memory):
|
||||
"""
|
||||
Return a popup window for this model
|
||||
"""
|
||||
if isinstance(ids, (int, float)):
|
||||
if isinstance(ids, (int,long)):
|
||||
ids = [ids]
|
||||
return {
|
||||
'name': self._description,
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<field name='payment_line_id'
|
||||
attrs="{'invisible': [('match_type', '!=', 'storno'),('match_type', '!=', 'payment')]}"
|
||||
/>
|
||||
<group attrs="{'readonly': [('match_multi', '!=' True)]}">
|
||||
<group attrs="{'readonly': [('match_multi', '!=', True)]}">
|
||||
<!-- show if we have an invoice type match (but the user may need to select from multiple options)
|
||||
or whenever there is an invoice_id (e.g. in case of a manual match)
|
||||
-->
|
||||
|
||||
@@ -242,6 +242,7 @@ def get_company_bank_account(pool, cursor, uid, account_number, currency,
|
||||
results.costs_account_id = settings.costs_account_id
|
||||
results.invoice_journal_id = settings.invoice_journal_id
|
||||
results.bank_partner_id = settings.bank_partner_id
|
||||
|
||||
return results
|
||||
|
||||
def get_or_create_bank(pool, cursor, uid, bic, online=False, code=None,
|
||||
@@ -261,7 +262,7 @@ def get_or_create_bank(pool, cursor, uid, bic, online=False, code=None,
|
||||
# search key
|
||||
bank_ids = bank_obj.search(
|
||||
cursor, uid, [
|
||||
('code', '=', bic[:6])
|
||||
('bic', '=', bic[:6])
|
||||
])
|
||||
if not bank_ids:
|
||||
bank_ids = bank_obj.search(
|
||||
|
||||
Reference in New Issue
Block a user