Files
account-financial-tools/account_move_batch_validate/test/batch_validate_then_unmark.yml
2015-03-12 16:33:45 +01:00

64 lines
1.6 KiB
YAML

-
I create a move
-
!record {model: account.move, id: move2}:
journal_id: account.sales_journal
line_id:
- name: Receivable line
account_id: account.a_recv
debit: 2000.0
- name: Sales line
account_id: account.a_sale
credit: 2000.0
-
I check that the move is still draft
-
!assert {model: account.move, id: move2}:
- state == 'draft'
-
I create a wizard with a long ETA
-
!record {model: account.move.marker, id: wiz_marker2}:
action: mark
eta: 10000
-
I run the wizard
-
!python {model: account.move.marker}: |
context['automated_test_execute_now'] = True
self.button_mark(
cr, uid, [ref('wiz_marker2')], context=context
)
-
Now I change my mind and I create a wizard to unmark the moves
-
!record {model: account.move.marker, id: wiz_unmarker3}:
action: unmark
-
I run the wizard
-
!python {model: account.move.marker}: |
self.button_mark(
cr, uid, [ref('wiz_unmarker3')], context=context
)
-
Now I checked that my job is done, and the move is still draft
-
!python {model: account.move}: |
from openerp.addons.connector.queue.job import OpenERPJobStorage
from openerp.addons.connector.session import ConnectorSession
session = ConnectorSession(cr, uid, context=context)
storage = OpenERPJobStorage(session)
move = self.browse(cr, uid, ref('move2'), context=context)
myjob = storage.load(move.post_job_uuid)
assert myjob.state == 'done', 'Job is in state {0}, should be done'.format(
myjob.state
)
-
I check that the move is still draft
-
!assert {model: account.move, id: move2}:
- state == 'draft'