From 4f2ad534fe9c08877fcfb067f71377988ea4e2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 14 Nov 2008 01:39:05 +0100 Subject: [PATCH] Restart the cache on the fields_view_get method of sale.line --- sale.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sale.py b/sale.py index 67060e2a36..a63d6ae7a5 100644 --- a/sale.py +++ b/sale.py @@ -156,3 +156,31 @@ class SaleLine(OSV): return res SaleLine() + + +class Account(OSV): + _name = 'analytic_account.account' + + def delete(self, cursor, user, ids, context=None): + sale_line_obj = self.pool.get('sale.line') + res = super(Account, self).delete(cursor, user, ids, context=context) + # Restart the cache on the fields_view_get method of sale.line + sale_line_obj.fields_view_get(cursor.dbname) + return res + + def create(self, cursor, user, vals, context=None): + sale_line_obj = self.pool.get('sale.line') + res = super(Account, self).create(cursor, user, vals, context=context) + # Restart the cache on the fields_view_get method of sale.line + sale_line_obj.fields_view_get(cursor.dbname) + return res + + def write(self, cursor, user, ids, vals, context=None): + sale_line_obj = self.pool.get('sale.line') + res = super(Account, self).write(cursor, user, ids, vals, + context=context) + # Restart the cache on the fields_view_get method of sale.line + sale_line_obj.fields_view_get(cursor.dbname) + return res + +Account()