diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index 2dc6ad090ac..b671705d769 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -82,6 +82,7 @@ class hr_expense_expense(osv.osv):
('accepted', 'Approved'),
('invoiced', 'Invoiced'),
('paid', 'Reimbursed'),
+ ('invoice_except', 'Invoice Exception'),
('cancelled', 'Refused')],
'State', readonly=True, help='When the expense request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Confirmation\'.\
\nIf the admin accepts it, the state is \'Accepted\'.\n If an invoice is made for the expense request, the state is \'Invoiced\'.\n If the expense is paid to user, the state is \'Reimbursed\'.'),
@@ -224,6 +225,10 @@ class hr_expense_expense(osv.osv):
res = inv_id
return res
+ def action_invoice_cancel(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, {'state': 'invoice_except'}, context=context)
+ return True
+
hr_expense_expense()
class product_product(osv.osv):
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 786dc6beee2..a832191bb90 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -106,6 +106,7 @@
+
diff --git a/addons/hr_expense/hr_expense_workflow.xml b/addons/hr_expense/hr_expense_workflow.xml
index 7946bef3b6b..457b0a10b38 100644
--- a/addons/hr_expense/hr_expense_workflow.xml
+++ b/addons/hr_expense/hr_expense_workflow.xml
@@ -55,6 +55,13 @@
action_invoice_create()
+
+
+ invoice_except
+ function
+ action_invoice_cancel()
+
+
@@ -117,5 +124,18 @@
+
+
+
+ subflow.cancel
+
+
+
+
+
+
+ invoice_recreate_hr_expense
+
+