odoo/addons/hr_expense/test/expense_process.yml

35 lines
1.2 KiB
YAML

-
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])