diff --git a/invoice.py b/invoice.py index ba7729b130..67ad8671e6 100644 --- a/invoice.py +++ b/invoice.py @@ -161,3 +161,31 @@ class InvoiceLine(OSV): return res InvoiceLine() + + +class Account(OSV): + _name = 'analytic_account.account' + + def delete(self, cursor, user, ids, context=None): + account_invoice_line_obj = self.pool.get('account.invoice.line') + res = super(Account, self).delete(cursor, user, ids, context=context) + # Restart the cache on the fields_view_get method of account.invoice.line + account_invoice_line_obj.fields_view_get(cursor.dbname) + return res + + def create(self, cursor, user, vals, context=None): + account_invoice_line_obj = self.pool.get('account.invoice.line') + res = super(Account, self).create(cursor, user, vals, context=context) + # Restart the cache on the fields_view_get method of account.invoice.line + account_invoice_line_obj.fields_view_get(cursor.dbname) + return res + + def write(self, cursor, user, ids, vals, context=None): + account_invoice_line_obj = self.pool.get('account.invoice.line') + res = super(Account, self).write(cursor, user, ids, vals, + context=context) + # Restart the cache on the fields_view_get method of account.invoice.line + account_invoice_line_obj.fields_view_get(cursor.dbname) + return res + +Account()