From fcafe351d817c43d07cead5400277d7c79967b3b Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Fri, 14 Nov 2014 14:54:12 +0100 Subject: [PATCH] Recursion when calling a method with old-style api signature from browse --- base_report_to_printer/printing.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/base_report_to_printer/printing.py b/base_report_to_printer/printing.py index 354e901..afb8369 100644 --- a/base_report_to_printer/printing.py +++ b/base_report_to_printer/printing.py @@ -151,11 +151,26 @@ class PrintingPrinter(models.Model): return _super.search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count) + @api.v7 + def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): + # https://github.com/odoo/odoo/issues/3644 + # self.update(cr, user, context=context) + _super = super(PrintingPrinter, self) + return _super.read(cr, user, ids, fields=fields, context=context, + load=load) + @api.v8 def read(self, fields=None, load='_classic_read'): self.update() return super(PrintingPrinter, self).read(fields=fields, load=load) + @api.v7 + def browse(self, cr, uid, arg=None, context=None): + # https://github.com/odoo/odoo/issues/3644 + # self.update(cr, uid, context=context) + _super = super(PrintingPrinter, self) + return _super.browse(cr, uid, arg=arg, context=context) + @api.v8 def browse(self, arg=None): self.update()