Add update domain on view field by the domain of the action

This commit is contained in:
ced@b2ck.com committed 2007-12-27 21:12:38 +01:00
1 parent 31ff19049a
commit 288577efd8
2 files changed
+10 -2

No files matched your search

+5 -2
View File
@@ -110,8 +110,11 @@ class ModelRecord(SignalEvent):
if len(self.mgroup.fields):
val = self.rpc.default_get(self.mgroup.fields.keys(), context)
for clause in domain:
if clause[0] in self.mgroup.fields and clause[1] == '=':
val[clause[0]] = clause[2]
if clause[0] in self.mgroup.fields:
if clause[1] == '=':
val[clause[0]] = clause[2]
if clause[1] == 'in' and len(d[2]) == 1:
val[clause[0]] = clause[2][0]
self.set_default(val)
def name_get(self):
@@ -239,6 +239,11 @@ class Screen(SignalEvent):
_parse_fields(node2, fields)
dom = xml.dom.minidom.parseString(arch)
_parse_fields(dom, fields)
for dom in self.domain:
if dom[0] in fields:
field_dom = str(fields[dom[0]].setdefault('domain',[]))
fields[dom[0]]['domain'] = field_dom[:1] + \
str(('id', dom[1], dom[2])) + ',' + field_dom[1:]
from tryton.gui.window.view_form.view.widget_parse import WidgetParse
models = self.models.models