2011-11-28 08:06:57 +00:00
|
|
|
-
|
2011-12-13 11:28:43 +00:00
|
|
|
In order to test the process of "Employee Expenses" by processing the expenses, I confirm Expense Bill of an employee for September month.
|
2011-11-28 08:06:57 +00:00
|
|
|
-
|
|
|
|
!workflow {model: hr.expense.expense, action: confirm, ref: sep_expenses}
|
|
|
|
-
|
2011-12-08 06:15:46 +00:00
|
|
|
I check that state is 'Confirm'.
|
2011-11-28 08:06:57 +00:00
|
|
|
-
|
2011-12-08 06:15:46 +00:00
|
|
|
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Confirm state}:
|
2011-11-28 08:06:57 +00:00
|
|
|
- state == 'confirm'
|
|
|
|
-
|
2011-12-08 06:15:46 +00:00
|
|
|
I approve the September expenses.
|
2011-11-28 08:06:57 +00:00
|
|
|
-
|
|
|
|
!workflow {model: hr.expense.expense, action: validate, ref: sep_expenses}
|
2011-12-08 06:15:46 +00:00
|
|
|
-
|
|
|
|
I check that state is 'Approved'
|
|
|
|
-
|
|
|
|
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Approved state}:
|
|
|
|
- state == 'accepted'
|
2011-11-28 08:06:57 +00:00
|
|
|
-
|
2012-07-13 11:47:17 +00:00
|
|
|
I make Receipt for the expense.
|
2011-11-28 08:06:57 +00:00
|
|
|
-
|
2012-07-17 11:38:03 +00:00
|
|
|
!workflow {model: hr.expense.expense, action: done, ref: sep_expenses}
|
2011-11-28 08:06:57 +00:00
|
|
|
-
|
2012-07-13 11:47:17 +00:00
|
|
|
I check receipt details.
|
2011-11-28 08:06:57 +00:00
|
|
|
-
|
|
|
|
!python {model: hr.expense.expense}: |
|
|
|
|
sep_expenses = self.browse(cr, uid, ref("sep_expenses"), context=context)
|
2012-07-17 10:42:14 +00:00
|
|
|
assert sep_expenses.state == 'done', "Expense should be in 'Done' state."
|
2011-12-13 11:28:43 +00:00
|
|
|
-
|
|
|
|
I duplicate the expenses and cancel duplicated.
|
|
|
|
-
|
|
|
|
!python {model: hr.expense.expense}: |
|
|
|
|
duplicate_id = self.copy(cr, uid, ref('sep_expenses'), context=context)
|
|
|
|
self.expense_canceled(cr, uid, [duplicate_id])
|