Skip to content

Commit

Permalink
Merge pull request #28 from grindtildeath/7.0_fix_context_check
Browse files Browse the repository at this point in the history
[7.0][FIX] Add context check to avoid AttributeError when context=None
  • Loading branch information
pedrobaeza committed Sep 14, 2018
2 parents 455da26 + 09d8722 commit f68b551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion project_billing_utils/analytic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AccountAnalyticLine(orm.Model):

def write(self, cr, uid, ids, vals, context=None):
"""Put a key in the vals, since we have no context. Return super."""
if context.get('skip_invoice_check'):
if context and context.get('skip_invoice_check'):
vals['_x_vals_skip_invoice_check'] = True
return super(AccountAnalyticLine, self).write(
cr, uid, ids, vals, context=context)
Expand Down

0 comments on commit f68b551

Please sign in to comment.