Add patch for issue4884

This commit is contained in:
Sergi Almacellas Abellana 2015-07-21 12:50:32 +02:00
parent cafd09a6ab
commit 667aed8957
2 changed files with 66 additions and 0 deletions

65
domain_field.diff Normal file
View File

@ -0,0 +1,65 @@
diff -r 1a22411f9264 trytond/trytond/model/fields/many2many.py
--- a/trytond/trytond/model/fields/many2many.py Thu Jul 16 01:13:45 2015 +0200
+++ b/trytond/trytond/model/fields/many2many.py Mon Jul 20 14:20:18 2015 +0200
@@ -270,6 +270,9 @@
transaction = Transaction()
table, _ = tables[None]
name, operator, value = domain[:3]
+ method = getattr(Model, 'domain_%s' % name, None)
+ if method:
+ return method(domain, tables)
if Relation._history and transaction.context.get('_datetime'):
relation = Relation.__table_history__()
diff -r 1a22411f9264 trytond/trytond/model/fields/many2one.py
--- a/trytond/trytond/model/fields/many2one.py Thu Jul 16 01:13:45 2015 +0200
+++ b/trytond/trytond/model/fields/many2one.py Mon Jul 20 14:20:18 2015 +0200
@@ -141,6 +141,9 @@
table, _ = tables[None]
name, operator, value = domain[:3]
+ method = getattr(Model, 'domain_%s' % name, None)
+ if method:
+ return method(domain, tables)
column = self.sql_column(table)
if '.' not in name:
if operator in ('child_of', 'not child_of'):
diff -r 1a22411f9264 trytond/trytond/model/fields/one2many.py
--- a/trytond/trytond/model/fields/one2many.py Thu Jul 16 01:13:45 2015 +0200
+++ b/trytond/trytond/model/fields/one2many.py Mon Jul 20 14:20:18 2015 +0200
@@ -231,6 +231,9 @@
transaction = Transaction()
table, _ = tables[None]
name, operator, value = domain[:3]
+ method = getattr(Model, 'domain_%s' % name, None)
+ if method:
+ return method(domain, tables)
if Target._history and transaction.context.get('_datetime'):
target = Target.__table_history__()
diff -r 1a22411f9264 trytond/trytond/model/fields/property.py
--- a/trytond/trytond/model/fields/property.py Thu Jul 16 01:13:45 2015 +0200
+++ b/trytond/trytond/model/fields/property.py Mon Jul 20 14:20:18 2015 +0200
@@ -72,6 +72,9 @@
cursor = Transaction().cursor
name, operator, value = domain
+ method = getattr(Model, 'domain_%s' % name, None)
+ if method:
+ return method(domain, tables)
sql_type = self._field.sql_type().base
diff -r 1a22411f9264 trytond/trytond/model/fields/reference.py
--- a/trytond/trytond/model/fields/reference.py Thu Jul 16 01:13:45 2015 +0200
+++ b/trytond/trytond/model/fields/reference.py Mon Jul 20 14:20:18 2015 +0200
@@ -125,6 +125,9 @@
return super(Reference, self).convert_domain(domain, tables, Model)
pool = Pool()
name, operator, value, target = domain[:4]
+ method = getattr(Model, 'domain_%s' % name, None)
+ if method:
+ return method(domain, tables)
Target = pool.get(target)
table, _ = tables[None]
name, target_name = name.split('.', 1)

1
series
View File

@ -58,3 +58,4 @@ issue17281002_20001.diff
issue20301003_1.diff
#invoice_speedup.diff
babi_multiprocess.diff
domain_field.diff