[FIX] Correct the bank_label based completion method + open imported statement in new windows

(lp:c2c-financial-addons/6.1 rev 24.1.31)
This commit is contained in:
Joël Grand-Guillaume
2012-06-22 11:32:56 +02:00
parent 6e724ba1b1
commit 4abea930b5
4 changed files with 12 additions and 6 deletions

View File

@@ -20,3 +20,4 @@
############################################################################## ##############################################################################
import statement import statement
import partner

View File

@@ -209,7 +209,7 @@ class AccountStatementCompletionRule(Model):
compt = 0 compt = 0
if st_line: if st_line:
ids = partner_obj.search(cursor, uid, [['bank_statement_label', '!=', False]], context=context) ids = partner_obj.search(cursor, uid, [['bank_statement_label', '!=', False]], context=context)
for partner in self.browse(cursor, uid, ids, context=context): for partner in partner_obj.browse(cursor, uid, ids, context=context):
for partner_label in partner.bank_statement_label.split(';'): for partner_label in partner.bank_statement_label.split(';'):
if partner_label in st_line.label: if partner_label in st_line.label:
compt += 1 compt += 1

View File

@@ -110,6 +110,11 @@ class CreditPartnerStatementImporter(osv.osv_memory):
ftype.replace('.',''), ftype.replace('.',''),
context=context context=context
) )
return {
# We should return here the profile for which we executed the import 'domain': "[('id','in', ["+','.join(map(str,[sid]))+"])]",
return {'type': 'ir.actions.act_window_close'} 'name': 'Imported Bank Statement',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.bank.statement',
'type': 'ir.actions.act_window',
}

View File

@@ -4,7 +4,7 @@
<record id="bank_statement_completion_rule_4" model="account.statement.completion.rule"> <record id="bank_statement_completion_rule_4" model="account.statement.completion.rule">
<field name="name">Match from line reference (based on transaction ID)</field> <field name="name">Match from line reference (based on transaction ID)</field>
<field name="sequence">40</field> <field name="sequence">30</field>
<field name="function_to_call">get_from_transaction_id_and_so</field> <field name="function_to_call">get_from_transaction_id_and_so</field>
</record> </record>