- In order to test the banking framework, I first need to create a profile - !record {model: account.statement.profile, id: profile_test1}: name: Bank EUR Profile journal_id: account.bank_journal commission_account_id: account.a_expense company_id: base.main_company balance_check: True rule_ids: - bank_statement_completion_rule_4 - bank_statement_completion_rule_5 - bank_statement_completion_rule_2 - bank_statement_completion_rule_3 - Now I create a statement. I create statment lines separately because I need to find each one by XML id - !record {model: account.bank.statement, id: statement_test1}: name: Statement 2 profile_id: profile_test1 company_id: base.main_company - I create a statement line for a CI - !record {model: account.bank.statement.line, id: statement_line_ci}: name: Test autocompletion based on Customer Invoice Number statement_id: statement_test1 ref: CI0001 date: '2013-12-20' amount: 210.0 - I create a statement line for a SI - !record {model: account.bank.statement.line, id: statement_line_si}: name: Test autocompletion based on Supplier Invoice Number statement_id: statement_test1 ref: T2S12345 date: '2013-12-19' amount: -65.0 - I create a statement line for a CR - !record {model: account.bank.statement.line, id: statement_line_cr}: name: Test autocompletion based on Customer Refund Number statement_id: statement_test1 ref: CR0001 date: '2013-12-19' amount: -210.0 - I create a statement line for the Partner Name - !record {model: account.bank.statement.line, id: statement_line_partner_name}: name: Test autocompletion based on Partner Name Vauxoo statement_id: statement_test1 ref: / date: '2013-12-17' amount: 600.0 - I create a statement line for the Partner Label - !record {model: account.bank.statement.line, id: statement_line_partner_label}: name: test autocompletion based on text (XXX66Z) matching with partner form information (note that Ref does not exist) statement_id: statement_test1 ref: ZU788 date: '2013-12-24' amount: -932.4 - I run the auto complete - !python {model: account.bank.statement}: | result = self.button_auto_completion(cr, uid, [ref("statement_test1")]) - Now I can check that all is nice and shiny, line 1. I expect the Customer Invoice Number to be recognised. I Use _ref, because ref conflicts with the field ref of the statement line - !assert {model: account.bank.statement.line, id: statement_line_ci, string: Check completion by CI number}: - partner_id.id == _ref("base.res_partner_12") - Line 2. I expect the Supplier invoice number to be recognised. The supplier invoice was created by the account module demo data, and we confirmed it here. - !assert {model: account.bank.statement.line, id: statement_line_si, string: Check completion by SI number}: - partner_id.id == _ref("base.res_partner_17") - Line 3. I expect the Customer refund number to be recognised. It should be the commercial partner, and not the regular partner. - !assert {model: account.bank.statement.line, id: statement_line_cr, string: Check completion by CR number and commercial partner}: - partner_id.id == _ref("base.res_partner_12") - Line 4. I check that the partner name has been recognised. - !assert {model: account.bank.statement.line, id: statement_line_partner_name, string: Check completion by partner name}: - partner_id.name == 'Vauxoo' - Line 5. I check that the partner special label has been recognised. - !assert {model: account.bank.statement.line, id: statement_line_partner_label, string: Check completion by partner label}: - partner_id.id == _ref("base.res_partner_6")