diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py
index 1300531f019..bd49066a80c 100644
--- a/addons/hr_expense/__openerp__.py
+++ b/addons/hr_expense/__openerp__.py
@@ -34,7 +34,6 @@ The whole workflow is implemented:
* Confirmation of the sheet by the employee
* Validation by his manager
* Validation by the accountant and receipt creation
- * Payment of the receipt to the employee
This module also uses the analytic accounting and is compatible with
the invoice on timesheet module so that you will be able to automatically
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index c80eed615d8..a1946cd7aeb 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -67,7 +67,7 @@ class hr_expense_expense(osv.osv):
'name': fields.char('Description', size=128, required=True),
'id': fields.integer('Sheet ID', readonly=True),
'date': fields.date('Date', select=True),
- 'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is receipted."),
+ 'journal_id': fields.many2one('account.journal', 'Force Journal', help = "The journal used when the expense is done."),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'user_id': fields.many2one('res.users', 'User', required=True),
'date_confirm': fields.date('Confirmation Date', select=True, help = "Date of the confirmation of the sheet expense. It's filled when the button Confirm is pressed."),
@@ -86,11 +86,10 @@ class hr_expense_expense(osv.osv):
('cancelled', 'Refused'),
('confirm', 'Waiting Approval'),
('accepted', 'Approved'),
- ('receipted', 'Waiting Reimbursement'),
- ('paid', 'Reimbursed')
+ ('done', 'Done'),
],
'Status', readonly=True, help='When the expense request is created the status is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the status is \'Waiting Confirmation\'.\
- \nIf the admin accepts it, the status is \'Accepted\'.\n If a receipt is made for the expense request, the status is \'Waiting Reimbursement\'.\n If the expense is paid to user, the status is \'Reimbursed\'.'),
+ \nIf the admin accepts it, the status is \'Accepted\'.\n If a receipt is made for the expense request, the status is \'Done\'.'),
}
_defaults = {
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'hr.employee', context=c),
@@ -130,10 +129,6 @@ class hr_expense_expense(osv.osv):
self.write(cr, uid, ids, {'state':'cancelled'})
return True
- def expense_paid(self, cr, uid, ids, *args):
- self.write(cr, uid, ids, {'state':'paid'})
- return True
-
def action_receipt_create(self, cr, uid, ids, context=None):
property_obj = self.pool.get('ir.property')
sequence_obj = self.pool.get('ir.sequence')
@@ -192,7 +187,7 @@ class hr_expense_expense(osv.osv):
account_journal.write(cr, uid, [journal.id], {'analytic_journal_id': analytic_journal_ids[0]}, context=context)
voucher_id = voucher_obj.create(cr, uid, voucher, context=context)
wkf_service.trg_validate(uid, 'account.voucher', voucher_id, 'proforma_voucher', cr)
- self.write(cr, uid, [exp.id], {'voucher_id': voucher_id, 'state': 'receipted'}, context=context)
+ self.write(cr, uid, [exp.id], {'voucher_id': voucher_id, 'state': 'done'}, context=context)
return True
def action_view_receipt(self, cr, uid, ids, context=None):
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index b84674b6369..881126161db 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -45,7 +45,7 @@
hr.expense.expensetree
-
+
@@ -68,10 +68,10 @@
-
-
+
+
-
+
diff --git a/addons/hr_expense/hr_expense_workflow.xml b/addons/hr_expense/hr_expense_workflow.xml
index 445927c0288..2e085071207 100644
--- a/addons/hr_expense/hr_expense_workflow.xml
+++ b/addons/hr_expense/hr_expense_workflow.xml
@@ -32,14 +32,6 @@
expense_accept()
-
-
- paid
- function
- expense_paid()
- True
-
-
refused
@@ -47,9 +39,9 @@
expense_canceled()
-
+
- receipt
+ donefunctionaction_receipt_create()
@@ -90,15 +82,8 @@
-
- receipt
-
-
-
-
-
-
- paid
+
+ done
diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py
index 42ee7f7bda6..72bf710ec4f 100644
--- a/addons/hr_expense/report/hr_expense_report.py
+++ b/addons/hr_expense/report/hr_expense_report.py
@@ -39,7 +39,6 @@ class hr_expense_report(osv.osv):
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'journal_id': fields.many2one('account.journal', 'Force Journal', readonly=True),
'product_qty':fields.float('Qty', readonly=True),
- 'receipted':fields.integer('# of Receipted Lines', readonly=True),
'employee_id': fields.many2one('hr.employee', "Employee's Name", readonly=True),
'date_confirm': fields.date('Confirmation Date', readonly=True),
'date_valid': fields.date('Validation Date', readonly=True),
@@ -60,8 +59,7 @@ class hr_expense_report(osv.osv):
('draft', 'Draft'),
('confirm', 'Waiting confirmation'),
('accepted', 'Accepted'),
- ('receipted', 'Receipted'),
- ('paid', 'Reimbursed'),
+ ('done', 'Done'),
('cancelled', 'Cancelled')],
'Status', readonly=True),
}
@@ -79,7 +77,6 @@ class hr_expense_report(osv.osv):
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_confirm,
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_valid,
s.voucher_id,
- count(s.voucher_id) as receipted,
s.user_valid as user_id,
s.department_id,
to_char(date_trunc('day',s.create_date), 'YYYY') as year,
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index 1800f75ee3b..8f20766fa8b 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -7,7 +7,7 @@
hr.expense.reporttree
-
+
@@ -23,7 +23,6 @@
-
@@ -56,8 +55,6 @@
help = "Confirm Expenses"/>
-
diff --git a/addons/hr_expense/test/expense_process.yml b/addons/hr_expense/test/expense_process.yml
index 7734a003ebb..c38dbad3463 100644
--- a/addons/hr_expense/test/expense_process.yml
+++ b/addons/hr_expense/test/expense_process.yml
@@ -26,22 +26,12 @@
-
!python {model: hr.expense.expense}: |
sep_expenses = self.browse(cr, uid, ref("sep_expenses"), context=context)
- assert sep_expenses.state == 'receipted', "Expense should be in 'Waiting Reimbursement' state."
+ assert sep_expenses.state == 'done', "Expense should be in 'Done' state."
assert sep_expenses.voucher_id.name == sep_expenses.name,"Receipt name is not correspond with expense name."
assert sep_expenses.voucher_id.type == 'purchase', "Receipt type is not purchase receipt."
assert sep_expenses.voucher_id.amount == sep_expenses.amount,"Receipt total amount is not correspond with expense total."
assert len(sep_expenses.voucher_id.line_dr_ids) == len(sep_expenses.line_ids),"Lines of Receipt and expense line are not correspond."
--
- I pay the expenses.
--
- !python {model: hr.expense.expense}: |
- self.expense_paid(cr, uid, [ref('sep_expenses')])
--
- I check that state of expenses is 'Paid'.
--
- !assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Paid state}:
- - state == 'paid'
-
I duplicate the expenses and cancel duplicated.
-