Browse Source

[MIG] account_bank_statement_import_move_line: Fix tests + URL

12.0
Pedro M. Baeza 5 years ago
parent
commit
78cc8bcce4
  1. 2
      account_bank_statement_import_move_line/__manifest__.py
  2. 8
      account_bank_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py
  3. 1
      account_bank_statement_import_move_line/wizards/account_statement_line_create.py

2
account_bank_statement_import_move_line/__manifest__.py

@ -9,7 +9,7 @@
'author': 'Tecnativa, ' 'author': 'Tecnativa, '
'Odoo Community Association (OCA)', 'Odoo Community Association (OCA)',
'maintainers': ['pedrobaeza'], 'maintainers': ['pedrobaeza'],
'website': 'https://www.tecnativa.com',
'website': 'https://github.com/OCA/bank-statement-import',
'depends': [ 'depends': [
'account', 'account',
], ],

8
account_bank_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py

@ -60,12 +60,8 @@ class TestAccountBankStatementImportMoveLine(common.SavepointCase):
'invoice': False, 'invoice': False,
}) })
wizard.populate() wizard.populate()
self.assertTrue(len(wizard.move_line_ids), 2)
wizard.invoice = True
wizard.move_line_filters_change()
wizard.populate()
self.assertTrue(len(wizard.move_line_ids), 1)
line = wizard.move_line_ids[0]
self.assertEqual(len(wizard.move_line_ids), 1)
line = wizard.move_line_ids
self.assertEqual(line.debit, self.invoice.amount_total) self.assertEqual(line.debit, self.invoice.amount_total)
wizard.create_statement_lines() wizard.create_statement_lines()
line = self.statement.line_ids[0] line = self.statement.line_ids[0]

1
account_bank_statement_import_move_line/wizards/account_statement_line_create.py

@ -89,6 +89,7 @@ class AccountStatementLineCreate(models.TransientModel):
def populate(self): def populate(self):
domain = self._prepare_move_line_domain() domain = self._prepare_move_line_domain()
lines = self.env['account.move.line'].search(domain) lines = self.env['account.move.line'].search(domain)
self.move_line_ids = False
self.move_line_ids = lines self.move_line_ids = lines
action = { action = {
'name': _('Select Move Lines to Create Statement'), 'name': _('Select Move Lines to Create Statement'),

Loading…
Cancel
Save