-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpense_process.yml
34 lines (34 loc) · 1.24 KB
/
expense_process.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-
In order to test the process of "Employee Expenses" by processing the expenses, I confirm Expense Bill of an employee for September month.
-
!workflow {model: hr.expense.expense, action: confirm, ref: sep_expenses}
-
I check that state is 'Confirm'.
-
!assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Confirm state}:
- state == 'confirm'
-
I approve the September expenses.
-
!workflow {model: hr.expense.expense, action: validate, ref: sep_expenses}
-
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'
-
I make Receipt for the expense.
-
!workflow {model: hr.expense.expense, action: done, ref: sep_expenses}
-
I check receipt details.
-
!python {model: hr.expense.expense}: |
sep_expenses = self.browse(cr, uid, ref("sep_expenses"), context=context)
assert sep_expenses.state == 'done', "Expense should be in 'Done' state."
-
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])