[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

This commit is contained in:
@
2012-11-27 16:54:35 +01:00
committed by Anna Janiszewska
parent 7c1c19b6d7
commit 51bd1e3628

View File

@@ -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: