diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 3da8436a1da..5b06a40acb1 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -482,7 +482,7 @@
account.invoice
form
tree,form,calendar,graph
- [('state','!=','draft'),('reconciled','=',False),('type','=','out_invoice')]
+ [('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','out_invoice')]
{'type':'out_invoice'}
@@ -526,7 +526,7 @@
account.invoice
form
tree,form,calendar,graph
- [('state','!=','draft'),('reconciled','=',False),('type','=','in_invoice')]
+ [('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','in_invoice')]
{'type':'in_invoice'}
@@ -570,7 +570,7 @@
account.invoice
form
tree,form,calendar,graph
- [('state','!=','draft'),('reconciled','=',False),('type','=','out_refund')]
+ [('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','out_refund')]
{'type':'out_refund'}
@@ -614,7 +614,7 @@
account.invoice
form
tree,form,calendar,graph
- [('state','!=','draft'),('reconciled','=',False),('type','=','in_refund')]
+ [('state','not in',['draft','cancel']),('reconciled','=',False),('type','=','in_refund')]
{'type':'in_refund'}
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 902fe5523bb..eb231bd4ca4 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -837,7 +837,7 @@ class account_move_line(osv.osv):
if journal.type_control_ids:
type = account.user_type
for t in journal.type_control_ids:
- if type==t.code:
+ if type.code == t.code:
ok = True
break
if journal.account_control_ids and not ok: