From 51bd1e3628eac3da00b0e9b56c523f962f90eb35 Mon Sep 17 00:00:00 2001 From: "@" <@> Date: Tue, 27 Nov 2012 16:54:35 +0100 Subject: [PATCH] [CHG] the public methods used by the buttons only allow to run on 1 id, changes on multiple ids should use the cron which does not raise the errors --- pingen/pingen_document.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pingen/pingen_document.py b/pingen/pingen_document.py index 6a2a80d..8d21216 100644 --- a/pingen/pingen_document.py +++ b/pingen/pingen_document.py @@ -152,6 +152,7 @@ class pingen_document(orm.Model): Wrapper method for multiple ids (when triggered from button for instance) for public interface. """ + assert len(ids) == 1, "Only 1 id is allowed" with self._get_pingen_session(cr, uid, context=context) as session: for document in self.browse(cr, uid, ids, context=context): try: @@ -282,6 +283,7 @@ class pingen_document(orm.Model): Wrapper method for multiple ids (when triggered from button for instance) for public interface. """ + assert len(ids) == 1, "Only 1 id is allowed" with self._get_pingen_session(cr, uid, context=context) as session: for document in self.browse(cr, uid, ids, context=context): try: @@ -388,6 +390,7 @@ class pingen_document(orm.Model): Wrapper method for multiple ids (when triggered from button for instance) for public interface. """ + assert len(ids) == 1, "Only 1 id is allowed" with self._get_pingen_session(cr, uid, context=context) as session: for document in self.browse(cr, uid, ids, context=context): try: