Created
March 23, 2017 11:09
-
-
Save odony/eb288b2308cef8d2e2c6a467eb4aded2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/addons/website/models/website.py b/addons/website/models/website.py | |
index f630eef..7794ff8 100644 | |
--- a/addons/website/models/website.py | |
+++ b/addons/website/models/website.py | |
@@ -540,9 +540,8 @@ class Website(models.Model): | |
continue | |
values = [{}] | |
convitems = converters.items() | |
- # converters with a domain are processed after the other ones | |
- gd = lambda x: hasattr(x[1], 'domain') and (x[1].domain != '[]') | |
- convitems.sort(lambda x, y: cmp(gd(x), gd(y))) | |
+ # converters with a domain are processed after the other ones, but from left to right | |
+ convitems.sort(key=lambda x: (hasattr(x[1], 'domain') and (x[1].domain != '[]'), rule._trace.index((True,x[0])))) | |
for (i, (name, converter)) in enumerate(convitems): | |
newval = [] | |
for val in values: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment