Fix list of invoices when an invoice has an invalid created_by user
This commit is contained in:
parent
43294a40f5
commit
ac00942f34
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ class Invoice < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_can_edit?(user)
|
def user_can_edit?(user)
|
||||||
user.role_finance? || (user.role_invoices? && !self.paid_on && self.created_by.id == user.id)
|
user.role_finance? || (user.role_invoices? && !self.paid_on && self.created_by.try(:id) == user.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Amount without deposit
|
# Amount without deposit
|
||||||
|
|
Loading…
Reference in a new issue