diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py index 746f0c363e5b1c5e8021ea2bbae80d3bd675d075..7580ba6e00a9706c92b383f30e3abd2d4f2c8fd8 100644 --- a/product/ERP5/Document/Document.py +++ b/product/ERP5/Document/Document.py @@ -662,9 +662,6 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): first = res[0] in_original = None for ob in res: - if ob.getLanguage() == original_language: - # this is in original language - in_original = ob if ob.getVersion() != first.getVersion(): # we are out of the latest version - return in_original or first if in_original is not None: @@ -674,6 +671,9 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): if ob.getLanguage() == user_language: # we found it in the user language return ob.getObject() + if ob.getLanguage() == original_language: + # this is in original language + in_original = ob # this is the only doc in this version return self