[IMP] account:assigned dynamic value to period_id in yml

bzr revid: mtr@tinyerp.com-20111004130856-hkxmjkt241xtk42q
This commit is contained in:
Meera Trambadia (OpenERP) 2011-10-04 18:38:56 +05:30
parent 9c3b584486
commit aa89c87d58
1 changed files with 9 additions and 5 deletions

View File

@ -4,8 +4,9 @@
I select the journal for bank statement
-
!python {model: account.bank.statement}: |
import time
journal = self._default_journal_id(cr, uid, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
'journal_type': 'bank', 'period_id': 9, 'active_ids': [ref('menu_bank_statement_tree')], 'active_id': ref('menu_bank_statement_tree')})
'journal_type': 'bank', 'period_id': time.strftime('%m'), 'active_ids': [ref('menu_bank_statement_tree')], 'active_id': ref('menu_bank_statement_tree')})
assert journal, _('Journal has not been selected')
-
I select the date
@ -18,8 +19,9 @@
I select the period for bank statement
-
!python {model: account.bank.statement}: |
import time
period = self._get_period(cr, uid, {'lang': u'en_US', 'tz': False, 'active_model': 'ir.ui.menu',
'journal_type': 'bank', 'period_id': 9, 'active_ids': [ref('menu_bank_statement_tree')], 'active_id': ref('menu_bank_statement_tree')})
'journal_type': 'bank', 'period_id':time.strftime('%m'), 'active_ids': [ref('menu_bank_statement_tree')], 'active_id': ref('menu_bank_statement_tree')})
assert period, _('Period has not been selected')
-
I create a bank statement with Opening and Closing balance 0.
@ -30,7 +32,7 @@
date: !eval time.strftime('%Y-%m-%d')
journal_id: account.bank_journal
name: / Test bank statement
period_id: account.period_10
-
I create bank statement line
-
@ -66,9 +68,10 @@
I compute bank statement using Compute button
-
!python {model: account.bank.statement}: |
import time
self.button_dummy(cr, uid, [ref("account_bank_statement_0")], {"lang": "en_US",
"tz": False, "active_model": "ir.ui.menu", "journal_type": "bank", "section_id":
False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")],
False, "period_id": time.strftime('%m'), "active_ids": [ref("account.menu_bank_statement_tree")],
"active_id": ref("account.menu_bank_statement_tree"), })
-
@ -81,9 +84,10 @@
I confirm the bank statement using Confirm button
-
!python {model: account.bank.statement}: |
import time
self.button_confirm_bank(cr, uid, [ref("account_bank_statement_0")], {"lang":
"en_US", "tz": False, "active_model": "ir.ui.menu", "journal_type": "bank",
"section_id": False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")],
"section_id": False, "period_id": time.strftime('%m'), "active_ids": [ref("account.menu_bank_statement_tree")],
"active_id": ref("account.menu_bank_statement_tree"), })
-
I check that bank statement state is now "Closed"